Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 Edited

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.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:84)
at com.atlassian.bamboo.plugins.script.task.ScriptBuildTask.execute(ScriptBuildTask.java:55)
at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$272(TaskExecutorImpl.java:317)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:246)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:317)
at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118)
at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: The working directory must exist before executing the process
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.atlassian.bamboo.process.ProcessServiceImpl.createExternalProcess(ProcessServiceImpl.java:157)
at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:206)
at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:61)

 

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 "${bamboo.build.working.directory}\Source\MyProject\bin\Release" "\\${bamboo.deploy.environment}.mycompany.com\c$\Applications\Stuff\TargetFolder"

 

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

location="\\development.mycompany.com\c$\Applications\Stuff\TargetFolder"

 

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 "development.mycompany.com" 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 "${bamboo.build.working.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.

 

Thanks.

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

227 views 4 6
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