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 from ConfigurationAsCode.handleExceptionOnReloading #2534

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Jul 18, 2024

Amending #2352. I deliberately attempted to load an invalid JCasC bundle. I got a ConfigurationAsCodeBootFailure as expected. But then periodically (perhaps in response to K8s liveness probes) I saw

WARNING	o.e.j.s.h.ContextHandler$Context#log: Error while serving …/oops
java.lang.NullPointerException: Cannot invoke "javax.servlet.RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)" because the return value of "org.kohsuke.stapler.StaplerRequest.getView(java.lang.Class, String)" is null
	at PluginClassLoader for configuration-as-code//io.jenkins.plugins.casc.ConfigurationAsCode.handleExceptionOnReloading(ConfigurationAsCode.java:207)
	at PluginClassLoader for configuration-as-code//io.jenkins.plugins.casc.ConfigurationAsCodeBootFailure.doDynamic(ConfigurationAsCodeBootFailure.java:17)

I am not sure exactly why the facet could not be looked up, but it is better to just stick with the 503 response and not throw an exception.

@jglick jglick requested a review from a team as a code owner July 18, 2024 20:34
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@timja timja added the bug label Jul 18, 2024
@timja timja merged commit ccda4a1 into jenkinsci:master Jul 18, 2024
18 checks passed
@jglick jglick deleted the handleExceptionOnReloading branch July 18, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants