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

Generate Release Notes (Crossplatform) 3.40.10 authentication error #928

Closed
vzalamea opened this issue Jan 8, 2021 · 12 comments · Fixed by #929
Closed

Generate Release Notes (Crossplatform) 3.40.10 authentication error #928

vzalamea opened this issue Jan 8, 2021 · 12 comments · Fixed by #929

Comments

@vzalamea
Copy link

vzalamea commented Jan 8, 2021

Describe the bug
starting with version 3.40.10
we are getting the following error:

2021-01-07T23:09:39.6884961Z { Error: TF400813: The user '' is not authorized to access this resource.
2021-01-07T23:09:39.6886159Z     at RestClient.<anonymous> (F:\vstsagent\CVBUILDBuildAgent1\_work\_tasks\XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb\3.40.10\node_modules\azure-devops-node-api\node_modules\typed-rest-client\RestClient.js:202:31)
2021-01-07T23:09:39.6887029Z     at Generator.next (<anonymous>)
2021-01-07T23:09:39.6887874Z     at fulfilled (F:\vstsagent\CVBUILDBuildAgent1\_work\_tasks\XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb\3.40.10\node_modules\azure-devops-node-api\node_modules\typed-rest-client\RestClient.js:6:58)
2021-01-07T23:09:39.6888818Z     at process._tickCallback (internal/process/next_tick.js:68:7)
2021-01-07T23:09:39.6889272Z   statusCode: 401,
2021-01-07T23:09:39.6889570Z   result:
2021-01-07T23:09:39.6889800Z    { '$id': '1',
2021-01-07T23:09:39.6890074Z      innerException: null,
2021-01-07T23:09:39.6890353Z      message:
2021-01-07T23:09:39.6890700Z       'TF400813: The user \'\' is not authorized to access this resource.',
2021-01-07T23:09:39.6891047Z      typeName:
2021-01-07T23:09:39.6891736Z       'Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server',
2021-01-07T23:09:39.6892425Z      typeKey: 'UnauthorizedRequestException',
2021-01-07T23:09:39.6892777Z      errorCode: 0,
2021-01-07T23:09:39.6893070Z      eventId: 3000 } }

This was working fine in 3.39.2

commit:
765e620

Did something change between
"azure-devops-node-api": "^8.1.1"

and "azure-devops-node-api": "^10.2.0"?

@vzalamea vzalamea added the bug label Jan 8, 2021
@jabimi
Copy link

jabimi commented Jan 8, 2021

We are also facing the same authentication error with the same error in all our pipelines. @rfennell Do advice

@rfennell
Copy link
Owner

rfennell commented Jan 8, 2021

That is strange. The updated task passed all my release test without any issues I they are meant to cover most scenarios.

Can you provide me with a detail log (set the pipeline run with diagnostics check box or set a variable system.debug=true) so I can see where the failure is actually happening.

Also what platform are you running on is it Azure DevOps Services or Server? And if the server what version?

@jabimi
Copy link

jabimi commented Jan 8, 2021

Sure .Hope the below screenshots be of help to you

image
image

@rfennell
Copy link
Owner

rfennell commented Jan 8, 2021

It look like the call that get the Agent access token (that is used for all the API call is failing). The only different I can see from my logs are your Azure DevOps instance is using the older URL format xxx.visualstudio.com as opposed to dev.azure.com/xxx, but I can't see why that should cause an issue.

As a short term work around you could pass in a PAT to use to talk to the API. This is done using the overridePat parameter on the task.

I will do some digging to see if I can work out a proper fix

@jabimi
Copy link

jabimi commented Jan 8, 2021

Also We are using Server with Win 16 Std

@rfennell
Copy link
Owner

rfennell commented Jan 8, 2021

@jabimi so you have an on premise Azure DevOps server then?

Is so what version Azure DevOps server ?

I am a bit confused as the log you upload mentions the Azure DevOps Services URL

An on premise instance could explain the problem as it won't support the same version of the API as the cloud service

@richardfric
Copy link

richardfric commented Jan 8, 2021

I've experienced the same problem today. It was working before the update to 3.40.10

