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

java.lang.IllegalStateException: The template variable has no value - since 1.37

      Since upgrading from 1.35 to 1.37, environment variables at least in the Tag field of the "Execute Docker Command" -> "Push image" build step seem not to be resolved correctly anymore. It fails with the following error message.

      23:04:27 Successfully built e10497dbbd44
      23:04:27 [Docker] INFO: Pushing image ...kube-system/jenkins:${BUILD_TIMESTAMP}_${BUILD_NUMBER}
      23:04:27 ERROR: Build step failed with exception
      23:04:27 java.lang.IllegalStateException: The template variable 'BUILD_TIMESTAMP' has no value
      

      Jenkins: 2.32.1
      Plugin: 1.37
      Docker: 1.11.2

      Downgrade to 1.35 helps.

          [JENKINS-41080] java.lang.IllegalStateException: The template variable has no value - since 1.37

          Hello,

          we encountered the same issue

          SEVERE: Error during callback
          com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Error parsing reference: \"<my_docker_registry>:5043/<my_path>/<my_app>:$ID\" is not a valid repository/tag: invalid reference format"}
          
                  at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:53)
                  at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140)
                  at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128)
                  at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
                  at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257)
                  at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
                  at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
                  at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
                  at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
                  at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
                  at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
                  at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448)
                  at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349)
                  at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29)
                  at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:50)
                  at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:24)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                  at java.lang.Thread.run(Thread.java:745)
          
          Feb 05, 2017 9:41:32 PM org.jenkinsci.plugins.dockerbuildstep.DockerBuilder perform
          SEVERE: Failed to execute Docker command Push image: {"message":"Error parsing reference: \"<my_docker_registry>:5043/<my_path>/<my_app>:$ID\" is not a valid repository/tag: invalid reference format"}
          

          Rolling back to 1.35 fixes the issue.
          We are under apache tomcat 7.0.59 with oracle java 1.8.0_111 and docker 1.13.0-0~debian-wheezy.
          Jenkins is 1.651.3

          Grégoire Bellon-Gervais added a comment - Hello, we encountered the same issue SEVERE: Error during callback com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Error parsing reference: \"<my_docker_registry>:5043/<my_path>/<my_app>:$ID\" is not a valid repository/tag: invalid reference format"} at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:53) at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140) at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128) at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:257) at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448) at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:349) at com.github.dockerjava.jaxrs.async.POSTCallbackNotifier.response(POSTCallbackNotifier.java:29) at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:50) at com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier.call(AbstractCallbackNotifier.java:24) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Feb 05, 2017 9:41:32 PM org.jenkinsci.plugins.dockerbuildstep.DockerBuilder perform SEVERE: Failed to execute Docker command Push image: {"message":"Error parsing reference: \"<my_docker_registry>:5043/<my_path>/<my_app>:$ID\" is not a valid repository/tag: invalid reference format"} Rolling back to 1.35 fixes the issue. We are under apache tomcat 7.0.59 with oracle java 1.8.0_111 and docker 1.13.0-0~debian-wheezy. Jenkins is 1.651.3

          For test purpose, I have tried to put a backslash in front of my parameter ($ID) in the field "Name of the image to tag (repository/image:tag)" for tag command : "<my_path>/<my_app>:\$ID"
          But I still got an error even if this time, the $ID is correctly replaced :

          Feb 05, 2017 9:42:38 PM org.jenkinsci.plugins.dockerbuildstep.DockerBuilder perform
          SEVERE: Failed to execute Docker command Tag image: {"message":"Error parsing reference: \"<my_path>/<my_app>:\\\"37c3adc3454bd0eb1b24a9974d78a4efda5077a0\\\"\" is not a valid repository/tag: invalid reference format"}
          

          Grégoire Bellon-Gervais added a comment - For test purpose, I have tried to put a backslash in front of my parameter ($ID) in the field "Name of the image to tag (repository/image:tag)" for tag command : "<my_path>/<my_app>:\$ID" But I still got an error even if this time, the $ID is correctly replaced : Feb 05, 2017 9:42:38 PM org.jenkinsci.plugins.dockerbuildstep.DockerBuilder perform SEVERE: Failed to execute Docker command Tag image: {"message":"Error parsing reference: \"<my_path>/<my_app>:\\\"37c3adc3454bd0eb1b24a9974d78a4efda5077a0\\\"\" is not a valid repository/tag: invalid reference format"}

          Version 1.39 fixes this issue.
          Well done !!

          Grégoire Bellon-Gervais added a comment - Version 1.39 fixes this issue. Well done !!

            vjuranek vjuranek
            renesc Rene SC
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: