uncletall
uncletall

Reputation: 6842

jenkins pipeline running inside docker image just hangs

I have a very simple script to test running inside a docker container. The container starts and I can connect to the container.

node('docker') {
    docker.image('python:3').inside() {
        sh "python --version"
    }
}

In the end the job fails. Any ideas what is wrong?


Update 1:

I have added the environment variable to Jenkins and now see the following. Looks like some strange variables are passed to docker. Any idea how I can examine the command given in the sh?

[Pipeline] stage
[Pipeline] { (test)
[Pipeline] echo
I'm here
[Pipeline] sh
invalid argument "=" for "-e, --env" flag: invalid environment variable: =
See 'docker exec --help'.
process apparently never started in /var/lib/jenkins- 
slave/workspace/SYSTEM/clean-artifactory@tmp/durable-4d51de81
[Pipeline] }
[Pipeline] // stage

Upvotes: 8

Views: 4600

Answers (2)

uncletall
uncletall

Reputation: 6842

This was a bug in the Durable Task plugin and has been fixed by the latest release (1.33).

See JENKINS-59903

Upvotes: 6

artronics
artronics

Reputation: 1496

I had the same problem and after a long wait this error message is logged in console:

Cannot contact : java.io.FileNotFoundException: File '/var/lib/jenkins/workspace/myproject@2@tmp/durable-1a2d497f/output.txt' does not exist

The problem is Durable Task plugin. In my case I downgraded Durable Task plugin from latest (1.31) to 1.30 and that solved the problem.

I'm using Docker Pipeline version 1.21

Upvotes: 3

Related Questions