Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1463

MachineTypeToHardware throws exception when region has no available zone

    XMLWordPrintableJSON

Details

    Description

      This broke our Jenkins server that uses jclouds-plugin, it can no longer create slave machines in GCE.

      Google is returning the region asia-east2 without zones.

       

      Stacktrace:

      java.lang.IllegalStateException: zone https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-east2-c not present in [https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-east1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-east1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-east1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-northeast1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-northeast1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-northeast1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-south1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-south1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-south1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-southeast1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-southeast1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/asia-southeast1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/australia-southeast1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/australia-southeast1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/australia-southeast1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-north1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-north1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-north1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west1-d, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west2-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west2-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west2-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west3-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west3-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west3-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west4-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west4-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/europe-west4-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/northamerica-northeast1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/northamerica-northeast1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/northamerica-northeast1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/southamerica-east1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/southamerica-east1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/southamerica-east1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-central1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-central1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-central1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-central1-f, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east1-d, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east4-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east4-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-east4-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west1-a, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west1-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west1-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west2-c, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west2-b, https://www.googleapis.com/compute/v1/projects/jenkins-170800/zones/us-west2-a]
      	at org.jclouds.googlecomputeengine.compute.functions.MachineTypeToHardware.apply(MachineTypeToHardware.java:55)
      	at org.jclouds.googlecomputeengine.compute.functions.MachineTypeToHardware.apply(MachineTypeToHardware.java:39)
      	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.ImmutableCollection$Builder.addAll(ImmutableCollection.java:300)
      	at shaded.com.google.common.collect.ImmutableSet$Builder.addAll(ImmutableSet.java:522)
      	at shaded.com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:321)
      	at shaded.com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:300)
      	at shaded.com.google.common.collect.FluentIterable.toSet(FluentIterable.java:358)
      	at org.jclouds.compute.config.ComputeServiceAdapterContextModule.transformGuardingNull(ComputeServiceAdapterContextModule.java:111)
      	at org.jclouds.compute.config.ComputeServiceAdapterContextModule.access$000(ComputeServiceAdapterContextModule.java:52)
      	at org.jclouds.compute.config.ComputeServiceAdapterContextModule$1.get(ComputeServiceAdapterContextModule.java:101)
      	at org.jclouds.compute.config.ComputeServiceAdapterContextModule$1.get(ComputeServiceAdapterContextModule.java:98)
      	at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
      	at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
      	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 org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:150)
      	at org.jclouds.googlecomputeengine.compute.config.GoogleComputeEngineServiceContextModule$12.get(GoogleComputeEngineServiceContextModule.java:160)
      	at org.jclouds.googlecomputeengine.compute.config.GoogleComputeEngineServiceContextModule$12.get(GoogleComputeEngineServiceContextModule.java:157)
      	at shaded.com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Suppliers.java:192)
      	at org.jclouds.googlecomputeengine.compute.functions.InstanceToNodeMetadata.apply(InstanceToNodeMetadata.java:84)
      	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.doProvision(JCloudsCloud.java:467)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      Caused: javax.servlet.ServletException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:765)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:138)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:92)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	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)

      Attachments

        1. Compute_Engine_-_Google_Cloud_Platform.jpg
          181 kB
          Aurelijus Valeisa
        2. Compute_Engine_-_Google_Cloud_Platform2.jpg
          83 kB
          Aurelijus Valeisa

        Activity

          People

            Unassigned Unassigned
            felipems Felipe Matos Santana
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: