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

[Bug] Invalid authentication (as an unknown user) #1874

Closed
Kizmar opened this issue Sep 24, 2020 · 2 comments
Closed

[Bug] Invalid authentication (as an unknown user) #1874

Kizmar opened this issue Sep 24, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Kizmar
Copy link

Kizmar commented Sep 24, 2020

Describe the bug

I'm working on an npm package project that I'm publishing to an ADO Artifact feed. I had my .yarnrc.yml working based on issue #316. I've been able to yarn npm publish with success for a couple days.

Yesterday I published a few times, then a few minutes later I tried to publish again and started getting the "Invalid authentication (as an unknown user)" error while running the yarn npm publish command. I did not make a change to the .yarnrc.yml file since I got it working. I've tried refreshing the PAT in ADO and recreating the base64 string <org_name>:<PAT>, but it didn't fix the issue.

I'm not sure how to troubleshoot this. I also tried using my actual user name in the npmAuthIdent base64 string (<user_name>:<PAT>), which didn't work either. I don't know if something was cached and expired causing this - or what that could even be? I'm able to log in and view the ADO feed just fine.

To Reproduce

The .yarnrc.yml file looks like this:

enableTelemetry: false
nodeLinker: node-modules
npmPublishRegistry: "https://pkgs.dev.azure.com/<org_name>/_packaging/<feed_name>/npm/registry/"
npmRegistryServer: "https://pkgs.dev.azure.com/<org_name>/_packaging/<feed_name>/npm/registry/"
npmPublishAccess: restricted
npmAlwaysAuth: true
npmAuthIdent: base64(<org_name>:<PAT>)

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-version.cjs
    spec: "@yarnpkg/plugin-version"
  - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
    spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-2.2.2.cjs

Environment:

  • OS: Windows 10 (current build)
  • Node version 12.18.4
  • Yarn version 2.2.2
@Kizmar Kizmar added the bug Something isn't working label Sep 24, 2020
@merceyz
Copy link
Member

merceyz commented Sep 24, 2020

Quoting myself from #1831 (comment)


@paul-soporan recently fixed the error message for that (#1809) to include more details, could you try using the version from master (yarn set version from sources) and then publish again?

Closing as most likely a duplicate of #1641

@merceyz merceyz closed this as completed Sep 24, 2020
@Kizmar
Copy link
Author

Kizmar commented Sep 24, 2020

Yep. The issue was that I forgot to run yarn version patch on the last publish attempts. I ran yarn set version from sources and got "Forbidden" instead of the "Invalid authentication" error. After patching the version it worked again. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants