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

Cannot provision when there are instances created from snapshot (google-compute-engine)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Jclouds-plugin fails to count nodes if there is an instance created not from image, but from snapshot

      stacktrace:

      Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@79b4d01d failed
      shaded.com.google.common.util.concurrent.UncheckedExecutionException: java.util.concurrent.ExecutionException: could not find image for disk https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/INSTANCE_NAME: endpoint for [0] not configured for org.jclouds.googlecomputeengine.compute.functions.Resources.public abstract org.jclouds.googlecomputeengine.domain.Image org.jclouds.googlecomputeengine.compute.functions.Resources.image(java.net.URI)
      at shaded.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4829)
      at org.jclouds.googlecomputeengine.compute.functions.InstanceToNodeMetadata.apply(InstanceToNodeMetadata.java:77)
      at org.jclouds.googlecomputeengine.compute.functions.InstanceToNodeMetadata.apply(InstanceToNodeMetadata.java:43)
      at shaded.com.google.common.base.Functions$FunctionComposition.apply(Functions.java:211)
      at shaded.com.google.common.collect.Iterators$8.transform(Iterators.java:794)
      at shaded.com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
      at shaded.com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
      at shaded.com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
      at shaded.com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
      at shaded.com.google.common.collect.Iterators.addAll(Iterators.java:356)
      at shaded.com.google.common.collect.Iterables.addAll(Iterables.java:350)
      at shaded.com.google.common.collect.Sets.newLinkedHashSet(Sets.java:328)
      at org.jclouds.compute.internal.BaseComputeService.listNodes(BaseComputeService.java:342)
      at jenkins.plugins.jclouds.compute.JCloudsCloud.getRunningNodesCount(JCloudsCloud.java:482)
      at jenkins.plugins.jclouds.compute.JCloudsCloud.provision(JCloudsCloud.java:365)
      at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:701)
      at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:307)
      at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:60)
      at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:798)
      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
      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:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.concurrent.ExecutionException: could not find image for disk https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/INSTANCE_NAME: endpoint for [0] not configured for org.jclouds.googlecomputeengine.compute.functions.Resources.public abstract org.jclouds.googlecomputeengine.domain.Image org.jclouds.googlecomputeengine.compute.functions.Resources.image(java.net.URI)
      at org.jclouds.googlecomputeengine.compute.loaders.DiskURIToImage.load(DiskURIToImage.java:50)
      at org.jclouds.googlecomputeengine.compute.loaders.DiskURIToImage.load(DiskURIToImage.java:32)
      at shaded.com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
      at shaded.com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
      at shaded.com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
      at shaded.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
      at shaded.com.google.common.cache.LocalCache.get(LocalCache.java:3934)
      at shaded.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
      at shaded.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
      at shaded.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827)
      ... 26 more
      Caused by: java.lang.IllegalArgumentException: endpoint for [0] not configured for org.jclouds.googlecomputeengine.compute.functions.Resources.public abstract org.jclouds.googlecomputeengine.domain.Image org.jclouds.googlecomputeengine.compute.functions.Resources.image(java.net.URI)
      at shaded.com.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
      at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointInParametersOrNull(RestAnnotationProcessor.java:526)
      at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:548)
      at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:204)
      at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:137)
      at org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:188)
      at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:84)
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
      at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
      at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
      at com.sun.proxy.$Proxy109.image(Unknown Source)
      at org.jclouds.googlecomputeengine.compute.loaders.DiskURIToImage.load(DiskURIToImage.java:48)
      ... 35 more

        Attachments

          Activity

          Hide
          felfert Fritz Elfert added a comment -

          Which version, which jenkins version.

          Apart from that, I believe this is a limitation of jclouds - but I'm not 100% shure. I'd suggest to ask on the jclouds user list:
          https://lists.apache.org/list.html?user@jclouds.apache.org (i am subscribed to that list and chime in if necessary)

          -Fritz

          Show
          felfert Fritz Elfert added a comment - Which version, which jenkins version. Apart from that, I believe this is a limitation of jclouds - but I'm not 100% shure. I'd suggest to ask on the jclouds user list: https://lists.apache.org/list.html?user@jclouds.apache.org (i am subscribed to that list and chime in if necessary) -Fritz
          Hide
          wile Dhruv Parpia added a comment -

          Facing the same issue.

          Jenkins Version: 2.47
          Plugin Version: 2.14

          Verified that it works in a project without an instance created from a snapshot.

          Show
          wile Dhruv Parpia added a comment - Facing the same issue. Jenkins Version: 2.47 Plugin Version: 2.14 Verified that it works in a project without an instance created from a snapshot.
          Hide
          felfert Fritz Elfert added a comment -

          Same advice as before: Ask at the jclouds user list, if this is actually supposed to work.

          Show
          felfert Fritz Elfert added a comment - Same advice as before: Ask at the jclouds user list, if this is actually supposed to work.
          Hide
          tommywo Tomasz Wojtun added a comment - - edited

          This is now fixed in jclouds source, so we need to wait until new release. 

          If someone needs the fix sooner, you can build jclouds from 2.0.x branch, and then jclouds-plugin itself. 

          Show
          tommywo Tomasz Wojtun added a comment - - edited This is now fixed in jclouds source, so we need to wait until new release.  If someone needs the fix sooner, you can build jclouds from 2.0.x branch, and then jclouds-plugin itself. 
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Fritz Elfert
          Path:
          jclouds-plugin/pom.xml
          jclouds-plugin/src/findbugs/excludesFilter.xml
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java
          pom.xml
          http://jenkins-ci.org/commit/jclouds-plugin/e4dd1ebebf962d685a1f460e60f2e85db4aa4bfb
          Log:
          Fix JENKINS-42005

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fritz Elfert Path: jclouds-plugin/pom.xml jclouds-plugin/src/findbugs/excludesFilter.xml jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java pom.xml http://jenkins-ci.org/commit/jclouds-plugin/e4dd1ebebf962d685a1f460e60f2e85db4aa4bfb Log: Fix JENKINS-42005
          Hide
          felfert Fritz Elfert added a comment - - edited

          Instead of waiting for the next jclouds release (which could be quite some time considering that 2.0.1 just was released not long ago), I simply copied the four relevant source files into the plugin's sources and excluded them from the dependencies. This should fix the issue right now without the need for a custom jclouds build.
          Tomasz Wojtun: Please try the the latest artifact from ci.jenkins.io and report back here. If it works as expected, I will release the next version.

          Show
          felfert Fritz Elfert added a comment - - edited Instead of waiting for the next jclouds release (which could be quite some time considering that 2.0.1 just was released not long ago), I simply copied the four relevant source files into the plugin's sources and excluded them from the dependencies. This should fix the issue right now without the need for a custom jclouds build. Tomasz Wojtun : Please try the the latest artifact from ci.jenkins.io and report back here. If it works as expected, I will release the next version.
          Hide
          tommywo Tomasz Wojtun added a comment -

          Hi Fritz Elfert,

          It works as expected, but wouldn't it be better to keep modified jclouds code in jclouds-shaded module?

          Show
          tommywo Tomasz Wojtun added a comment - Hi  Fritz Elfert , It works as expected, but wouldn't it be better to keep modified jclouds code in jclouds-shaded module?
          Hide
          felfert Fritz Elfert added a comment -

          Not really. Exclusion of the existing classes (in order to avoid duplicate class files) is much easier this way.

          Show
          felfert Fritz Elfert added a comment - Not really. Exclusion of the existing classes (in order to avoid duplicate class files) is much easier this way.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Tomasz Wojtuń
          Path:
          jclouds-plugin/pom.xml
          jclouds-plugin/src/findbugs/excludesFilter.xml
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java
          jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java
          pom.xml
          http://jenkins-ci.org/commit/jclouds-plugin/5e1b1d6a8dfc2cef70cf14b622247e11379b5022
          Log:
          Revert "Fix JENKINS-42005"

          This reverts commit e4dd1ebebf962d685a1f460e60f2e85db4aa4bfb.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomasz Wojtuń Path: jclouds-plugin/pom.xml jclouds-plugin/src/findbugs/excludesFilter.xml jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/config/GoogleComputeEngineServiceContextModule.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceToNodeMetadata.java jclouds-plugin/src/main/java/org/jclouds/googlecomputeengine/compute/loaders/DiskURIToImage.java pom.xml http://jenkins-ci.org/commit/jclouds-plugin/5e1b1d6a8dfc2cef70cf14b622247e11379b5022 Log: Revert "Fix JENKINS-42005 " This reverts commit e4dd1ebebf962d685a1f460e60f2e85db4aa4bfb.
          Hide
          gagseba1 Sebastien Gagnon added a comment -

          Hi guy's

          Any news to fix this issue in a new release ?

          Thanks

          Show
          gagseba1 Sebastien Gagnon added a comment - Hi guy's Any news to fix this issue in a new release ? Thanks

            People

            Assignee:
            felfert Fritz Elfert
            Reporter:
            tommywo Tomasz Wojtun
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: