[JIRA] (JENKINS-52264) Error while running pipeline job in docker

13 views
Skip to first unread message

suvirkamli@gmail.com (JIRA)

unread,
Jun 29, 2018, 2:00:02 AM6/29/18
to jenkinsc...@googlegroups.com
Suvir Pavin created an issue
 
Jenkins / Bug JENKINS-52264
Error while running pipeline job in docker
Issue Type: Bug Bug
Assignee: Unassigned
Components: docker-workflow-plugin
Created: 2018-06-29 05:59
Environment: Jenkins Version: 2.121.1
Docker Pipeline Plugin: 1.5
Priority: Blocker Blocker
Reporter: Suvir Pavin

After Upgrading Docker Pipeline Plugin from 1.4 to latest(1.7), our pipeline job running with Docker started failing with following error,
ERROR: The container started but didn't run the expected command. Please double check your ENTRYPOINT does execute the command passed as docker run argument. See
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#entrypoint
for entrypoint best practices.[Pipeline]

{[Pipeline] sh[PROMOTION-pre-build-CommitStage@2] Running shell script invalid argument "=" for "-e, --env" flag: invalid environment variable: = See 'docker exec --help'. process apparently never started in /****/workspace/*********@2@tmp/durable-bf8996ec[Pipeline] }

$ docker stop --time=1 6c3e4c47264e7766c2277555ac05de7267ab0895ab8f91b257761a6c649379c2
$ docker rm -f 6c3e4c47264e7766c2277555ac05de7267ab0895ab8f91b257761a6c649379c2[Pipeline] // withDockerContainer[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // withDockerRegistry[Pipeline] }[Pipeline] // withCredentials[Pipeline] }[Pipeline] // ws[Pipeline] }[Pipeline] // node[Pipeline] echoError: hudson.AbortException: script returned exit code -2
 

Investigating further we found that issue is with Docker Pipeline Plugin 1.5.

 

Can you please help us fix this issue? Are we missing something while using version 1.5 or is it a bug in the plugin?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

werries05@gmail.com (JIRA)

unread,
Jul 10, 2018, 7:44:01 PM7/10/18
to jenkinsc...@googlegroups.com
Adam Werries commented on Bug JENKINS-52264
 
Re: Error while running pipeline job in docker

I found help here for a similar issue: http://jenkins-ci.361315.n4.nabble.com/withDockerContainer-in-pipeline-failing-td4932626.html

Basically, in case the link dies: you likely have an empty environment variable in your global configuration or node configuration.

alexvolanis@gmail.com (JIRA)

unread,
Jul 23, 2018, 6:40:02 PM7/23/18
to jenkinsc...@googlegroups.com

I had the same issue and it was indeed an empty environment set in the global configuration. There was code added to protect from that in version 1.12 but was done only for docker run and not for docker exec. It is a shame really because the fix is a one line change.

This commit has the fix for the docker run and the same can be made for the docker exec in the same class.

https://github.com/jenkinsci/docker-workflow-plugin/commit/a25fe7ad582eecb771292084acdbff5ee56cd2c2

alexvolanis@gmail.com (JIRA)

unread,
Jul 24, 2018, 10:13:01 AM7/24/18
to jenkinsc...@googlegroups.com

I created https://github.com/jenkinsci/docker-workflow-plugin/pull/147 which addresses this issue the same way it was done for "docker run" in the original commit mentioned above. Since that original commit was done the "docker exec" was changed to use the "–env" option which exposed this defect.

jonathan.chauncey@gmail.com (JIRA)

unread,
Aug 30, 2018, 8:57:02 AM8/30/18
to jenkinsc...@googlegroups.com

I was having this same issue and found that if you go Manage Jenkins -> Configure System there will be an empty environment variable in the Global Properties section. If you remove that everything should work

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

giorgio.desideri@gmail.com (JIRA)

unread,
Oct 24, 2019, 6:19:02 AM10/24/19
to jenkinsc...@googlegroups.com

In my scripted pipeline `-v /var/jenkins/caches:/var/jenkins/caches` it works as work-around.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

giorgio.desideri@gmail.com (JIRA)

unread,
Oct 24, 2019, 6:20:04 AM10/24/19
to jenkinsc...@googlegroups.com
Giorgio Desideri edited a comment on Bug JENKINS-52264
In my scripted pipeline ` {{-v /var/jenkins/caches:/var/jenkins/caches}} ` it works as work-around.


{{}}{{docker.image("....").inside("{{-v /var/jenkins/caches:/var/jenkins/caches}}") }}

{{{}}

{{...}}{{}}}

giorgio.desideri@gmail.com (JIRA)

unread,
Oct 24, 2019, 6:22:03 AM10/24/19
to jenkinsc...@googlegroups.com

timblaktu@gmail.com (JIRA)

unread,
Mar 11, 2020, 1:00:03 PM3/11/20
to jenkinsc...@googlegroups.com

This can manifest in various ways - for me it first appeared to be this bug, and only after enabling LAUNCH_DIAGNOSTICS did we see evidence that lead us here, which was the actual culprit.

 

 

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages