java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm using Jenkins as a Docker container by installing Docker within my Jenkins container and binding Docker socket (see config below). I try to compile a Maven project using *maven:3.2-jdk-7* (see attached image). But I have this error: {code}$ docker run --rm --entrypoint /bin/true alpine:3.2 $ docker run --tty --rm --entrypoint /sbin/ip alpine:3.2 route $ docker run --tty --detach --workdir /var/jenkins_home/jobs/xxxxx/workspace --volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw --net bridge --add-host dockerhost:172.17.0.1 --env BUILD_DISPLAY_NAME=#1 --env BUILD_ID=1 --env BUILD_NUMBER=1 --env BUILD_TAG=xxxxx-1 --env BUILD_URL=http://localhost:8080/job/xxxxx/1/ --env CLASSPATH= --env EXECUTOR_NUMBER=0 --env GIT_BRANCH=origin/master --env GIT_COMMIT=883d20d67b50b0daea5a78d3192a4f84ed282fb4 --env GIT_URL=https://git.xxxxxxxx.git --env HUDSON_HOME=/var/jenkins_home --env HUDSON_SERVER_COOKIE=70042bb5dbdea6c1 --env HUDSON_URL=http://localhost:8080/ --env JENKINS_SERVER_COOKIE=70042bb5dbdea6c1 --env JENKINS_URL=http://localhost:8080/ --env JOB_NAME=xxxxx --env JOB_URL=http://localhost:8080/job/xxxxx/ --env NODE_LABELS=master --env NODE_NAME=master --env WORKSPACE=/var/jenkins_home/jobs/xxxxx/workspace maven:3.2-jdk-7 /bin/cat docker: Error response from daemon: Container command '/bin/cat' not found or does not exist.. FATAL: Failed to run docker image java.lang.RuntimeException: Failed to run docker image at com.cloudbees.jenkins.plugins.docker_build_env.Docker.runDetached(Docker.java:226) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:202) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:175) at hudson.model.Build$BuildExecution.doRun(Build.java:156) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE {code} I don't understand why I have this error as I'm able to compile my project locally using this Maven Docker image. Here is my config: *Dockerfile* {code} FROM jenkins:1.651.2 USER root RUN \ apt-get update && \ apt-get install -y apt-transport-https ca-certificates && \ echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list && \ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ apt-get update && \ apt-get install -y \ lxc \ sudo \ docker-engine \ bzip2 && \ usermod -a -G docker jenkins RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref USER jenkins {code} *docker-compose.yml* {code} jenkins: build: . ports: - "8080:8080" - "5000:5000" volumes: - /var/run/docker.sock:/var/run/docker.sock {code}
    via by Cedric Thiebault,
  • I'm using Jenkins as a Docker container by installing Docker within my Jenkins container and binding Docker socket (see config below). I try to compile a Maven project using *maven:3.2-jdk-7* (see attached image). But I have this error: {code}$ docker run --rm --entrypoint /bin/true alpine:3.2 $ docker run --tty --rm --entrypoint /sbin/ip alpine:3.2 route $ docker run --tty --detach --workdir /var/jenkins_home/jobs/xxxxx/workspace --volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw --net bridge --add-host dockerhost:172.17.0.1 --env BUILD_DISPLAY_NAME=#1 --env BUILD_ID=1 --env BUILD_NUMBER=1 --env BUILD_TAG=xxxxx-1 --env BUILD_URL=http://localhost:8080/job/xxxxx/1/ --env CLASSPATH= --env EXECUTOR_NUMBER=0 --env GIT_BRANCH=origin/master --env GIT_COMMIT=883d20d67b50b0daea5a78d3192a4f84ed282fb4 --env GIT_URL=https://git.xxxxxxxx.git --env HUDSON_HOME=/var/jenkins_home --env HUDSON_SERVER_COOKIE=70042bb5dbdea6c1 --env HUDSON_URL=http://localhost:8080/ --env JENKINS_SERVER_COOKIE=70042bb5dbdea6c1 --env JENKINS_URL=http://localhost:8080/ --env JOB_NAME=xxxxx --env JOB_URL=http://localhost:8080/job/xxxxx/ --env NODE_LABELS=master --env NODE_NAME=master --env WORKSPACE=/var/jenkins_home/jobs/xxxxx/workspace maven:3.2-jdk-7 /bin/cat docker: Error response from daemon: Container command '/bin/cat' not found or does not exist.. FATAL: Failed to run docker image java.lang.RuntimeException: Failed to run docker image at com.cloudbees.jenkins.plugins.docker_build_env.Docker.runDetached(Docker.java:226) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:202) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:175) at hudson.model.Build$BuildExecution.doRun(Build.java:156) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE {code} I don't understand why I have this error as I'm able to compile my project locally using this Maven Docker image. Here is my config: *Dockerfile* {code} FROM jenkins:1.651.2 USER root RUN \ apt-get update && \ apt-get install -y apt-transport-https ca-certificates && \ echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list && \ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ apt-get update && \ apt-get install -y \ lxc \ sudo \ docker-engine \ bzip2 && \ usermod -a -G docker jenkins RUN chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref USER jenkins {code} *docker-compose.yml* {code} jenkins: build: . ports: - "8080:8080" - "5000:5000" volumes: - /var/run/docker.sock:/var/run/docker.sock {code}
    via by Cedric Thiebault,
  • in https://github.com/jenkinsci/docker-custom-build-environment-plugin/blob/docker-custom-build-environment-1.6.0/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/Docker.java#L192, the {{getDocker0Ip}} method is using {{ifconfig docker0}} but the result cannot be used in https://github.com/jenkinsci/docker-custom-build-environment-plugin/blob/docker-custom-build-environment-1.6.0/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/Docker.java#L164 for the docker command {{--add-host}} parameter. {noformat} $ ifconfig docker0 invalid value "dockerhost:flags=4099<UP,BROADCAST,MULTICAST>" for flag --add-host: invalid IP address in add-host: "flags=4099<UP,BROADCAST,MULTICAST>" See 'docker run --help'. FATAL: Failed to run docker image java.lang.RuntimeException: Failed to run docker image at com.cloudbees.jenkins.plugins.docker_build_env.Docker.runDetached(Docker.java:186) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:176) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:151) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Finished: FAILURE {noformat}
    via by Adrien Lecharpentier,
  • in https://github.com/jenkinsci/docker-custom-build-environment-plugin/blob/docker-custom-build-environment-1.6.0/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/Docker.java#L192, the {{getDocker0Ip}} method is using {{ifconfig docker0}} but the result cannot be used in https://github.com/jenkinsci/docker-custom-build-environment-plugin/blob/docker-custom-build-environment-1.6.0/src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/Docker.java#L164 for the docker command {{--add-host}} parameter. {noformat} $ ifconfig docker0 invalid value "dockerhost:flags=4099<UP,BROADCAST,MULTICAST>" for flag --add-host: invalid IP address in add-host: "flags=4099<UP,BROADCAST,MULTICAST>" See 'docker run --help'. FATAL: Failed to run docker image java.lang.RuntimeException: Failed to run docker image at com.cloudbees.jenkins.plugins.docker_build_env.Docker.runDetached(Docker.java:186) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:176) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:151) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Finished: FAILURE {noformat}
    via by Adrien Lecharpentier,
  • Jenkins run docker image with wrong image name
    via Stack Overflow by eladm26
    ,
    • java.lang.RuntimeException: Failed to run docker image at com.cloudbees.jenkins.plugins.docker_build_env.Docker.runDetached(Docker.java:226) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:202) at com.cloudbees.jenkins.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:175) at hudson.model.Build$BuildExecution.doRun(Build.java:156) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)
    No Bugmate found.