Azure-devops-cli-extension: [Bug] PipelineArtifactDownloadException for Container

Created on 1 May 2019  路  7Comments  路  Source: Azure/azure-devops-cli-extension

Describe the bug
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'mymsi' was found, but is of type 'Container'.

To Reproduce
Azure Cli Version: 2.0.63
Azure-Devops extension version: 0.6.0

Steps to reproduce the behavior:

  1. login using az devops login
  2. Run the following command: az pipelines runs artifact download --artifact-name mymsi --path C:\msidownloads --run-id 123456 --org https://dev.azure.com/contoso -p SomeTeam

Expected behavior
The file(s)/folder(s) in the container are downloaded into the C:\msidownloads folder

Stack trace
at ArtifactTool.Commands.PipelineArtifactDownloadCommand.ExecuteAsync() in D:\a\1\s\src\ArtifactTool\Commands\PipelineArtifacts\PipelineArtifactDownloadCommand.cs:line 41
at ArtifactTool.Commands.CommandBase.OnExecuteAsync() in D:\a\1\s\src\ArtifactTool\Commands\CommandBase.cs:line 113
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.<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.b__0() in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 505
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 31
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'mymsi' was found, but is of type 'Container'.
at ArtifactTool.Commands.PipelineArtifactDownloadCommand.ExecuteAsync() in D:\a\1\s\src\ArtifactTool\Commands\PipelineArtifacts\PipelineArtifactDownloadCommand.cs:line 41
at ArtifactTool.Commands.CommandBase.OnExecuteAsync() in D:\a\1\s\src\ArtifactTool\Commands\CommandBase.cs:line 113
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.<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.b__0() in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 505
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 31
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130

Additional context
In AzureDevOps, there's no alternative type of "artifact". I've tried 2 different publish artifact tasks, and the artifacts are always a 'Container'. So, if there's a way artifacts need to be published to allow this command to work, then it should be included in the Docs. If it's an issue with the command usage, I'd suggest a sample/example be added to the docs and/or to the command-line help output.

bug Packages

Most helpful comment

I think I'm observing the same issue which has been reported originally by @tekgiant with the latest version of cli.

Error:
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'drop' was found, but is of type 'Container'.

Versions:
"azure-cli": "2.10.1",
"azure-cli-command-modules-nspkg": "2.0.3",
"azure-cli-core": "2.10.1",
"azure-cli-nspkg": "3.0.4",
"azure-cli-telemetry": "1.0.4",
"extensions": {
"azure-devops": "0.18.0"
}

To Reproduce:

1: login using az devops login with pat token
2: az pipelines runs artifact download --artifact-name=drop --path=. --run-id=48 --project=projectname

Stack trace:
az pipelines runs artifact download --artifact-name=drop --path=. --run-id=48 --project=projectname
Command group 'pipelines runs artifact' is in preview. It may be changed/removed in a future release.
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'drop' was found, but is of type 'Container'.
at ArtifactTool.Commands.PipelineArtifactDownloadCommand.ExecuteAsync() in d:\a\1\s\src\ArtifactTool\Commands\PipelineArtifacts\PipelineArtifactDownloadCommand.cs:line 44
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.<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.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.ExecuteTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 57
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 112

All 7 comments

Sorry for the miss here. Re-assigning to those on the appropriate team.

@owenhuynMSFT @fadnavistanmay who should this be assigned to on your team?

@tekgiant Have you tried using publish pipeline artifact task to publish an artifact? The artifact generated by this task should be a pipeline artifact rather than a "container".

In addition, we are adding capability into ArtifactTool so that it can download both pipeline artifact and container artifact. The code should be deployed in one to two weeks. For now to unblock, you can try using publish pipeline artifact task. CC @fadnavistanmay

Just to clarify @jahsu-MSFT's comments but "container" refers to build artifacts:
https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/build-artifacts?view=azure-devops&tabs=yaml

When using Azure CLI, I believe the command you are using is trying to download a "Build artifact" rather than a "Pipeline artifact". Azure CLI currently doesn't have this functionality to download "Build artifacts" but we intend to release this functionality in the future. If you are trying to download artifacts from older builds, it is currently a blocker and we will be fixing and releasing them. However if you can switch your builds over to Pipeline Artifacts rather than Build Artifacts, Azure CLI has the capability to download those instead.

I know there was an original delay here, and we apologize for that. I'm going to go ahead and close since we haven't seen a response since a couple of ours. Feel free to comment if you disagree!

I think I'm observing the same issue which has been reported originally by @tekgiant with the latest version of cli.

Error:
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'drop' was found, but is of type 'Container'.

Versions:
"azure-cli": "2.10.1",
"azure-cli-command-modules-nspkg": "2.0.3",
"azure-cli-core": "2.10.1",
"azure-cli-nspkg": "3.0.4",
"azure-cli-telemetry": "1.0.4",
"extensions": {
"azure-devops": "0.18.0"
}

To Reproduce:

1: login using az devops login with pat token
2: az pipelines runs artifact download --artifact-name=drop --path=. --run-id=48 --project=projectname

Stack trace:
az pipelines runs artifact download --artifact-name=drop --path=. --run-id=48 --project=projectname
Command group 'pipelines runs artifact' is in preview. It may be changed/removed in a future release.
Encountered an unexpected error.
ArtifactTool.Commands.PipelineArtifacts.PipelineArtifactDownloadException: Artifact with name 'drop' was found, but is of type 'Container'.
at ArtifactTool.Commands.PipelineArtifactDownloadCommand.ExecuteAsync() in d:\a\1\s\src\ArtifactTool\Commands\PipelineArtifacts\PipelineArtifactDownloadCommand.cs:line 44
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.<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.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.ExecuteTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 57
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsyncTApp in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 112

Ran up against this problem because the artifact I was trying to download was created using the ##vso[artifact.upload] logging command, which apparently creates a legacy "build" artifact instead of a pipeline artifact...

https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#upload-upload-an-artifact

@elbatk sounds like support for build artifacts was imminent. Did this ever land? If so can you share a pointer to the docs?

Was this page helpful?
0 / 5 - 0 ratings