Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{Container} az container attach: Fix the exception handling for streaming logs #26807

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

LuisJesusMunozMolina
Copy link

@LuisJesusMunozMolina LuisJesusMunozMolina commented Jul 3, 2023

Related command
stream_logs function in src/azure-cli/azure/cli/command_modules/container/custom.py.

Description
This issue is due to the fact that an exception was not properly handled. This exception takes place when a log is received by the function _stream_logs but is of type Nonetype for some reason. Indeed, this function is properly working in most scenarios, however problems have been experienced for some particular deployments where some libraries have their own log system, and therefor these logs cannot be properly treated by the _stream_logs function.

image

This issues does not take place when the docker container is run in local, it only appears when it is deployed in the Azure Container Instance

In this pull request, a try and except policy have been included in order handle the exception

History Notes

{Azure Container Instance} cli-custom.py. MINOR ISSUE: bad exception handling in _stream_logs function in custom.py file

This checklist is used to make sure that common guidelines for a pull request are followed.

…modules/container/custom.py. This updating is due to the fact that an exception was not properly handled. This exception takes place when a log is received by the function _stream_logs but is None for some reason. Indeed, this function is properly working in most scenarios but problems have been experienced for some particular deployments where some libraries have their own log system
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 3, 2023

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.10
️✔️3.9
️✔️ams
️✔️latest
️✔️3.10
️✔️3.9
️✔️apim
️✔️latest
️✔️3.10
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.10
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.10
️✔️3.9
️✔️aro
️✔️latest
️✔️3.10
️✔️3.9
️✔️backup
️✔️latest
️✔️3.10
️✔️3.9
️✔️batch
️✔️latest
️✔️3.10
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.10
️✔️3.9
️✔️billing
️✔️latest
️✔️3.10
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.10
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.10
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.10
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.10
️✔️3.9
️✔️config
️✔️latest
️✔️3.10
️✔️3.9
️✔️configure
️✔️latest
️✔️3.10
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.10
️✔️3.9
️✔️container
️✔️latest
️✔️3.10
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.10
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️dla
️✔️latest
️✔️3.10
️✔️3.9
️✔️dls
️✔️latest
️✔️3.10
️✔️3.9
️✔️dms
️✔️latest
️✔️3.10
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.10
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.10
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.10
️✔️3.9
️✔️find
️✔️latest
️✔️3.10
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.10
️✔️3.9
️✔️identity
️✔️latest
️✔️3.10
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.10
️✔️3.9
️✔️lab
️✔️latest
️✔️3.10
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.10
️✔️3.9
️✔️maps
️✔️latest
️✔️3.10
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.10
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.10
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.10
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.10
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.10
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.10
️✔️3.9
️✔️profile
️✔️latest
️✔️3.10
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.10
️✔️3.9
️✔️redis
️✔️latest
️✔️3.10
️✔️3.9
️✔️relay
️✔️latest
️✔️3.10
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️role
️✔️latest
️✔️3.10
️✔️3.9
️✔️search
️✔️latest
️✔️3.10
️✔️3.9
️✔️security
️✔️latest
️✔️3.10
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.10
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.10
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.10
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.10
️✔️3.9
️✔️sql
️✔️latest
️✔️3.10
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.10
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.10
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9
️✔️util
️✔️latest
️✔️3.10
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.10
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.10
️✔️3.9
️✔️latest
️✔️3.10
️✔️3.9

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 3, 2023

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 3, 2023
@ghost
Copy link

ghost commented Jul 3, 2023

Thank you for your contribution LuisJesusMunozMolina! We will review the pull request and get back to you soon.

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 3, 2023

custom.py

@zhoxing-ms zhoxing-ms changed the title [custom.py] MINOR ISSUE: bad exception handling in _stream_logs function in custom.py file [Container] MINOR ISSUE: bad exception handling in _stream_logs function in custom.py file Jul 25, 2023
@zhoxing-ms zhoxing-ms changed the title [Container] MINOR ISSUE: bad exception handling in _stream_logs function in custom.py file [Container] Fix the exception handling for streaming logs Jul 25, 2023
@zhoxing-ms
Copy link
Contributor

@LuisJesusMunozMolina Please resolve these CI issues

@zhoxing-ms
Copy link
Contributor

@fnuarnav Could you please help review this container related PR?

@LuisJesusMunozMolina
Copy link
Author

I will review it, thank you :)

@LuisJesusMunozMolina LuisJesusMunozMolina changed the title [Container] Fix the exception handling for streaming logs {Azure Container Instance} Fix the exception handling for streaming logs Jul 26, 2023
@LuisJesusMunozMolina LuisJesusMunozMolina changed the title {Azure Container Instance} Fix the exception handling for streaming logs {Azure Container Instance} CLI-custom.py updated. Fix the exception handling for streaming logs Jul 26, 2023
@zhoxing-ms zhoxing-ms changed the title {Azure Container Instance} CLI-custom.py updated. Fix the exception handling for streaming logs {Container} CLI-custom.py updated. Fix the exception handling for streaming logs Aug 29, 2023
@zhoxing-ms zhoxing-ms changed the title {Container} CLI-custom.py updated. Fix the exception handling for streaming logs {Container} az container attach: Fix the exception handling for streaming logs Aug 29, 2023
@zhoxing-ms
Copy link
Contributor

@LuisJesusMunozMolina Any update?

@LuisJesusMunozMolina
Copy link
Author

Hi @zhoxing-ms , I took a look but I did not see any detail about the CI issues, so I could not fix them yet. Could someone please give some hints?
Thank you in advance.
Luis

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Aug 30, 2023

Sorry, I am super busy recently, @yanzhudd will help check the CI issue and give you some tips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants