Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
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
AUG Leaders

Atlassian Community Events