• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Jenkins 1.509.4
      Jenkins 1.532.1 RC1
      Firefox 17.0.10 ESR

      The error screens shown for invalid configurations after pressing 'Apply' don't work.

      Steps to reproduce:
      0. Install Jenkins Enterprise with Cloudbees Template Plugin 4.1
      1. Create a job template
      3. Clear the 'name' attribute's ID field
      4. Press 'Apply'

      Expected result: Error message shown
      Actual result: Huge, empty dialog with title 'Error' shown (error screen seems to appear, but is immediately removed)

          [JENKINS-20772] 'Apply' error screens don't work

          Daniel Beck added a comment -

          There are several issues about the errors that (don't) appear in response to some action (JENKINS-17401, JENKINS-13287, JENKINS-19037, possibly others) but none seem to cover the problem that the error screen is completely useless because it doesn't show the error (e.g. stacktrace).

          Daniel Beck added a comment - There are several issues about the errors that (don't) appear in response to some action ( JENKINS-17401 , JENKINS-13287 , JENKINS-19037 , possibly others) but none seem to cover the problem that the error screen is completely useless because it doesn't show the error (e.g. stacktrace).

          This is also an issue if you rename it to anything other than the original namen and click the apply button.

          Steven Christou added a comment - This is also an issue if you rename it to anything other than the original namen and click the apply button.

          Daniel Beck added a comment -

          My apologies for the badly selected example. I tried to make it easy to reproduce, and failed to test what happens when pressing Save instead.

          Note that this is not about the exception with stacktrace presented when saving, but the fact that the dialog is completely useless as an error dialog.

          Daniel Beck added a comment - My apologies for the badly selected example. I tried to make it easy to reproduce, and failed to test what happens when pressing Save instead. Note that this is not about the exception with stacktrace presented when saving, but the fact that the dialog is completely useless as an error dialog.

          Jesse Glick added a comment -

          By the way the actual exception in this case is fixed in the 4.2 release of the Templates plugin.

          Jesse Glick added a comment - By the way the actual exception in this case is fixed in the 4.2 release of the Templates plugin.

          Jesse Glick added a comment - - edited

          The originally reported issue is actually a bug in the Templates plugin, and very similar to JENKINS-17401. Jenkins is sending a redirect and the Apply handler does not expect this. The fix is just to send a warning in that case, not a redirect. Update: actually there seems to be no such redirect in the Templates plugin, so that issue probably really is what is reported here: failure to display a stack trace.

          The more general issue is that if an exception is actually thrown, you get a blank error dialog. This is trivially reproduced (in Chrome at least) by configuring a freestyle project, checking Build periodically, and typing some junk into the Schedule field. In apply.js, the error-handling code using responseDialog is triggered, but it does not work.

          Jesse Glick added a comment - - edited The originally reported issue is actually a bug in the Templates plugin, and very similar to JENKINS-17401 . Jenkins is sending a redirect and the Apply handler does not expect this. The fix is just to send a warning in that case, not a redirect. Update: actually there seems to be no such redirect in the Templates plugin, so that issue probably really is what is reported here: failure to display a stack trace. The more general issue is that if an exception is actually thrown, you get a blank error dialog. This is trivially reproduced (in Chrome at least) by configuring a freestyle project, checking Build periodically , and typing some junk into the Schedule field. In apply.js , the error-handling code using responseDialog is triggered, but it does not work.

          Jesse Glick added a comment -

          Commenting out $(containerId).appendChild(target); fixes the problem to the extent that the error is shown in a new browser window. But then regular Apply button handling is broken.

          Jesse Glick added a comment - Commenting out $(containerId).appendChild(target); fixes the problem to the extent that the error is shown in a new browser window. But then regular Apply button handling is broken.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/Descriptor.java
          http://jenkins-ci.org/commit/jenkins/9f23c0bdb3a3ed6485e161ff5c57ebba64f88035
          Log:
          JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Descriptor.java http://jenkins-ci.org/commit/jenkins/9f23c0bdb3a3ed6485e161ff5c57ebba64f88035 Log: JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/0e8195c43d744b65e46ce5d66262e29fbdb9fb35
          Log:
          [FIXED JENKINS-20772] Properly render response in case Apply results in an error page.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/0e8195c43d744b65e46ce5d66262e29fbdb9fb35 Log: [FIXED JENKINS-20772] Properly render response in case Apply results in an error page.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/c7dcb99290548f82b39846f4db431ab2ceb326ae Log: JENKINS-17401 JENKINS-20772 Noting. Compare: https://github.com/jenkinsci/jenkins/compare/833c42326863...c7dcb9929054

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3133
          JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same. (Revision 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035)
          [FIXED JENKINS-20772] Properly render response in case Apply results in an error page. (Revision 0e8195c43d744b65e46ce5d66262e29fbdb9fb35)
          JENKINS-17401 JENKINS-20772 Noting. (Revision c7dcb99290548f82b39846f4db431ab2ceb326ae)

          Result = SUCCESS
          Jesse Glick : 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035
          Files :

          • core/src/main/java/hudson/model/Descriptor.java

          Jesse Glick : 0e8195c43d744b65e46ce5d66262e29fbdb9fb35
          Files :

          • core/src/main/resources/lib/form/apply/apply.js

          Jesse Glick : c7dcb99290548f82b39846f4db431ab2ceb326ae
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3133 JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same. (Revision 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035) [FIXED JENKINS-20772] Properly render response in case Apply results in an error page. (Revision 0e8195c43d744b65e46ce5d66262e29fbdb9fb35) JENKINS-17401 JENKINS-20772 Noting. (Revision c7dcb99290548f82b39846f4db431ab2ceb326ae) Result = SUCCESS Jesse Glick : 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035 Files : core/src/main/java/hudson/model/Descriptor.java Jesse Glick : 0e8195c43d744b65e46ce5d66262e29fbdb9fb35 Files : core/src/main/resources/lib/form/apply/apply.js Jesse Glick : c7dcb99290548f82b39846f4db431ab2ceb326ae Files : changelog.html

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/jenkins/model/Jenkins/oops.jelly
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/b856cc2434b33ed7fec3492223e141747369bba3
          Log:
          JENKINS-20772 Only show error message in dialog

          This change removes the superfluous UI elements around the error
          message if possible. Otherwise, fall back to existing behavior
          of adding entire page to iframe.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/jenkins/model/Jenkins/oops.jelly core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/b856cc2434b33ed7fec3492223e141747369bba3 Log: JENKINS-20772 Only show error message in dialog This change removes the superfluous UI elements around the error message if possible. Otherwise, fall back to existing behavior of adding entire page to iframe.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/resources/jenkins/model/Jenkins/oops.jelly
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/f8a73006e955a15ac8491301f8d2f0a6e8e4e17c
          Log:
          Merge pull request #1076 from daniel-beck/better-apply-dialog

          JENKINS-20772 Only show error message in dialog

          Compare: https://github.com/jenkinsci/jenkins/compare/28e403ac055f...f8a73006e955

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/jenkins/model/Jenkins/oops.jelly core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/f8a73006e955a15ac8491301f8d2f0a6e8e4e17c Log: Merge pull request #1076 from daniel-beck/better-apply-dialog JENKINS-20772 Only show error message in dialog Compare: https://github.com/jenkinsci/jenkins/compare/28e403ac055f...f8a73006e955

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/9b947ae8a239023482b8dcdec97d37425c42be8c
          Log:
          JENKINS-20772 Fix scrolling

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/9b947ae8a239023482b8dcdec97d37425c42be8c Log: JENKINS-20772 Fix scrolling

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/e292366f62e511323442a03abdcf020396cbc407
          Log:
          Merge pull request #1077 from daniel-beck/better-apply-dialog

          JENKINS-20772 Fix scrolling

          Compare: https://github.com/jenkinsci/jenkins/compare/f2e2cbeca421...e292366f62e5

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/e292366f62e511323442a03abdcf020396cbc407 Log: Merge pull request #1077 from daniel-beck/better-apply-dialog JENKINS-20772 Fix scrolling Compare: https://github.com/jenkinsci/jenkins/compare/f2e2cbeca421...e292366f62e5

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3135
          JENKINS-20772 Only show error message in dialog (Revision b856cc2434b33ed7fec3492223e141747369bba3)

          Result = SUCCESS
          daniel-beck : b856cc2434b33ed7fec3492223e141747369bba3
          Files :

          • core/src/main/resources/lib/form/apply/apply.js
          • core/src/main/resources/jenkins/model/Jenkins/oops.jelly

          dogfood added a comment - Integrated in jenkins_main_trunk #3135 JENKINS-20772 Only show error message in dialog (Revision b856cc2434b33ed7fec3492223e141747369bba3) Result = SUCCESS daniel-beck : b856cc2434b33ed7fec3492223e141747369bba3 Files : core/src/main/resources/lib/form/apply/apply.js core/src/main/resources/jenkins/model/Jenkins/oops.jelly

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3136
          JENKINS-20772 Fix scrolling (Revision 9b947ae8a239023482b8dcdec97d37425c42be8c)

          Result = SUCCESS
          daniel-beck : 9b947ae8a239023482b8dcdec97d37425c42be8c
          Files :

          • core/src/main/resources/lib/form/apply/apply.js

          dogfood added a comment - Integrated in jenkins_main_trunk #3136 JENKINS-20772 Fix scrolling (Revision 9b947ae8a239023482b8dcdec97d37425c42be8c) Result = SUCCESS daniel-beck : 9b947ae8a239023482b8dcdec97d37425c42be8c Files : core/src/main/resources/lib/form/apply/apply.js

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/Descriptor.java
          http://jenkins-ci.org/commit/jenkins/5d192634bb968190cb75cb752ed97474c57dc938
          Log:
          JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same.
          (cherry picked from commit 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Descriptor.java http://jenkins-ci.org/commit/jenkins/5d192634bb968190cb75cb752ed97474c57dc938 Log: JavaScript error when showing a FormException after Apply is clicked. Related to JENKINS-20772 but probably not the same. (cherry picked from commit 9f23c0bdb3a3ed6485e161ff5c57ebba64f88035)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/eec3d65cdf865bcd19edae15d0ca6e581553db78
          Log:
          [FIXED JENKINS-20772] Properly render response in case Apply results in an error page.
          (cherry picked from commit 0e8195c43d744b65e46ce5d66262e29fbdb9fb35)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/eec3d65cdf865bcd19edae15d0ca6e581553db78 Log: [FIXED JENKINS-20772] Properly render response in case Apply results in an error page. (cherry picked from commit 0e8195c43d744b65e46ce5d66262e29fbdb9fb35)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          http://jenkins-ci.org/commit/jenkins/de78db8d6ba0a4ca1b4b839ab9606cd151d446be
          Log:
          JENKINS-17401 JENKINS-20772 Noting.

          (cherry picked from commit c7dcb99290548f82b39846f4db431ab2ceb326ae)

          Conflicts:
          changelog.html

          Compare: https://github.com/jenkinsci/jenkins/compare/9144cec099bf...de78db8d6ba0

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: http://jenkins-ci.org/commit/jenkins/de78db8d6ba0a4ca1b4b839ab9606cd151d446be Log: JENKINS-17401 JENKINS-20772 Noting. (cherry picked from commit c7dcb99290548f82b39846f4db431ab2ceb326ae) Conflicts: changelog.html Compare: https://github.com/jenkinsci/jenkins/compare/9144cec099bf...de78db8d6ba0

          Daniel Beck added a comment -

          This wasn't backported completely to the 1.532.2 RC. My improvements are missing, so the error dialog cannot be scrolled and shows an entire Jenkins page with header, sidebar, and everything.

          Daniel Beck added a comment - This wasn't backported completely to the 1.532.2 RC. My improvements are missing, so the error dialog cannot be scrolled and shows an entire Jenkins page with header, sidebar, and everything.

          Jesse Glick added a comment -

          Right, but the most critical fix—showing something in the error dialog—was backported. I think we can live with that, unless the lack of scrolling is making it impossible to see error details. (See https://github.com/jglick/jenkins/compare/printStackTrace-JDK-6507809 for another angle on this.)

          Jesse Glick added a comment - Right, but the most critical fix—showing something in the error dialog—was backported. I think we can live with that, unless the lack of scrolling is making it impossible to see error details. (See https://github.com/jglick/jenkins/compare/printStackTrace-JDK-6507809 for another angle on this.)

          Daniel Beck added a comment -

          Exactly, scrolling is the problem here. Attached some screenshots. "unscrollable-framed" is how it's currently backported to 1.532.2-RC, "scrollable-plain" is how it was released in 1.546. Note the scroll bar It's basically useless on a ~19" screen with 1280x1024, and even the larger screen just adds more frames from servlet filters and winstone. You effectively only get the message of the first wrapped exception, which is probably much less useful than this example in many cases.

          Your inversion of stack traces looks really interesting as well and would make them much more accessible in general. For reference, program in comment to linked JDK issue (slightly modified to fit in one file) produces following output:

          $ java Throwable_printStackTrace
          Throwable_printStackTrace$LowLevelException
          	at Throwable_printStackTrace.e(Throwable_printStackTrace.java:31)
          	at Throwable_printStackTrace.d(Throwable_printStackTrace.java:28)
          	at Throwable_printStackTrace.c(Throwable_printStackTrace.java:22)
          Caused: Throwable_printStackTrace$MidLevelException
          	at Throwable_printStackTrace.c(Throwable_printStackTrace.java:24)
          	at Throwable_printStackTrace.b(Throwable_printStackTrace.java:18)
          	at Throwable_printStackTrace.a(Throwable_printStackTrace.java:12)
          Caused: Throwable_printStackTrace$HighLevelException
          	at Throwable_printStackTrace.a(Throwable_printStackTrace.java:14)
          	at Throwable_printStackTrace.main(Throwable_printStackTrace.java:5)
          

          Daniel Beck added a comment - Exactly, scrolling is the problem here. Attached some screenshots. "unscrollable-framed" is how it's currently backported to 1.532.2-RC, "scrollable-plain" is how it was released in 1.546. Note the scroll bar It's basically useless on a ~19" screen with 1280x1024, and even the larger screen just adds more frames from servlet filters and winstone. You effectively only get the message of the first wrapped exception, which is probably much less useful than this example in many cases. Your inversion of stack traces looks really interesting as well and would make them much more accessible in general. For reference, program in comment to linked JDK issue (slightly modified to fit in one file) produces following output: $ java Throwable_printStackTrace Throwable_printStackTrace$LowLevelException at Throwable_printStackTrace.e(Throwable_printStackTrace.java:31) at Throwable_printStackTrace.d(Throwable_printStackTrace.java:28) at Throwable_printStackTrace.c(Throwable_printStackTrace.java:22) Caused: Throwable_printStackTrace$MidLevelException at Throwable_printStackTrace.c(Throwable_printStackTrace.java:24) at Throwable_printStackTrace.b(Throwable_printStackTrace.java:18) at Throwable_printStackTrace.a(Throwable_printStackTrace.java:12) Caused: Throwable_printStackTrace$HighLevelException at Throwable_printStackTrace.a(Throwable_printStackTrace.java:14) at Throwable_printStackTrace.main(Throwable_printStackTrace.java:5)

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/jenkins/model/Jenkins/oops.jelly
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/fb738ea6de6bbcc7480705d53995cd8ec88e6f40
          Log:
          JENKINS-20772 Only show error message in dialog

          This change removes the superfluous UI elements around the error
          message if possible. Otherwise, fall back to existing behavior
          of adding entire page to iframe.

          (cherry picked from commit b856cc2434b33ed7fec3492223e141747369bba3)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/jenkins/model/Jenkins/oops.jelly core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/fb738ea6de6bbcc7480705d53995cd8ec88e6f40 Log: JENKINS-20772 Only show error message in dialog This change removes the superfluous UI elements around the error message if possible. Otherwise, fall back to existing behavior of adding entire page to iframe. (cherry picked from commit b856cc2434b33ed7fec3492223e141747369bba3)

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/lib/form/apply/apply.js
          http://jenkins-ci.org/commit/jenkins/7b9b7ac162d9ae5acbb313d08b69a8f71ab08804
          Log:
          JENKINS-20772 Fix scrolling

          (cherry picked from commit 9b947ae8a239023482b8dcdec97d37425c42be8c)

          Compare: https://github.com/jenkinsci/jenkins/compare/867a35523c2f...7b9b7ac162d9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/lib/form/apply/apply.js http://jenkins-ci.org/commit/jenkins/7b9b7ac162d9ae5acbb313d08b69a8f71ab08804 Log: JENKINS-20772 Fix scrolling (cherry picked from commit 9b947ae8a239023482b8dcdec97d37425c42be8c) Compare: https://github.com/jenkinsci/jenkins/compare/867a35523c2f...7b9b7ac162d9

          Code changed in jenkins
          User: Jesse Glick
          Path:
          war/src/main/webapp/scripts/hudson-behavior.js
          http://jenkins-ci.org/commit/jenkins/9620057a58dc07b52752683a433e200f36d4317d
          Log:
          When a server error is caught by applyErrorMessage (“ERROR” link), do not render the whole oops.jelly page.
          Just pick out the <div id="error-description"> from JENKINS-20772.

          Compare: https://github.com/jenkinsci/jenkins/compare/7ddc6be48716...9620057a58dc

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: war/src/main/webapp/scripts/hudson-behavior.js http://jenkins-ci.org/commit/jenkins/9620057a58dc07b52752683a433e200f36d4317d Log: When a server error is caught by applyErrorMessage (“ERROR” link), do not render the whole oops.jelly page. Just pick out the <div id="error-description"> from JENKINS-20772 . Compare: https://github.com/jenkinsci/jenkins/compare/7ddc6be48716...9620057a58dc

            jglick Jesse Glick
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: