[JIRA] [core] (JENKINS-21132) Stapler returns 200 OK for an internal server error instead of 500

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] [core] (JENKINS-21132) Stapler returns 200 OK for an internal server error instead of 500

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 23/Dec/13 12:55 PM
Description:

Install Build Monitor Plugin as it will make triggering the error easier: https://wiki.jenkins-ci.org/display/JENKINS/Build+Monitor+Plugin

To replicate the problem first make Jenkins throw a NullPointerException.
On Jenkins 1.480 this can be easily done by triggering JENKINS-15309 (https://issues.jenkins-ci.org/browse/JENKINS-15309)

  • create a new Build Monitor view and add some jobs to it. Shut down Jenkins.
  • edit the config.xml file and make sure that instead of <jobNames class="tree-set"> you have <jobNames> (no class specified) as this will cause an unhandled NullPointerException
  • start up Jenkins and navigate to the Build Monitor view tab
  • open Google Chrome developer console, go to Network Tab and view the response returned by Jenkins to a fetchJobViews request. It will be something like the following:

HEADERS:
Request URL:http://localhost:8080/$stapler/bound/c9717585-a435-44f6-84fc-732ac9460461/fetchJobViews
Request Method:POST
Status Code:200 OK
Request Headersview source

BODY:
cause: null
localizedMessage: ""
message: ""
stackTrace: [{className:java.util.TreeSet, fileName:TreeSet.java, lineNumber:154, methodName:<init>,…},…]

Please note the "200 OK" part. If there is an internal server error, Jenkins should never return a 200 OK, but something more appropriate such as 500.
Returning a correct HTTP error code will make it easier for plugin developers to correctly react the the problem.

Environment: Jenkins 1.480 and 1.539
Mac OsX Maverics
Google Chrome
Project: Jenkins
Labels: jenkins exception nullpointer stapler api
Priority: Major Major
Reporter: Jan Molak
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

[JIRA] [core] (JENKINS-21132) Stapler returns 200 OK instead of 500 when an internal server error happens

JIRA noreply@jenkins-ci.org
Change By: Jan Molak (23/Dec/13 4:44 PM)
Summary: Stapler returns 200 OK  for  instead of 500 when  an internal server error  instead of 500  happens
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.