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

Cannot read properties of undefined (reading 'isAnonymousAccess') #31980

Closed
6 tasks
MadsHT opened this issue Nov 27, 2024 · 4 comments
Closed
6 tasks

Cannot read properties of undefined (reading 'isAnonymousAccess') #31980

MadsHT opened this issue Nov 27, 2024 · 4 comments
Labels
Client This issue points to a problem in the data-plane of the library. Container Registry customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@MadsHT
Copy link

MadsHT commented Nov 27, 2024

  • Package Name:
  • Package Version:
  • Operating system:
  • nodejs
    • version: v21.4.0
  • browser
    • name/version: First encountered when running as a Visual Studio Code extension
  • typescript
    • version: 5.6.2
  • Is the bug related to documentation in

Describe the bug

I am unable to authenticate with the container registry using the @azure/container-registry module, it occurs even when using the sample code provided in this repo.

Image

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repo
  2. Navigate to this folder sdk/containerregistry/container-registry/samples/v1/typescript
  3. Run npm install
  4. Run npm run build
  5. Go into this file sdk/containerregistry/container-registry/samples/v1/javascript/containerRegistryClient.js
  6. Change the <endpoint> on line 15 to a valid repo name
  7. Remove line 24 (Optional)
  8. Run node dist/containerRegistryClient.js

This results in an error like this:

> node dist/containerRegistryClient.js
Listing repositories
The sample encountered an error: TypeError: Cannot read properties of undefined (reading 'isAnonymousAccess')
    at Object.authorizeRequestOnChallenge (/home/madsht/repo/tmp/container-registry/samples/v1/typescript/node_modules/@azure/container-registry/dist/index.js:3622:29)
    at Object.sendRequest (/home/madsht/repo/tmp/container-registry/samples/v1/typescript/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js:153:57)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GeneratedClient.sendOperationRequest (/home/madsht/repo/tmp/container-registry/samples/v1/typescript/node_modules/@azure/core-client/dist/commonjs/serviceClient.js:110:33)

Expected behavior
That I can log in when providing a client.

Additional context
I have tested that I can reach the container registry, I have also tested that the credential could be used for other things, like listing all repos using the Az CLI.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Container Registry customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Nov 27, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @northtyphoon @toddysm.

@jeremymeng
Copy link
Member

Looks a duplicate of #31959. @MadsHT can you reinstall dependencies and try again? #31959 (comment)

@jeremymeng jeremymeng added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Nov 27, 2024
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 27, 2024
Copy link

Hi @MadsHT. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@MadsHT
Copy link
Author

MadsHT commented Nov 28, 2024

@jeremymeng That did the trick, thank you very much. 👍

@MadsHT MadsHT closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Container Registry customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants