Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on pipeline generateSnippet #190

Open
chcg opened this issue Dec 2, 2024 · 0 comments · May be fixed by #192
Open

NPE on pipeline generateSnippet #190

chcg opened this issue Dec 2, 2024 · 0 comments · May be fixed by #192

Comments

@chcg
Copy link

chcg commented Dec 2, 2024

Jenkins and plugins versions report

Environment

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

Use <jenkins_server>/pipeline-syntax for Junit and JiraTestResultReporter without a dedicated jenkins job

Expected Results

No NPE

Actual Results

Error while serving <jenkins_server>/pipeline-syntax/generateSnippet
java.lang.NullPointerException: Cannot invoke "hudson.model.Job.getFullName()" because "job" is null
at PluginClassLoader for JiraTestResultReporter//org.jenkinsci.plugins.JiraTestResultReporter.TestToIssueMapping.register(TestToIssueMapping.java:168)
at PluginClassLoader for JiraTestResultReporter//org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher.(JiraTestDataPublisher.java:231)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:673)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:990)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:861)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:620)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:615)
at hudson.model.Descriptor.bindJSON(Descriptor.java:657)
at hudson.model.Descriptor.newInstanceImpl(Descriptor.java:615)
Caused: java.lang.LinkageError: Failed to instantiate class org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher from {"stapler-class":"org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher","$class":"org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher","projectKey":"","issueType":"","autoRaiseIssue":false,"autoResolveIssue":false,"autoUnlinkIssue":false,"additionalAttachments":false,"manualAddIssue":false,"configs":[{"stapler-class":"org.jenkinsci.plugins.JiraTestResultReporter.config.StringFields","$class":"org.jenkinsci.plugins.JiraTestResultReporter.config.StringFields","fieldKey":"summary","value":"${DEFAULT_SUMMARY}"},{"stapler-class":"org.jenkinsci.plugins.JiraTestResultReporter.config.StringFields","$class":"org.jenkinsci.plugins.JiraTestResultReporter.config.StringFields","fieldKey":"description","value":"${DEFAULT_DESCRIPTION}"}]}
at hudson.model.Descriptor.newInstanceImpl(Descriptor.java:621)
at hudson.model.Descriptor.newInstance(Descriptor.java:599)
at PluginClassLoader for JiraTestResultReporter//org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.newInstance(JiraTestDataPublisher.java:663)
at PluginClassLoader for JiraTestResultReporter//org.jenkinsci.plugins.JiraTestResultReporter.JiraTestDataPublisher$JiraTestDataPublisherDescriptor.newInstance(JiraTestDataPublisher.java:438)
at hudson.model.Descriptor.newInstance(Descriptor.java:587)
at hudson.model.Descriptor$NewInstanceBindInterceptor.instantiate(Descriptor.java:704)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:955)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:861)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:904)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:620)
at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:1046)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:990)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:861)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:620)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:615)
at hudson.model.Descriptor.bindJSON(Descriptor.java:657)
at hudson.model.Descriptor.newInstanceImpl(Descriptor.java:615)
at hudson.model.Descriptor.newInstance(Descriptor.java:599)
at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.Snippetizer.doGenerateSnippet(Snippetizer.java:498)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:484)
Caused: java.lang.reflect.InvocationTargetException
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:488)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:497)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:218)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
at org.kohsuke.stapler.MetaClass$12.doDispatch(MetaClass.java:686)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:61)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:800)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:938)
at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:590)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:800)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:938)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:721)
at org.kohsuke.stapler.Stapler.service(Stapler.java:253)
at Jenkins Main ClassLoader//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHolder.handle(ServletHolder.java:765)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1668)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:204)
at jenkins.util.HttpServletFilter$1.doFilter(HttpServletFilter.java:77)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:201)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:207)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at jenkins.ErrorAttributeFilter.doFilter(ErrorAttributeFilter.java:29)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:94)
at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:110)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:101)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:98)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:117)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
at hudson.security.ChainedServletFilter2$1.doFilter(ChainedServletFilter2.java:99)
at hudson.security.ChainedServletFilter2.doFilter(ChainedServletFilter2.java:111)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:173)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at org.kohsuke.stapler.UncaughtExceptionFilter.doFilter(UncaughtExceptionFilter.java:26)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:31)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler.doHandle(ServletHandler.java:526)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:127)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.security.SecurityHandler.handle(SecurityHandler.java:574)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.HandlerWrapper.handle(HandlerWrapper.java:124)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:197)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.SessionHandler.doHandle(SessionHandler.java:609)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:195)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ContextHandler.doHandle(ContextHandler.java:1035)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:164)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.servlet.ServletHandler.doScope(ServletHandler.java:483)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:162)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.SessionHandler.doScope(SessionHandler.java:586)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:162)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ContextHandler.doScope(ContextHandler.java:956)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:125)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ContextHandler.handle(ContextHandler.java:1694)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1576)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.HttpChannel.dispatch(HttpChannel.java:738)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.HttpChannel.handle(HttpChannel.java:511)
at Jenkins Main ClassLoader//org.eclipse.jetty.ee9.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2862)
at Jenkins Main ClassLoader//org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
at Jenkins Main ClassLoader//org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:597)
at Jenkins Main ClassLoader//org.eclipse.jetty.server.Server.handle(Server.java:181)
at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:661)
at Jenkins Main ClassLoader//org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:406)
at Jenkins Main ClassLoader//org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
at Jenkins Main ClassLoader//org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at Jenkins Main ClassLoader//org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
at Jenkins Main ClassLoader//org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
at java.base/java.lang.Thread.run(Thread.java:840)

Anything else?

No response

Are you interested in contributing a fix?

No response

@chcg chcg changed the title NPE on NPE on pipeline generateSnippet Dec 2, 2024
@chcg chcg linked a pull request Dec 2, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant