Closed sgtwilko closed 3 weeks ago
Similar issue here:
0.244.3
0.238.3
##[debug]Evaluating condition for step: '{Redacted} - npm Authenticate'
##[debug]Evaluating: SucceededNode()
##[debug]Evaluating SucceededNode:
##[debug]=> True
##[debug]Result: True
Starting: {Redacted} - npm Authenticate
==============================================================================
Task : npm authenticate (for task runners)
Description : Don't use this task if you're also using the npm task. Provides npm credentials to an .npmrc file in your repository for the scope of the build. This enables npm task runners like gulp and Grunt to authenticate with private registries.
Version : 0.244.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/npm-authenticate
==============================================================================
##[debug]Using node path: /agent/externals/node20_1/bin/node
##[debug]agent.TempDirectory=/datadrive/agent/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_WORKINGFILE
##[debug]loading INPUT_WORKLOADIDENTITYSERVICECONNECTION
##[debug]loading INPUT_FEEDURL
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
##[debug]loaded 7
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]check path : {Redacted}/module.json
##[debug]adding resource file: {Redacted}/module.json
##[debug]system.culture=en-US
##[debug]check path : {Redacted}/task.json
##[debug]adding resource file: {Redacted}/task.json
##[debug]system.culture=en-US
##[debug]workingFile={Redacted}/.npmrc
##[debug]EXISTING_ENDPOINTS=undefined
Adding authentication to the .npmrc file at {Redacted}/.npmrc
##[debug]SAVE_NPMRC_PATH=undefined
##[debug]Agent.BuildDirectory={Redacted}/22
##[debug]testing directory '{Redacted}/22/npmAuthenticate'
##[debug]testing directory '{Redacted}/22'
##[debug]mkdir '{Redacted}/npmAuthenticate'
##[debug]check path : {Redacted}/task.json
##[debug]adding resource file: {Redacted}/task.json
##[debug]system.culture=en-US
##[debug]failOnStderr=false
##[debug]script=npm install {Redacted}
##[debug]workingDirectory={Redacted}
##[debug]check path : {Redacted}
Generating script.
##[debug]Agent.Version=3.243.0
##[debug]agent.tempDirectory=/datadrive/agent/_temp
##[debug]check path : /datadrive/agent/_temp
Script contents:
npm install {Redacted}
========================== Starting Command Output ===========================
##[debug]which 'bash'
##[debug]found: '/usr/bin/bash'
##[debug]which '/usr/bin/bash'
##[debug]found: '/usr/bin/bash'
##[debug]/usr/bin/bash arg: --noprofile
##[debug]/usr/bin/bash arg: --norc
##[debug]/usr/bin/bash arg: {Redacted}
##[debug]exec tool: /usr/bin/bash
##[debug]arguments:
##[debug] --noprofile
##[debug] --norc
##[debug] {Redacted}
/usr/bin/bash --noprofile --norc {Redacted}
npm ERR! code E401
npm ERR! Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/{Redacted}, Basic realm="https://pkgsproduks1.pkgs.visualstudio.com/", TFS-Federated
npm ERR! A complete log of this run can be found in:
npm ERR! /home/AzDevOps/.npm/_logs/{Redacted}-debug.log
##[debug]Exit code 1 received from tool '/usr/bin/bash'
##[debug]STDIO streams have closed for tool '/usr/bin/bash'
##[error]Bash exited with code '1'.
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId={Redacted};]Bash exited with code '1'.
##[debug]task result: Failed
##[debug]Processed: ##vso[task.complete result=Failed;done=true;]
Finishing: {Redacted} - installing {Redacted}
Same here. Also reverted to 0.238.3
.
@embetten I see you've been working on this task, would you be able to say if this issue will be looked at soon?
@sgtwilko The issue is being looked into, however I haven't been able to get a repro on my end (using the affected version). Can you provide some more information? I'm interested in:
@AlexVTor I am facing the same issue:
npm install
- npm authenticate
step happens before which does not fail - unable to get proceed to build
step.npmrc
service connection is being added and npm ci
is has the working file .npmrc
passed inIs there a a way to upload the log files hidden from public view? as these contain sensitive information - happy to email over if required.
@TRStarr Thanks for offering your help here. I don't think there's a way to upload files without them being available to others. I can think of two other approaches.
Thanks again for your assistance
@AlexVTor Thank you for the quick reply - please find .npmrc
and verbose logs files here
Hey @AlexVTor happy to confirm 0.246.3 is working all hunky dory! thank you very much for fixing this!!
Thanks for the feedback! I've heard the same feedback on other fronts as well, so I will close this issue. If there are any more issues, please re-open or post here.
New issue checklist
Task name
npmAuthenticate
Breaking task version
0.244.1
Last working task version
0.238.3
Regression Description
Although the task appears to work, when using
npm ci
packages being installed from our org scoped feed fail to install due to 401 authentication failures.When reverting to version 0.238.3 of the
npmAuthenticate
task the subsequentnpm ci
task completes successfully.Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
windows-2019
Relevant log output
Full task logs with system.debug enabled
See above:
UNSUCCESSFUL RUN
SUCCESSFUL RUN
Repro steps