jenkins-docs/simple-java-maven-app

Not working: nonexistent directory

tkshnwesper opened this issue · 7 comments

I followed the tutorial and I got this error. Does anyone know what went wrong?

Obtained Jenkinsfile from git /home/code/pathashala/jenkins/sjma
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/sjma
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository /home/code/pathashala/jenkins/sjma
 > git init /var/jenkins_home/workspace/sjma # timeout=10
Fetching upstream changes from /home/code/pathashala/jenkins/sjma
 > git --version # timeout=10
 > git fetch --tags --progress /home/code/pathashala/jenkins/sjma +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url /home/code/pathashala/jenkins/sjma # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url /home/code/pathashala/jenkins/sjma # timeout=10
Fetching upstream changes from /home/code/pathashala/jenkins/sjma
 > git fetch --tags --progress /home/code/pathashala/jenkins/sjma +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 47e6c3653478ad31521d0959077b7036adfd4d67 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 47e6c3653478ad31521d0959077b7036adfd4d67
Commit message: "meow"
First time build. Skipping changelog.
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Agent Setup)
[Pipeline] sh
[sjma] Running shell script
+ docker pull maven:3-alpine
3-alpine: Pulling from library/maven
88286f41530e: Pulling fs layer
009f6e766a1b: Pulling fs layer
86ed68184682: Pulling fs layer
f9cdc72bb970: Pulling fs layer
7e4415124188: Pulling fs layer
f6ba1c32fdb3: Pulling fs layer
8f690e3687b2: Pulling fs layer
7e4415124188: Waiting
f6ba1c32fdb3: Waiting
8f690e3687b2: Waiting
f9cdc72bb970: Waiting
009f6e766a1b: Download complete
f9cdc72bb970: Download complete
86ed68184682: Verifying Checksum
86ed68184682: Download complete
7e4415124188: Verifying Checksum
7e4415124188: Download complete
f6ba1c32fdb3: Download complete
8f690e3687b2: Verifying Checksum
8f690e3687b2: Download complete
88286f41530e: Verifying Checksum
88286f41530e: Download complete
88286f41530e: Pull complete
009f6e766a1b: Pull complete
86ed68184682: Pull complete
f9cdc72bb970: Pull complete
7e4415124188: Pull complete
f6ba1c32fdb3: Pull complete
8f690e3687b2: Pull complete
Digest: sha256:400fb45cfcedfc492ff91319ea0a58f570172f8cf65f40b9b14931f44a6c1417
Status: Downloaded newer image for maven:3-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[sjma] Running shell script
+ docker inspect -f . maven:3-alpine
.
[Pipeline] withDockerContainer
Jenkins does not seem to be running inside a container
$ docker run -t -d -u 0:0 -v /root/.m2:/root/.m2 -w /var/jenkins_home/workspace/sjma -v /var/jenkins_home/workspace/sjma:/var/jenkins_home/workspace/sjma:rw,z -v /var/jenkins_home/workspace/sjma@tmp:/var/jenkins_home/workspace/sjma@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat maven:3-alpine
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] sh
[sjma] Running shell script
sh: can't create /var/jenkins_home/workspace/sjma@tmp/durable-cd13b59e/jenkins-log.txt: nonexistent directory
sh: can't create /var/jenkins_home/workspace/sjma@tmp/durable-cd13b59e/jenkins-result.txt: nonexistent directory
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
$ docker stop --time=1 5f92084ceb1bb8d412e4507dee0c2f537ebbf4895ed62e7eba59cd8b389371ac
$ docker rm -f 5f92084ceb1bb8d412e4507dee0c2f537ebbf4895ed62e7eba59cd8b389371ac
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

Hello @tkshnwesper ,

Sorry it's taken a while to respond to the issue you raised above, but thank you for raising it!

You're not alone in experiencing this problem. It's quite likely that this issue resulted from a recent change in Docker behavior, which was no longer being handled correctly by the Docker Pipeline plugin in Jenkins.

However, this issue is currently being dealt with. You can read more about it in this Jenkins Users group post as well as this JIRA issue.

Kind regards,
Giles.

the google was blocked by our goverment , are there any other links ?

Hello @philhong2012 ,

If you can access the content at the JIRA issue link above, all the information you need should be there, especially this comment on the issue.

Cheers,
Giles.

While you are waiting for a new version of the Docker Pipeline/workflow plugin to be released with this update/fix, you can work around this issue with the temporary fix documented on this (now superseded) PR.

You'll need Maven installed locally, as that's the tool which will build the patched plugin.

Once you've built the patched plugin, upload it to your local Jenkins in Docker instance by accessing Manage Jenkins > Manage Plugins > Advanced (tab) > Choose file (under "Upload Plugin" to upload the "docker-workflow.hpi" file) > Upload (button).

Thank you for the helping hand @gilesgas !

Hi all,

Just letting you know that a new version of the Docker Pipeline plugin (1.15) was released yesterday.

I've since verified that if you update this plugin to this version (or later) on your Jenkins instance (via Manage Jenkins > Manage Plugins), these tutorials will start working again.

Cheers,
Giles.

It is good to hear that @gilesgas ! Thank you for keeping us updated!