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

NPE on Virtual Machine Size when selecting Azure template

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: azure-vm-agents-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.50 in Tomcat 8.5
      CentOS 7.3
      jdk1.8.0_121
      Azure VM Agents 0.4.3
      Azure Credentials 1.0
    • Similar Issues:

      Description

      When in the Manage Jenkins -> Configure System page trying to add a VM template to an existing Azure cloud (no templates added yet). Exception page is displayed right below the Virtual Machine Size field showing this stack trace:

      java.lang.NullPointerException
          at com.microsoft.azure.vmagent.AzureVMAgentTemplate$DescriptorImpl.doFillVirtualMachineSizeItems(AzureVMAgentTemplate.java:506)
          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:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          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 jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
          at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          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:93)
          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:76)
          at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:589)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
          at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

          Hide
          clguiman Claudiu Guiman added a comment -

          Did you pick a service principal for your cloud? (Azure Credentials)

          Show
          clguiman Claudiu Guiman added a comment - Did you pick a service principal for your cloud? (Azure Credentials)
          Hide
          node54 Corey Groves added a comment -

          Yes, I picked a service principle and verified it using the Verify Configuration button before clicking on Add.

          Show
          node54 Corey Groves added a comment - Yes, I picked a service principle and verified it using the Verify Configuration button before clicking on Add.
          Hide
          clguiman Claudiu Guiman added a comment -

          Is this blocking you or you managed to go over the NPE and select a VM size?

          Show
          clguiman Claudiu Guiman added a comment - Is this blocking you or you managed to go over the NPE and select a VM size?
          Hide
          node54 Corey Groves added a comment - - edited

          If I ignore the error and fill out the other fields then save the configuration, when I return to the setup screen it populates the Virtual Machine Size list with no error. But the error occurs every time when clicking on the Add button for a new template for the first time. With this workaround it is no longer a blocker for us.

          Show
          node54 Corey Groves added a comment - - edited If I ignore the error and fill out the other fields then save the configuration, when I return to the setup screen it populates the Virtual Machine Size list with no error. But the error occurs every time when clicking on the Add button for a new template for the first time. With this workaround it is no longer a blocker for us.
          Hide
          clguiman Claudiu Guiman added a comment -

          Have you selected the desired region before selecting the VM size? From the exception call stack it looks like the region was null.

          Show
          clguiman Claudiu Guiman added a comment - Have you selected the desired region before selecting the VM size? From the exception call stack it looks like the region was null.
          Hide
          node54 Corey Groves added a comment -

          The exception occurs when the Add Azure Virtual Machine Template section is loading, I don't have a chance to pick anything before the error occurs.

          Show
          node54 Corey Groves added a comment - The exception occurs when the Add Azure Virtual Machine Template section is loading, I don't have a chance to pick anything before the error occurs.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Claudiu Guiman
          Path:
          src/main/java/com/microsoft/azure/vmagent/AzureVMAgentTemplate.java
          src/main/java/com/microsoft/azure/vmagent/AzureVMManagementServiceDelegate.java
          http://jenkins-ci.org/commit/azure-vm-agents-plugin/6dd8a285a699a097ffa264698a3a606ce94ad250
          Log:
          Provide default vm size list when the region was not yet selected [FIXED JENKINS-42853]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Claudiu Guiman Path: src/main/java/com/microsoft/azure/vmagent/AzureVMAgentTemplate.java src/main/java/com/microsoft/azure/vmagent/AzureVMManagementServiceDelegate.java http://jenkins-ci.org/commit/azure-vm-agents-plugin/6dd8a285a699a097ffa264698a3a606ce94ad250 Log: Provide default vm size list when the region was not yet selected [FIXED JENKINS-42853]
          Hide
          clguiman Claudiu Guiman added a comment -

          Fixed in 0.4.4

          Show
          clguiman Claudiu Guiman added a comment - Fixed in 0.4.4

            People

            • Assignee:
              clguiman Claudiu Guiman
              Reporter:
              node54 Corey Groves
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: