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

Add an Azure NPM registry #71393

Merged
merged 3 commits into from
Jul 9, 2022
Merged

Add an Azure NPM registry #71393

merged 3 commits into from
Jul 9, 2022

Conversation

agocke
Copy link
Member

@agocke agocke commented Jun 28, 2022

No description provided.

@agocke agocke requested a review from marek-safar as a code owner June 28, 2022 17:08
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost assigned agocke Jun 28, 2022
@agocke
Copy link
Member Author

agocke commented Jun 28, 2022

/azp run runtime-extra-platforms,runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@agocke
Copy link
Member Author

agocke commented Jun 28, 2022

Looks like the npm stuff is failing auth. @adiaaida Did you run into this by any chance? Any suggestions?

@mmitche
Copy link
Member

mmitche commented Jun 28, 2022

@agocke You'll need to npm install these locally on your machine to ingest the required packages.

@agocke
Copy link
Member Author

agocke commented Jun 28, 2022

@mmitche The CI is failing with

npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR! npm login

Is that the same problem or different?

@mmitche
Copy link
Member

mmitche commented Jun 28, 2022

@mmitche The CI is failing with

npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR! npm login

Is that the same problem or different?

@adiaaida has more experience with this, but I think it's the same. The package feed is anonymously accessible, but the packages required may not be available, requiring authentication to ingest.

@ghost
Copy link

ghost commented Jun 28, 2022

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: agocke
Assignees: agocke
Labels:

area-Infrastructure

Milestone: -

@michellemcdaniel
Copy link
Contributor

michellemcdaniel commented Jun 28, 2022

Did you run

vsts-npm-auth -config .npmrc

First? You may also have to go through these instructions first:

To use npm packages, get npm (which comes with Node.js) and the vsts-npm-auth helper.
Step 1
[Download Node.js and npm](https://go.microsoft.com/fwlink/?linkid=2103882)

Step 2
Run this command

npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false

(locally)

@agocke
Copy link
Member Author

agocke commented Jun 29, 2022

/azp run dotnet-linker-tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@agocke
Copy link
Member Author

agocke commented Jun 29, 2022

I've tried running vsts-npm-auth -config .npmrc and it seemed to work but after re-running the tests they fail in the same way.

@mmitche
Copy link
Member

mmitche commented Jun 29, 2022

I've tried running vsts-npm-auth -config .npmrc and it seemed to work but after re-running the tests they fail in the same way.

Please ensure your npm cache is cleaned locally so that the ingestion happens (rather than picking up packages locally)

@michellemcdaniel
Copy link
Contributor

Run to make sure you're getting everything ingested.

npm cache clean –force
git clean -fxd

@agocke
Copy link
Member Author

agocke commented Jun 29, 2022

OK, figured it out, I was running this in Linux and that apparently doesn't work.

@michellemcdaniel
Copy link
Contributor

Oh yeah, there are different instructions for Linux. If you go to https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm/connect/npm and click the "Other" tab in project setup, it will tell you how to auth on Linux/Mac

@agocke
Copy link
Member Author

agocke commented Jun 29, 2022

Well, looks like it works locally, but still hasn't fixed CI.

@michellemcdaniel
Copy link
Contributor

I would reach out to the folks who work on wasm to see if maybe something about the .npmrc file and how they run npm ci/install are interacting poorly.

@michellemcdaniel
Copy link
Contributor

Oh, the log says npm audit isn't supported and they're using npm audit:

npm ERR! audit Your configured registry (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/) does not support audit requests.

@agocke
Copy link
Member Author

agocke commented Jun 29, 2022

@steveisok Any idea who could look at this npm audit issue?

@steveisok
Copy link
Member

@steveisok Any idea who could look at this npm audit issue?

@lewing @radical

@agocke
Copy link
Member Author

agocke commented Jul 5, 2022

ping @lewing @radical

@agocke agocke requested a review from lewing as a code owner July 5, 2022 23:24
@radical
Copy link
Member

radical commented Jul 6, 2022

 npm info it worked if it ends with ok
  npm verb cli [
  npm verb cli   '/usr/local/emscripten/emsdk/node/14.18.2_64bit/bin/node',
  npm verb cli   '/usr/local/emscripten/emsdk/node/14.18.2_64bit/bin/npm',
  npm verb cli   'audit',
  npm verb cli   '--verbose'
  npm verb cli ]
  npm info using npm@6.14.15
  npm info using node@v14.18.2
  npm verb npm-session b8f1af247e4fb9ba
  npm http fetch POST 404 https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/-/npm/v1/security/audits 158ms
  npm verb stack Error: Your configured registry (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/) does not support audit requests.
  npm verb stack     at /usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/lib/audit.js:204:18
  npm verb stack     at tryCatcher (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
  npm verb stack     at Promise._settlePromiseFromHandler (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
  npm verb stack     at Promise._settlePromise (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
  npm verb stack     at Promise._settlePromise0 (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
  npm verb stack     at Promise._settlePromises (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:695:18)
  npm verb stack     at _drainQueueStep (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
  npm verb stack     at _drainQueue (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
  npm verb stack     at Async._drainQueues (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
  npm verb stack     at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/emscripten/emsdk/node/14.18.2_64bit/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
  npm verb stack     at processImmediate (internal/timers.js:464:21)
  npm verb cwd /__w/1/s/src/mono/wasm/runtime
  npm verb Linux 5.4.0-1080-azure
  npm verb argv "/usr/local/emscripten/emsdk/node/14.18.2_64bit/bin/node" "/usr/local/emscripten/emsdk/node/14.18.2_64bit/bin/npm" "audit" "--verbose"
  npm verb node v14.18.2
  npm verb npm  v6.14.15
  npm ERR! code ENOAUDIT
  npm ERR! audit Your configured registry (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/) does not support audit requests.
  npm verb exit [ 1, true ]

@lewing @pavelsavara @maraf Any idea what could be done here? Since the exception also shows the same error npm verb stack Error: Your configured registry (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/) does not support audit requests., does it mean that the registry really doesn't support audit?

@agocke agocke assigned lewing and unassigned agocke Jul 6, 2022
@maraf
Copy link
Member

maraf commented Jul 7, 2022

does it mean that the registry really doesn't support audit?

It probably doesn't https://docs.microsoft.com/en-us/azure/devops/artifacts/npm/npm-audit?view=azure-devops&tabs=yaml

Azure DevOps does not support npm audit, if you try to run the default npm audit command from your pipeline, the task will fail with the following message: Unexpected end of JSON input while parsing....
As a workaround, you can run npm audit with the registry argument --registry=https://registry.npmjs.org/. This will route the npm audit command directly to the public registry.

@lewing lewing merged commit e50a6c2 into dotnet:main Jul 9, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants