Skip to content

[ACR] az acr login: Fix login status code when command fails#30917

Closed
ronlv4 wants to merge 6 commits intoAzure:devfrom
ronlv4:fix-cli-status-code
Closed

[ACR] az acr login: Fix login status code when command fails#30917
ronlv4 wants to merge 6 commits intoAzure:devfrom
ronlv4:fix-cli-status-code

Conversation

@ronlv4
Copy link
Contributor

@ronlv4 ronlv4 commented Mar 1, 2025

Related command
az acr login

Description
When az acr login fails for docker login, the command should return a non-zero status code.
Why wasn't this the case? the check was if stderr is not empty. In the case docker is not running, stderr is empty and the error is written to stdout:

The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

For details about using Docker Desktop with WSL 2, visit:

https://docs.docker.com/go/wsl2/

fixes #27907

Testing Guide
Test acr module

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

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

azure-client-tools-bot-prd bot commented Mar 1, 2025

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

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

azure-client-tools-bot-prd bot commented Mar 1, 2025

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

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 1, 2025

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

@github-actions
Copy link

github-actions bot commented Mar 1, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Mar 1, 2025
@ronlv4 ronlv4 changed the title [Acr] BREAKING CHANGE: az acr login: Fix login status code when command fails [Container Registry] BREAKING CHANGE: az acr login: Fix login status code when command fails Mar 1, 2025
@zhoxing-ms
Copy link
Contributor

Please note that the PR for breaking change must be released in the breaking change window, but you need to consider pre-pronouncing the breaking change to the customer in advance. For more details, please refer to this doc: https://github.com/Azure/azure-cli/blob/dev/doc/how_to_introduce_breaking_changes.md

@ronlv4
Copy link
Contributor Author

ronlv4 commented Mar 24, 2025

@microsoft-github-policy-service agree company="Microsoft"

@ronlv4
Copy link
Contributor Author

ronlv4 commented May 13, 2025

I should be more precise on the issue, the status code is 0 when the command fails for docker login, meaning it passed the internal az acr validations (for existing subscription and acr).
so for valid arguments you can reproduce the issue:
image

@zhoxing-ms zhoxing-ms changed the title [ACR]: az acr login: Fix login status code when command fails [ACR] az acr login: Fix login status code when command fails May 13, 2025
@zhoxing-ms
Copy link
Contributor

please note that Azure CLI will have a code freeze on 05/27/2025 07:00 UTC for the upcoming release. Please address these CI issues ASAP, otherwise it has to be postponed to next sprint (07-01).

Copy link
Member

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhoxing-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms
Copy link
Contributor

Could you please pull the latest code from remote dev branch to see if it can resolve this CI issue?

@ronlv4
Copy link
Contributor Author

ronlv4 commented Jun 8, 2025

Could you please pull the latest code from remote dev branch to see if it can resolve this CI issue?

done

@zhoxing-ms zhoxing-ms closed this Jun 23, 2025
@zhoxing-ms zhoxing-ms reopened this Jun 23, 2025
@zhoxing-ms zhoxing-ms closed this Jun 23, 2025
@zhoxing-ms zhoxing-ms reopened this Jun 23, 2025
@zhoxing-ms
Copy link
Contributor

/azp run

1 similar comment
@zhoxing-ms
Copy link
Contributor

/azp run

@zhoxing-ms
Copy link
Contributor

@ronlv4 This PR encountered some issues of Github that prevented it from triggering the CI pipeline again. Could you please create a new PR with the same functionality? Then we will replace this PR with the new one, and then merge the new PR

@ronlv4
Copy link
Contributor Author

ronlv4 commented Jun 23, 2025

@ronlv4 This PR encountered some issues of Github that prevented it from triggering the CI pipeline again. Could you please create a new PR with the same functionality? Then we will replace this PR with the new one, and then merge the new PR

opened #31692 .
let me know if it's still not working, I'll delete the repo and clone it again

@zhoxing-ms
Copy link
Contributor

opened #31692 .

Thanks for your quick response, I will close this PR, since this PR has been replaced by #31692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Container Registry az acr 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.

acr login command failed on wsl2 with exit code 0

7 participants