Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
622 stars 241 forks source link

[Bug] az artifacts universal download fails #833

Open geverghe opened 4 years ago

geverghe commented 4 years ago

Referencing issue from Azure CLI extension repo https://github.com/Azure/azure-cli-extensions/issues/554

elbatk commented 4 years ago

@fadnavistanmay and @owenhuynMSFT, did you guys look at the bug mentioned above?

thommiano commented 4 years ago

Any updates on this?

samuelkoppes commented 4 years ago

Closing due to inactivity, please reopen if the issue is still occurring.

virzak commented 4 years ago

This issue is definitely still occurring

virzak@vBurst:~/NoviView$ az pipelines runs artifact download --run-id 462 --project NoviView --artifact-name drop --path .
Command group 'pipelines runs artifact' is in preview. It may be changed/removed in a future release.
Encountered an unexpected error.
Microsoft.VisualStudio.Services.Common.VssServiceException: TF400813: The user 'dcfb92a4-cf42-4de3-b9dd-42b733a4edf1\v...@....com' is not authorized to access this resource.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.TeamFoundation.Build.WebApi.BuildHttpClientCompatBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken, Func`3 processResponse)
   at Microsoft.TeamFoundation.Build.WebApi.BuildHttpClientCompatBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken, Func`3 processResponse)
   at ArtifactTool.Commands.PipelineArtifactDownloadCommand.ExecuteAsync() in d:\a\1\s\src\ArtifactTool\Commands\PipelineArtifacts\PipelineArtifactDownloadCommand.cs:line 36
   at ArtifactTool.Commands.CommandBase.OnExecuteAsync() in d:\a\1\s\src\ArtifactTool\Commands\CommandBase.cs:line 105
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 77
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 62
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 25
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass126_0.<OnExecute>b__0() in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 505
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 611
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 57
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](IConsole console, String[] args) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](String[] args) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 112
rubberduck203 commented 4 years ago

@samuelkoppes this is definitely still an issue. Please reopen.

edgarrs commented 4 years ago

This looks like a Build Artifact issue

qcc-na commented 3 years ago

Info:

azure-cli                         2.13.0

core                              2.13.0
telemetry                          1.0.6

Extensions:
azure-devops                      0.18.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\REMOVED\.azure\cliextensions'

Python (Windows) 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy

I ran the following command after running az devops login with a newly created full access token.

az artifacts universal download --organization "https://dev.azure.com/REMOVED/" --feed "REMOVED" --name "REMOVED" --version "REMOVED" --path . --verbose


Creating connection with personal access token.
Failed to update Universal Packages tooling.
 Access Denied: The Personal Access Token used has expired.
Command ran in 1.250 seconds (init: 0.135, invoke: 1.115)
Suppress exception:
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-w2r544p3\azure\cli\__main__.py", line 60, in <module>
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-w2r544p3\azure\cli\__main__.py", line 53, in <module>
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\_profile.py", line 494, in get_current_account_user
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\_profile.py", line 503, in get_subscription
knack.util.CLIError: Please run 'az login' to setup account.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\decorators.py", line 74, in _wrapped_func
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\decorators.py", line 57, in _decorator
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\telemetry.py", line 502, in _get_user_azure_id
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\_profile.py", line 496, in get_current_account_user
knack.util.CLIError: There are no active accounts.

Suppress exception:
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-w2r544p3\azure\cli\__main__.py", line 60, in <module>
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-w2r544p3\azure\cli\__main__.py", line 53, in <module>
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\decorators.py", line 74, in _wrapped_func
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\telemetry.py", line 512, in _get_azure_subscription_id
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\_profile.py", line 520, in get_subscription_id
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-c8n8j8wo\azure\cli\core\_profile.py", line 503, in get_subscription
knack.util.CLIError: Please run 'az login' to setup account.

If i run az login and then the original download command again, I get:

An error occurred on the service. TF400813: The user 'GUID REMOVED\USERNAME REMOVED' is not authorized to access this resource.
Command ran in 2.721 seconds (init: 0.133, invoke: 2.588)
borisgr04 commented 3 years ago

az artifacts universal publish --organization https://sisgesimp.visualstudio.com/ --feed TestArtifact --name my-first-package --version 0.0.1 --description "Welcome to Universal Packages" --path Packages.zip Encountered an unexpected error. Microsoft.VisualStudio.Services.Common.VssServiceException: TF400813: The user 'cda0c715-2775-4b88-b3f6-287570a2a038\sisgesimp_tfs@outlook.es' is not authorized to access this resource. at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)