Neetu Pal
Neetu Pal

Reputation: 11

Pipeline Extraction Step Fails: Archive File Not Found

Issue Summary

The archive file is not found during the extraction step in the pipeline, causing the task to fail.

Steps to Reproduce Run the pipeline with the ExtractFiles task configured to extract a previously archived file. The task attempts to locate and extract the file from the expected directory. The extraction step fails due to a missing or inaccessible archive file. Expected Results

The extraction step should successfully locate the archive file and extract its contents.

Actual Results The pipeline fails at the extraction step. The archive file is not found at the expected location. Error Details

Relative file path: $(Build.BuildDefinition)/80-build/80.zip resolving to: /home/vsts/work/r1/a/$(Build.BuildDefinition)/80-build/80.zip

Error Message:

Error: Specified archive: /home/vsts/work/r1/a/$(Build.BuildDefinition)/80-build/80.zip cannot be extracted because it cannot be accessed. Error: ENOENT: no such file or directory, stat '/home/vsts/work/r1/a/$(Build.BuildDefinition)/80-build/80.zip'

Upvotes: 0

Views: 25

Answers (1)

Alvin Zhao - MSFT
Alvin Zhao - MSFT

Reputation: 6037

You didn't shared how your release pipeline was defined. From the current description, it appeared that your Extract files task failed to search for the .zip file, because it was configured to search under the path /home/vsts/work/r1/a/$(Build.BuildDefinition)/80-build/80.zip contains an invalid variable $(Build.BuildDefinition).

We could see the variable $(Build.BuildDefinition) was not expanded during the release and please note that it is not among the predefined variables in Classic release pipelines.

If you intend to extract the .zip file in the release pipeline that consumes only one single published pipeline artifact, you may use the variable Release.PrimaryArtifactSourceAlias instead like that in the configuration below.

ReleaseVariables

Please review those predefined variables if you intend to use them in the release pipelines. You may also add a Command Line Script to help understand where the artifacts file is downloaded.

echo "System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory)"
echo "Release.PrimaryArtifactSourceAlias - $(Release.PrimaryArtifactSourceAlias)"

tree $(System.DefaultWorkingDirectory)

script

Upvotes: 0

Related Questions