2021-01-08T09:27:24.1213952Z ##[section]Starting: Generate Release Notes
2021-01-08T09:27:24.1225369Z ==============================================================================
2021-01-08T09:27:24.1225767Z Task : Generate Release Notes (Crossplatform)
2021-01-08T09:27:24.1226658Z Description : Generates a release notes file in a format of your choice from the build or release history
2021-01-08T09:27:24.1227578Z Version : 3.40.10
2021-01-08T09:27:24.1227817Z Author : Black Marble
2021-01-08T09:27:24.1228277Z Help : Version: 3.40.10. More Information
2021-01-08T09:27:24.1228814Z ==============================================================================
2021-01-08T09:27:24.4305130Z Creating Azure DevOps API connections for https://dev.azure.com/xxx/ with 'allowRetries' set to 'true' and 'maxRetries' count to '20'
2021-01-08T09:27:24.4311385Z Creating the credential handler from the OAUTH token
2021-01-08T09:27:24.8177724Z Getting the current release details
2021-01-08T09:27:24.8879793Z The most common reason for the task to fail is due API ECONNRESET issues. To avoid this failing the pipeline these will be treated as warnings and an attempt to generate any release notes possible
2021-01-08T09:27:24.8902953Z { Error: TF400813: The user '' is not authorized to access this resource.
2021-01-08T09:27:24.8903371Z Total Builds: [0]
2021-01-08T09:27:24.8904332Z at RestClient. (/home/vsts/work/_tasks/XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb/3.40.10/node_modules/azure-devops-node-api/node_modules/typed-rest-client/RestClient.js:202:31)
2021-01-08T09:27:24.8905282Z at Generator.next ()
2021-01-08T09:27:24.8906202Z at fulfilled (/home/vsts/work/_tasks/XplatGenerateReleaseNotes_7b0a5887-75c4-4ade-a915-f92a93c934cb/3.40.10/node_modules/azure-devops-node-api/node_modules/typed-rest-client/RestClient.js:6:58)
2021-01-08T09:27:24.8906771Z at process._tickCallback (internal/process/next_tick.js:68:7)
2021-01-08T09:27:24.8907089Z statusCode: 401,
2021-01-08T09:27:24.8907531Z result:
2021-01-08T09:27:24.8907915Z { '$id': '1',
2021-01-08T09:27:24.8908140Z innerException: null,
2021-01-08T09:27:24.8908336Z message:
2021-01-08T09:27:24.8908809Z 'TF400813: The user '' is not authorized to access this resource.',
2021-01-08T09:27:24.8909104Z typeName:
2021-01-08T09:27:24.8909671Z 'Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server',
2021-01-08T09:27:24.8910251Z typeKey: 'UnauthorizedRequestException',
2021-01-08T09:27:24.8910485Z errorCode: 0,
2021-01-08T09:27:24.8910680Z eventId: 3000 } }
2021-01-08T09:27:24.8910891Z Total Commits: [0]
2021-01-08T09:27:24.8911084Z Total Workitems: [0]
2021-01-08T09:27:24.8912983Z Total Related Workitems (Parent/Children): [0]
2021-01-08T09:27:24.8915712Z Total Release Tests: [0]
2021-01-08T09:27:24.8919033Z Total Tests: [0]
2021-01-08T09:27:24.8919306Z Total Pull Requests: [0]
2021-01-08T09:27:24.8919568Z Total Indirect Pull Requests: [0]

relnotes

@rfennell
Copy link
Owner

rfennell commented Jan 8, 2021

I think the issue could be related to this this ]Azure-DevOps-Node-API #419 issue](microsoft/azure-devops-node-api#419).

If that is the case the fix should be to set allowCrossOriginAuthentication = true when I construct the token handlers. It would explain why some people have issues and other do not.

I will get a new build done with that option.

@markbangert
Copy link

markbangert commented Jan 8, 2021

We have the same issue. Could solve this for now by downgrading to task version 2.

@rfennell
Copy link
Owner

rfennell commented Jan 8, 2021

I have just shipped 3.41.3 this has the new allowCrossOriginAuthentication = true set while was not available in the "azure-devops-node-api": "^8.1.1" but is in 10.2.0

As before this update has passed all my release test, but does it address the problem you have all been seeing?

@vzalamea
Copy link
Author

vzalamea commented Jan 8, 2021

@rfennell My task succeeded with version 3.41.3. Thank you so much!!!

@github-actions
Copy link

github-actions bot commented Feb 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants