Azure-pipelines-agent: Error while saving the cache : [error]Failed to start the required dependency 'tar'. Please verify the correct version is installed and available on the path.

Created on 26 Mar 2020  路  18Comments  路  Source: microsoft/azure-pipelines-agent

Having issue with YAML?

Please log an issue at Azure-Pipelines-YAML. Over there we discuss YAML templates, samples for Azure Pipelines, and designs for upcoming YAML features. Also a place for the community to share best practices, ideas, and so on. File suggestions and issues here if they're specific to YAML pipelines.

Having issue with Tasks?

Log an issue at Azure-Pipelines-Tasks. It contains all of the in-box tasks we ship with Azure-Pipelines/VSTS/TFS. If you're having issues with tasks in Build/Release jobs (e.g. unreasonable task failure) please log an issue there.

Having issue with software on Hosted Agent?

Log an issue at Hosted Agent Image Repository. It contains the VM image used in the Azure Pipelines Hosted Agent Pool. If you're having Build/Release failures that seems like they are related to software installed on the Hosted Agent (e.g. the dotnet SDK is missing or the Azure SDK is not on the latest version) please log an issue there.

Having generic issue with Azure-Pipelines/VSTS/TFS?

Please report it on Developer Community

Have you tried troubleshooting?

Troubleshooting doc

Agent Version and Platform

Version of your agent? 2.144.0/2.144.1/...

OS of the machine running the agent? OSX/Windows/Linux/...

Azure DevOps Type and Version

dev.azure.com (formerly visualstudio.com) or on-premises TFS/Azure DevOps Server?

If on-premises, which release? 2015.0, 2017.1, 2019 RC2, etc.

If dev.azure.com, what is your organization name? https://dev.azure.com/{organization} or https://{organization}.visualstudio.com

What's not working?

Please include error messages and screenshots.

Agent and Worker's Diagnostic Logs

Logs are located in the agent's _diag folder. The agent logs are prefixed with Agent_ and the worker logs are prefixed with Worker_. All sensitive information should already be masked out, but please double-check before pasting here.

bug question

All 18 comments

@fadnavistanmay - Can you take a look at this?

Having the same problem when using NPM cache. Post build task fails with:

[error]Failed to start the required dependency 'tar'. Please verify the correct version is installed and available on the path.

Running a windows agent.

Here same error too. Trying to use npm cache in order to increase a deployment speed but post cache task is showing the follow error:

[error]Failed to start the required dependency 'tar'. Please verify the correct version is installed and available on the path.

Which version of tar have you installed?
Has the path variable been updated to include the directory where tar is installed?

I also have this issue.

Agent version: 2.169.1
Tar GNU 32 installed and path updated. "tar" via cmd works
OS: Windows Server 2012 R2

I also have this issue.

Agent version: 2.169.1
Tar GNU 32 installed and path updated. "tar" via cmd works
OS: Windows Server 2012 R2

Did you get it to work?

Also having this issue, i've installed GNU32 and updated the path. Still no luck

Fixed the issue in my environment. Once I installed GNU32 AND added it to the $PATH the error resolved itself. Be sure to attempt to call the tar.exe command (I used Powershell) from any directory you're currently in; if you receive an error stating that it doesn't exist that it's not where it needs to be. This test will confirm that the executable is indeed in $PATH.

Fixed the issue in my environment. Once I installed GNU32 AND added it to the $PATH the error resolved itself. Be sure to attempt to call the tar.exe command (I used Powershell) from any directory you're currently in; if you receive an error stating that it doesn't exist that it's not where it needs to be. This test will confirm that the executable is indeed in $PATH.

I did that, tar executes under windows cmd but the azure pipeline fails with the same error anyway

Fixed the issue in my environment. Once I installed GNU32 AND added it to the $PATH the error resolved itself. Be sure to attempt to call the tar.exe command (I used Powershell) from any directory you're currently in; if you receive an error stating that it doesn't exist that it's not where it needs to be. This test will confirm that the executable is indeed in $PATH.

I did that, tar executes under windows cmd but the azure pipeline fails with the same error anyway

Which server are you using? Didn't work for me on Win 2012r2. Win 2019 server comes with tar. So tar is fine. Haven't had luck with caching yet though.

Fixed the issue in my environment. Once I installed GNU32 AND added it to the $PATH the error resolved itself. Be sure to attempt to call the tar.exe command (I used Powershell) from any directory you're currently in; if you receive an error stating that it doesn't exist that it's not where it needs to be. This test will confirm that the executable is indeed in $PATH.

I did that, tar executes under windows cmd but the azure pipeline fails with the same error anyway

Which server are you using? Didn't work for me on Win 2012r2. Win 2019 server comes with tar. So tar is fine. Haven't had luck with caching yet though.

Windows Server 2016, I am giving up the npm caching, doesnt help much anyway, cant cache the node_modules anyway

I'm having the same issue. I installed tar, and added it to path:

C:\Users\admin>tar --version
tar (GNU tar) 1.13

Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Written by John Gilmore and Jay Fenlason.

I still get the Failed to start the required dependency 'tar'. Please verify the correct version is installed and available on the path.. I tried restarting the agent's service, didn't help.

@JH-Tools4ERP have you tried adding a custom user capability like tar=<path to your tar.exe> into your self hosted agent ? I had similar issues with curl for windows with azure pipelines and I followed the above approach to resolve it in addition to adding it to the path of course.
I have the similar set up for tar after encountering the initial error of tar not found on windows but it is working now for me.

Although on a side note, I must say the whole caching concept does not make sense if the cache gets uploaded to the pipeline through the API and is restored again during the next run making the pipeline run more slower.

@nithyusha23 @jlabaj @matthoulb you can specify path that the tar either in Path environment variable or by specifying 'VSTS_TAR_EXECUTABLE' environment variable also - could you please try second approach?

Setting 'VSTS_TAR_EXECUTABLE' does work

@ankur198 ok thanks! Looks like there's missed path to the tar in Path environment variable - let me close this at the moment since it doesn't seem to be an issue. Please feel free to ask any further questions.

Having the same issue, tried using the path variable and the VSTS_TAR_EXECUTABLE also. On Windows Server 2012 R2 and 2016

Was this page helpful?
0 / 5 - 0 ratings