Type: Bug
Task Name: checkout aka 6d15af64-176c-496d-b583-fd2ae21d4df4@1
Server - Azure Pipelines
This is a private CI setup, I can provide the account name, team project name, build definition name/build number via email.
Agent - Hosted, Azure Pipelines, ubuntu-latest
When trying to use multiple checkout feature inside container job, it fails with ##[error]Unable to process command '##vso[plugininternal.updaterepositorypath alias=self;]/home/vsts/work/1/s' successfully.
This azure-pipelines.yml reproduces the issue:
resources:
containers:
- container: netcore_sdk_3
image: mcr.microsoft.com/dotnet/core/sdk:3.1
stages:
- stage:
jobs:
- job:
container: netcore_sdk_3
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
path: s
- checkout: self
path: s/.azd
Anonymized task logs: azd_logs.zip
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
##[error]Unable to process command '##vso[plugininternal.updaterepositorypath alias=self;]/home/vsts/work/1/s' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Repository path '/home/vsts/work/1/s' should be located under agent's work directory '/__w/1'.
##[debug]System.ArgumentException: Repository path '/home/vsts/work/1/s' should be located under agent's work directory '/__w/1'.
at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildDirectoryManager.GetRelativeRepositoryPath(String buildDirectory, String repositoryPath)
at Microsoft.VisualStudio.Services.Agent.Worker.PluginInternalUpdateRepositoryPathCommand.Execute(IExecutionContext context, Command command)
at Microsoft.VisualStudio.Services.Agent.Worker.BaseWorkerCommandExtension.ProcessCommand(IExecutionContext context, Command command, IWorkerCommandRestrictionPolicy restrictionPolicy)
at Microsoft.VisualStudio.Services.Agent.Worker.WorkerCommandManager.TryProcessCommand(IExecutionContext context, String input)
I'm having the same issue. Should this issue be tracked in the azure-pipelines-agent or azure-pipelines-tasks repository?
@qmfrederik FYI, I've worked around this issue by specifying target: host for checkout steps.
@beatcracker Awesome! That works, thank you.
Also experienced this. @beatcracker's workaround removes OP's error, but the next task after it fails with a weird exception. It may be relevant that I am not checking out to 's' but to 'b/somedir'. Not being able to pass absolute paths, such as those stemming from variables like $(Build.BinariesDirectory), to the checkout task is a pain I had to workaround to as well...
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn /__a/externals/node/bin/node ENOENT
at exports._errnoException (util.js:1020:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
at onErrorNT (internal/child_process.js:376:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
##[error]Exit code 1 returned from process: file name '/usr/bin/docker', arguments 'exec -i -u 1000 58ef71b982ab414e44f3b83bd961fa9db4536dd2e4c1d9686b936ed1a06d0667 /__a/externals/node/bin/node /__w/_temp/containerHandlerInvoker.js'.
LE: Before, my pipeline had a single checkout step:
- checkout: someotherrepo
path: b/somedir
target: host
adding a second checkout step seems to have fixed the problem:
- checkout: self
target: host
Clearly buggy behavior.
Referenced in this Developer Community post.
@beatcracker thank you so much for the work around, I am having the same issue and your method solved it.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
This issue is stale because it has been open for 180 days with no activity.
Just checked, I can still reproduce the issue using the example I provided in the description.
Starting: Checkout foo/bar@test-checkout to s
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
##[error]Unable to process command '##vso[plugininternal.updaterepositorypath alias=self;]/home/vsts/work/1/s' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Repository path '/home/vsts/work/1/s' should be located under agent's work directory '/__w/1'.
Repository is current at '/home/vsts/work/1/s/bar', move to '/home/vsts/work/1/s'.
It works if I add target: host to checkout steps.
Most helpful comment
@qmfrederik FYI, I've worked around this issue by specifying
target: hostfor checkout steps.