TomSelleck
TomSelleck

Reputation: 6968

Jenkins - "Failed to mkdirs", when starting a build

I am trying to set up Jenkins on a remote machine. I have it installed and ready to go but when I try to run my job, I get the following error:

Started by user anonymous
Building in workspace C:\Program Files\Jenkins\"C:\Documents and Settings\Administrator\My Documents\pbnb_cli"
java.io.IOException: Failed to mkdirs: C:\Program Files\Jenkins\"C:\Documents and Settings\Administrator\My Documents\pbnb_cli"
    at hudson.FilePath.mkdirs(FilePath.java:1093)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1247)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
    at hudson.model.Run.execute(Run.java:1740)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: [email protected]
Error sending to the following VALID addresses: [email protected]
Finished: FAILURE

Does anybody have any idea why this might happen?

Upvotes: 0

Views: 5661

Answers (1)

Slav
Slav

Reputation: 27495

This line tells you everything:

Building in workspace C:\Program Files\Jenkins\"C:\Documents and Settings\Administrator\My Documents\pbnb_cli"

That above is not a valid path no matter how you look at it. Without seeing your configuration (and you are not providing any...) we can only guess where you messed up.

So, let's guess:

  • C:\Program Files\Jenkins\ is JENKINS_HOME on Windows.
  • A workspace would usually be C:\Program Files\Jenkins\jobs\[jobname]\workspace i.e %JENKINS_HOME%\jobs\%JOB_NAME%\workspace
  • Your workspace path has neither an (obvious) jobname, nor the word workspace. So you've definitely tried to alter the workspace location.
  • You pasted the line "C:\Documents and Settings\Administrator\My Documents\pbnb_cli" (as is, with quotes) somewhere where you shouldn't have. Let's keep guessing.

Probable guess:

  • Under Job Configuration -> Advanced Project Options ->Advanced... button, there is a an entry titled Use custom workspace
  • If you pasted "C:\Documents and Settings\Administrator\My Documents\pbnb_cli" in there, with quotes, it's not taking it as absolute path, and thinks it's a relative path, and relative paths start from %JENKINS_HOME%, which would explain your C:\Program Files\Jenkins\"C:\Documents and Settings\Administrator\My Documents\pbnb_cli" error
  • You should paste your desired custom workspace without quotes, like this C:\Documents and Settings\Administrator\My Documents\pbnb_cli, and it will work.

An alternative

  • Alternatively, under Manage Jenkins -> Configure System -> Advanced... button, there is an entry titled Workspace Root Directory.
  • My guess is, you have something like ${JENKINS_HOME}"C:\Documents and Settings\Administrator\My Documents\pbnb_cli" in there. This would explain your current state.
  • You should fix it to default value of ${ITEM_ROOTDIR}/workspace

Upvotes: 2

Related Questions