-
Notifications
You must be signed in to change notification settings - Fork 97
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
Bad error message when not logged in to container registry #6297
Comments
/cc @ytimocin |
Is this already fixed? I just retried it and the result is: Building test/functional/samples/testdata/tutorial-environment.bicep...
Failed to publish Bicep file "test/functional/samples/testdata/tutorial-environment.bicep" to "rynowak.azurecr.io/test/functional/corerp/recipes/dapr-state-store:latest". Cause: POST "https://rynowak.azurecr.io/v2/test/functional/corerp/recipes/dapr-state-store/blobs/uploads/": response status code 401: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.: [map[Action:pull Name:test/functional/corerp/recipes/dapr-state-store Type:repository] map[Action:push Name:test/functional/corerp/recipes/dapr-state-store Type:repository]]. Still quite some text, but the reference to |
The error message coming from ACR does include a link to the instructions, but most users don't notice when they hit this. The ACR team did a good job with the error message they provide, but I don't think that's the case for every registry. We had a similar issue reported here: #6902 which is evidence that this is still confusing. If you look at the code, we're not doing anything special to handle failed logins: https://github.com/radius-project/radius/blob/main/pkg/cli/cmd/bicep/publish/publish.go#L300 We're just trying to publish and then printing whatever error comes back from the server. I think a good fix to this would attempt to authenticate up-front, and then "pretty print" the error that comes out using The error we print to the console should make a few things clear:
Since users can use I think it some of these cases users aren't aware of what's happening behind the scenes (pulling/pushing from an OCI registry) so the error message is confusing. |
/cc @ytimocin in case you have additional thoughts |
Sounds good to me. The result of the call to |
I think that's a good option too. I was thinking we'd explicitly try to auth (new code) so we know whether it not it succeeds easily. |
Thanks for the input. If that's okay, I would try to provide a fix for that. |
This URL is useless. It doesn't document how to login to the ACR. |
Good to know, I didn't click it 😆 @lechnerc77 - looks like @gpltaylor already started working on a fix for this here: #6974 (comment) |
# Description Improve error message returned when publishing to a private ACR ## Type of change <!-- Please select **one** of the following options that describes your change and delete the others. Clearly identifying the type of change you are making will help us review your PR faster, and is used in authoring release notes. If you are making a bug fix or functionality change to Radius and do not have an associated issue link please create one now. --> - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). <!-- Please update the following to link the associated issue. This is required for some kinds of changes (see above). --> Fixes: #6902 #6297 ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> copilot:all --------- Signed-off-by: Garry Taylor <[email protected]> Co-authored-by: Ryan Nowak <[email protected]>
Fixed by #6974 |
Thanks @gpltaylor ! |
…ect#6974) # Description Improve error message returned when publishing to a private ACR ## Type of change <!-- Please select **one** of the following options that describes your change and delete the others. Clearly identifying the type of change you are making will help us review your PR faster, and is used in authoring release notes. If you are making a bug fix or functionality change to Radius and do not have an associated issue link please create one now. --> - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). <!-- Please update the following to link the associated issue. This is required for some kinds of changes (see above). --> Fixes: radius-project#6902 radius-project#6297 ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> copilot:all --------- Signed-off-by: Garry Taylor <[email protected]> Co-authored-by: Ryan Nowak <[email protected]> Signed-off-by: willdavsmith <[email protected]>
Bug information
Steps to reproduce (required)
Any source and destination are fine, as long as you are not logged in to the destination.
Observed behavior (required)
Desired behavior (required)
A better error message, that explains the problem and tells you how to log in. If I were an external customer I wouldn't be sure how to fix this.
AB#7968
AB#9502
AB#10830
The text was updated successfully, but these errors were encountered: