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

No agents created when using google compute engine and missing instance template entry

    Details

    • Similar Issues:

      Description

      Ran into an issue where after updating the Google Compute Engine Plugin  1.0.8 cloud environment module for the latest security updates, not having an Instance Template in google cloud causes jobs to queue up with no agents being built. The logs show

      Provisioning node from config com.google.jenkins.plugins.computeengine.InstanceConfiguration@50d1bc17 for excess workload of 1 units of label 'proj1'
      Jan 19, 2019 1:01:52 AM INFO com.google.jenkins.plugins.computeengine.ComputeEngineCloud availableNodeCapacityFound capacity for 8 nodes in cloud gce
      Jan 19, 2019 1:01:52 AM WARNING com.google.jenkins.plugins.computeengine.ComputeEngineCloud provisionError provisioning node
      com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
      {
        "code" : 400,
        "errors" : [ {
          "domain" : "global",
          "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.",
          "reason" : "invalid"
        } ],
        "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed."
      }
      	at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
      	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
      	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
      	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
      	at com.google.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:345)
      	at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:287)
      	at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:159)
      	at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715)
      	at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320)
      	at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
      	at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
      	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      If it's required that the Instance Template is required, then the field should be marked as required in the configuration screen, but currently does not require it. Once we created an instance template and assigned it under 'Machine Configuration'->'Template to use', the agents started being built correctly.

        Attachments

          Activity

          Hide
          emas Emanuele Massara added a comment -

          Hi, we have just run into this issue.

          We have updated the plugin time ago, and today I was on the general Jenkins configuration page (Jenkins -> Manage Jenkins -> Configure System), where I have clicked the save button.

          Instantly, my Jenkins was not able to create nodes anymore because of that error.

          I think that the save caused the tag <template></template> to be added to the configuration file, and from now on the empty string is sent every time when creating a node, and GCP API complains because it's invalid.

          In my opinion this a Critical/Blocker issue as it completely breaks the functionality.

          Show
          emas Emanuele Massara added a comment - Hi, we have just run into this issue. We have updated the plugin time ago, and today I was on the general Jenkins configuration page (Jenkins -> Manage Jenkins -> Configure System), where I have clicked the save button. Instantly, my Jenkins was not able to create nodes anymore because of that error. I think that the save caused the tag <template></template> to be added to the configuration file, and from now on the empty string is sent every time when creating a node, and GCP API complains because it's invalid. In my opinion this a Critical/Blocker issue as it completely breaks the functionality.
          Hide
          bdronneau Bastien D added a comment -

          I've the same behavior than Emanuele Massara

          Everything was good until save main configuration.

          Show
          bdronneau Bastien D added a comment - I've the same behavior than Emanuele Massara Everything was good until save main configuration.
          Hide
          sowmith1 sowmith koppula added a comment -

          400 Bad Request { "code" : 400, "errors" : [

          { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" }

          ], "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed." }

           

          we ran into same issue today morning.

          Show
          sowmith1 sowmith koppula added a comment - 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" } ], "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed." }   we ran into same issue today morning.
          Hide
          tomwj Tom Jennings added a comment -

          Deleting

          {{<template></template> }}

          from

          config.xml

          Fixed the scheduling issue I was having.

          Show
          tomwj Tom Jennings added a comment - Deleting {{<template></template> }} from config.xml Fixed the scheduling issue I was having.
          Hide
          zombiemoose Rachel Yen added a comment -

          We've since patched the bug with our new release. The problem is that not using template led to this exception. If you use the new release, it should stop. See this PR: https://github.com/jenkinsci/google-compute-engine-plugin/pull/21

           

          Closing now. 

          Show
          zombiemoose Rachel Yen added a comment - We've since patched the bug with our new release. The problem is that not using template led to this exception. If you use the new release, it should stop. See this PR:  https://github.com/jenkinsci/google-compute-engine-plugin/pull/21   Closing now. 

            People

            • Assignee:
              zombiemoose Rachel Yen
              Reporter:
              lpmiso L Powers
            • Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: