Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39457

Empty environment variable causes error on docker run

    Details

    • Similar Issues:

      Description

      The following is an excerpt from a test job that I setup. I have highlighted the relevant portion below (and removed some of the environment entries for privacy reasons). It appears that a buggy plugin is causing an empty environment variable to be defined. While not the fault of this plugin, a simple fix would be to ignore any environment entries that are empty.

      docker run -tty --detach --workdir "/home/jenkins/jobs/Docker test/workspace" --volume /home/jenkins:/home/jenkins:rw --volume /tmp:/tmp:rw --net bridge --add-host dockerhost:172.17.0.1 *env = *-env BUILD_CAUSE=MANUALTRIGGER --env BUILD_CAUSE_MANUALTRIGGER=true --env BUILD_DISPLAY_NAME=#10 --env BUILD_ID=10 --env BUILD_NUMBER=10 --env "BUILD_TAG=jenkins-Docker test-10" --env GIT_BRANCH=origin/master 4a832f895ca6 /bin/cat
      docker: Error response from daemon: rpc error: code = 2 desc = "oci runtime error: write /proc/17228/oom_score_adj: invalid argument".
      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:1720)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:404)

        Attachments

          Activity

          Hide
          swampfox357 Michael Price added a comment -

          I would be willing to submit a simple patch to resolve this, assuming that it will be pulled in.

          Show
          swampfox357 Michael Price added a comment - I would be willing to submit a simple patch to resolve this, assuming that it will be pulled in.

            People

            • Assignee:
              Unassigned
              Reporter:
              swampfox357 Michael Price
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: