Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Error “The working directory must exist before executing the process” when deploying with Bamboo


I have a Script task, in Bamboo, for deploying a C# console project to a web server. When run, the task fails with the following error:

com.atlassian.bamboo.task.TaskException: Failed to execute task
at com.atlassian.bamboo.plugins.script.task.ScriptBuildTask.execute(
at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(
at com.atlassian.bamboo.task.TaskExecutorImpl.execute(
at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(
at com.atlassian.bamboo.utils.BambooRunnables$
at Source)
Caused by: java.lang.IllegalArgumentException: The working directory must exist before executing the process
at com.atlassian.bamboo.process.ProcessServiceImpl.createExternalProcess(
at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(


All the task does is copy the release folder of the project in question from a Bamboo build server to a given directory on another server. It's set as an inline task and its script body looks like this:

xcopy /s /y "${}\Source\MyProject\bin\Release" "\\${bamboo.deploy.environment}\c$\Applications\Stuff\TargetFolder"


Where "${bamboo.deploy.environment}" is equal to "development", and the "Working sub directory" property of the task looks like this:



I've verified that the "Source\bin\release" folder on the Bamboo build server exists and all the release files for "MyProject" are present in it, and I've also verified that folder "c$\Applications\Stuff\TargetFolder" on sever "" exists and that it has proper permissions, but I am still getting the error.

The only useful information about this I've been able to find, in this question from two years ago,  alludes to a permission issue of some kind, and that the Bamboo agent performing the deploy might not have permissions to access directory "TargetFolder", but I have not been able to figure out where in Bamboo to change the permissions for the deployment agent.

Any idea why this exception is being thrown and how to change the permissions for a Bamboo deploy agent?

1 answer

1 accepted

1 vote
Answer accepted
Foong Atlassian Team May 15, 2018

the "Working sub directory" property of the task looks like this:

It seems that you are trying to use remote server file URL in the "Working subdirectory" setting.

Script task does not work with remote server file URL. If the Working subdirectory setting is "\Source\MyProject\bin\Release", it means that the script will be run in the directory "${}\Source\MyProject\bin\Release".

If you would like to run the script in another machine, pease use the SSH Task.

Yes, that was the problem. I put the remote server file URL in the wrong place. It should be in Environment variables, not Working subdirectory. Once i put it in Environment variables, it started working.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

58 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you