microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

npmAuthenticate@0 stopped working with new version #17585

Closed albert17 closed 1 year ago

albert17 commented 1 year ago

Required Information

Question, Bug, or Feature?
Type: Bug

Enter Task Name: npmAuthenticate@0

Environment

Issue Description

npmAuthenticate@0 stopped working with latest version.

Task was working fine with 0.208.1

image

Task started using 0.214.2 and now fail.

image

Error logs

Starting: Authenticate NPM
==============================================================================
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.214.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/npm-authenticate
==============================================================================
Adding authentication to the .npmrc file at D:\a\1\s\private\HitApps\WebMCVNext\app\.npmrc
##[warning]Resource file haven't been set, can't find loc string for key: SavingFile
##[error]TypeError: Cannot read properties of undefined (reading 'retrieveSecret')
Finishing: Authenticate NPM
Roman-Shchukin commented 1 year ago

Hi @albert17 we've rolled out the fix for this issue. As a temporary solution you could specify a previous version of the task (0.208.1) in the pipeline https://learn.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml#task-versions

noahhai commented 1 year ago

@Roman-Shchukin getting validation error trying to specify like this. Is there another way? image

albert17 commented 1 year ago

- task: npmAuthenticate@0.208.1 works for me.

@noahhai workingFIle needs to point to the specific .npmrc file not to a folder.

noahhai commented 1 year ago

@albert17 thank you. yeah, I truncated the screenshot

weldpua2008 commented 1 year ago

Hi @albert17 we've rolled out the fix for this issue. As a temporary solution you could specify a previous version of the task (0.208.1) in the pipeline https://learn.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml#task-versions

I still getting the error. Is the fix live?

Roman-Shchukin commented 1 year ago

Hi @weldpua2008, could you please check it now?

ben-nichols14 commented 1 year ago

@Roman-Shchukin We are getting this problem using the traditional release pipelines (ie. not YAML). It is still pulling through version 0.214.2 - is this supposed to be pushed out yet? is there a way we can force a different minor version?

Roman-Shchukin commented 1 year ago

@ben-nichols14 are you using self-hosted agent?

ben-nichols14 commented 1 year ago

We have tried on both self hosted and microsoft hosted agent and getting the same result

tried with: windows-latest ubuntu-latest self hosted (ubuntu)

viktoriia-nintex commented 1 year ago

I am seeing the same with a classic Release pipeline: can't specify the older version, and the one being pulled in is still 0.214.2. When is the fix going live?

Roman-Shchukin commented 1 year ago

@ben-nichols14 @viktoriia-nintex could you please tell me your org name in ADO?

viktoriia-nintex commented 1 year ago

@Roman-Shchukin it's "Nintex" for me.

rloomans commented 1 year ago

@ben-nichols14 @viktoriia-nintex could you please tell me your org name in ADO?

@Roman-Shchukin: For @ben-nichols14 (and me), it's shellenergy-au

adamth commented 1 year ago

We have started having pipelines fail with version 0.214.2 which were previously working with 0.208.1. We are also using the classic pipeline so pinning to an old version doesn't appear to be an option for us. Is there anything we can do?

Task output:

2023-01-16T05:43:12.4796226Z ##[section]Starting: npm Authenticate
2023-01-16T05:43:12.4803057Z ==============================================================================
2023-01-16T05:43:12.4803315Z Task         : npm authenticate (for task runners)
2023-01-16T05:43:12.4803502Z 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.
2023-01-16T05:43:12.4804035Z Version      : 0.214.2
2023-01-16T05:43:12.4804180Z Author       : Microsoft Corporation
2023-01-16T05:43:12.4804359Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/npm-authenticate
2023-01-16T05:43:12.4804610Z ==============================================================================
2023-01-16T05:43:12.7092972Z Adding authentication to the .npmrc file at /home/vsts/work/r1/a/_JBHi-Fi_shopify-theme/.npmrc
2023-01-16T05:43:12.7278225Z ##[warning]Resource file haven't been set, can't find loc string for key: SavingFile
2023-01-16T05:43:12.7291245Z ##[warning]Resource file haven't been set, can't find loc string for key: ServiceEndpointNotDefined
2023-01-16T05:43:12.7299174Z ##[error]Error: ServiceEndpointNotDefined
2023-01-16T05:43:12.7391356Z ##[section]Finishing: npm Authenticate

FWIW our org name is jbhi-fi

Roman-Shchukin commented 1 year ago

@viktoriia-nintex @adamth @rloomans @ben-nichols14 try now please, everything should work

viktoriia-nintex commented 1 year ago

Thank you @Roman-Shchukin it works for us now. :-) Logs show version 0.208.1 being used again, though - I thought it would be 0.214.3 or something. Not complaining, just letting you know.

adamth commented 1 year ago

Working for us now as well, thanks @Roman-Shchukin

rloomans commented 1 year ago

Working for us too. Thanks @Roman-Shchukin

Roman-Shchukin commented 1 year ago

Great! Closing this one, feel free to ask any other questions or let us know if it's still relevant for you.

jakubtrhon commented 1 year ago

We have the same problem in Release pipeline, is it possible to downgrade npmAuthenticate@0 task in our ADO storeit? image

@Roman-Shchukin

Roman-Shchukin commented 1 year ago

Hi @jakubtrhon, it's not related with a specific ADO org, but knowing a org helps to find reason. Could you check now?

jakubtrhon commented 1 year ago

We are using deployment targets with our machines in our release pipeline and still we are using 0.214.2 version. 2023-01-23T07:04:19.7308469Z Version : 0.214.2 - from today log

Now we are using workaround with symlink of task 0.214.2 folder to 0.208.1 task folder in that machines which works.

Roman-Shchukin commented 1 year ago

Hi @jakubtrhon could you please check has it changed or not?

jakubtrhon commented 1 year ago

Today we deployed and NPM auth is now in version 0.216.1 which works. 2023-01-27T13:30:26.1167521Z Version : 0.216.1

Thank you!

Roman-Shchukin commented 1 year ago

Great! Closing this issue, feel free to ask any other questions.