azure-pipelines-agent: config.sh remove fails with PAT and HTTP 401

Agent Version and Platform

Version of your agent? vsts-agent-linux-x64-2.182.1

Azure DevOps Type and Version

on-premises Version Dev17.M153.5

What’s not working?

config.sh remove does fails due to authorization though the same PAT was successfully used to register the agent!? For PAT I followed this: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#authenticate-with-a-personal-access-token-pat

devops@insvkn69:~/vsts-agent-linux-x64-2.182.1> ./config.sh remove
Removing agent from the server
Enter authentication type (press enter for PAT) >
Enter personal access token > ****************************************************
Error reported in diagnostic logs. Please examine the log for more details.
    - /home/devops/vsts-agent-linux-x64-2.182.1/_diag/Agent_20210305-183701-utc.log
Failed: Removing agent from the server
VS30063: You are not authorized to access https://devops.XXX.

Agent and Worker’s Diagnostic Logs

[2021-03-05 18:37:21Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2021-03-05 18:37:22Z WARN VisualStudioServices] Authentication failed with status code 401.
X-TFS-ProcessId: b56ad9a2-1807-4964-bc8e-a80e9e689934^M
Strict-Transport-Security: max-age=31536000; includeSubDomains^M
ActivityId: af881175-22a8-4b3f-addf-5c5954f6d73a^M
X-TFS-Session: 7d852f62-2dc4-4bcc-a655-85cc36e3554e^M
X-VSS-E2EID: 0a21669f-195f-46d2-8fa9-537fe237e63a^M
WWW-Authenticate: Basic realm="https://devops.in-gmbh.de/", Negotiate, NTLM^M
X-Powered-By: ASP.NET^M
P3P: CP="CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT"^M
Lfs-Authenticate: NTLM^M
X-Content-Type-Options: nosniff^M
Date: Fri, 05 Mar 2021 18:37:29 GMT^M

[2021-03-05 18:37:22Z WARN VisualStudioServices] Basic issued token provider instance 40805010 requires an interactive prompt which is not allowed by the current settings
[2021-03-05 18:37:22Z ERR  VisualStudioServices] GET request to https://devops.XXX/_apis/connectionData?connectOptions=1&lastChangeId=22&lastChangeId64=22 is not authorized. Details: VS30063: You are not authorized to access https://devops.XXX.
[2021-03-05 18:37:22Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2021-03-05 18:37:22Z INFO LocationServer] Unable to connect to https://devops.XXX/.
[2021-03-05 18:37:22Z ERR  LocationServer] Microsoft.VisualStudio.Services.Common.VssUnauthorizedException: VS30063: You are not authorized to access https://devops.XXX.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

I had the same issue but I change PAT “Organization” to “All accessible organizations” and it’s work.