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

partial credential bindings causes build to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.254, Ubuntu 20.04, CloudBees Docker Custom Build Environment Plugin 1.7.3, Credentials Binding Plugin 1.23

      Create a Freestyle job which builds in a docker container from CloudBees Docker Custom Build Environment Plugin.

      Add Credential Binding to the job: "SSH User Private Key".

      This has multiple fields you can set: Key File Variable, Passphrase Variable (optional), Username Variable (optional)

      If you don't set those optional variables in the job itself, then the build crashes.   The output is shown below. The crash does not happen if you have a regular job without Docker. The crash does not happen if you have Docker but you specify all the so-called "optional" variables.

      The problem is that if someone is not familiar with this bug, it may not be obvious why the build is failing.

       Console Output
      Started by user Sam
      Running as SYSTEM
      [EnvInject] - Loading node environment variables.
      Building on master in workspace /var/lib/jenkins/workspace/test1
      invalid argument "=***" for "-e, --env" flag: invalid environment variable: =***
      See 'docker run --help'.
      FATAL: Failed to run docker image
      java.lang.RuntimeException: Failed to run docker image
      at com.cloudbees.****.plugins.docker_build_env.Docker.runDetached(Docker.java:239)
      at com.cloudbees.****.plugins.docker_build_env.DockerBuildWrapper.startBuildContainer(DockerBuildWrapper.java:212)
      at com.cloudbees.****.plugins.docker_build_env.DockerBuildWrapper.setUp(DockerBuildWrapper.java:185)
      at hudson.model.Build$BuildExecution.doRun(Build.java:157)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1894)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:428)
      Finished: FAILURE

            Unassigned Unassigned
            sdarwin Sam Darwin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: