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

Simple Theme Plugin causes Jenkins to hang on Configure screen in "LOADING" state

      When the Simple Theme Plugin is installed, configure pages for both jobs and Jenkins itself hang at the "LOADING" overlay (as seen in https://issues.jenkins-ci.org/browse/JENKINS-16165). Furthermore, configurations cannot be saved, as hitting the "save" button with the plugin installed will result in a "HTTP ERROR 400" page (see second attachment).

        1. bug.png
          bug.png
          129 kB
        2. bug2.png
          bug2.png
          20 kB

          [JENKINS-26378] Simple Theme Plugin causes Jenkins to hang on Configure screen in "LOADING" state

          Daniel Beck added a comment -

          There should be an issue reported in the browser's script console if that happens.

          Daniel Beck added a comment - There should be an issue reported in the browser's script console if that happens.

          Daniel Beck added a comment -

          Please also provide the custom JavaScript you're injecting into Jenkins with the Simple Theme plugin.

          Daniel Beck added a comment - Please also provide the custom JavaScript you're injecting into Jenkins with the Simple Theme plugin.

          Nick Hovaker added a comment -

          Of course.
          The console on Firefox throws me the error "ReferenceError: RumID is not defined". Also, the CSS that the plugin uses by default appears to be https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js.
          However, I am unable to change it, as that would require saving my settings, which will result in a "HTTP ERROR 400" page (attachment 2).

          Nick Hovaker added a comment - Of course. The console on Firefox throws me the error "ReferenceError: RumID is not defined". Also, the CSS that the plugin uses by default appears to be https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js . However, I am unable to change it, as that would require saving my settings, which will result in a "HTTP ERROR 400" page (attachment 2).

          Daniel Beck added a comment -

          Do you recognize that URL/hostname? Is that your box?

          To clarify, when you disable Simple Theme plugin (and nothing else), things magically work again after a Jenkins restart? There were no other updates or anything else?

          I'm asking because there is no such thing as a default script for Simple Theme Plugin. In fact, the plugin barely does anything.

          The complete source code of the plugin is the following (even if you know nothing about Jenkins' internal API, this will show you how little this plugin does):

          Daniel Beck added a comment - Do you recognize that URL/hostname? Is that your box? To clarify, when you disable Simple Theme plugin (and nothing else), things magically work again after a Jenkins restart? There were no other updates or anything else? I'm asking because there is no such thing as a default script for Simple Theme Plugin. In fact, the plugin barely does anything. The complete source code of the plugin is the following (even if you know nothing about Jenkins' internal API, this will show you how little this plugin does): Behavior: Store and retrieve configured URLs for CSS and JS: https://github.com/jenkinsci/simple-theme-plugin/blob/master/src/main/java/org/codefirst/SimpleThemeDecorator.java The config form snippet for entering the JS and CSS URLs: https://github.com/jenkinsci/simple-theme-plugin/blob/master/src/main/resources/org/codefirst/SimpleThemeDecorator/global.jelly Injecting custom JS/CSS from URLs if defined in global config into every page: https://github.com/jenkinsci/simple-theme-plugin/blob/master/src/main/resources/org/codefirst/SimpleThemeDecorator/header.jelly

          Nick Hovaker added a comment -

          >Do you recognize that URL/hostname? Is that your box?
          No, I don't recognize the host "ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com". I would change it, but I have no way to save the settings on the configure page.

          >To clarify, when you disable Simple Theme plugin (and nothing else), things magically work again after a Jenkins restart? There were no other updates or anything else?
          Correct, once I disable Simple Theme Plugin, things magically work after Jenkins restarts

          Nick Hovaker added a comment - >Do you recognize that URL/hostname? Is that your box? No, I don't recognize the host "ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com". I would change it, but I have no way to save the settings on the configure page. >To clarify, when you disable Simple Theme plugin (and nothing else), things magically work again after a Jenkins restart? There were no other updates or anything else? Correct, once I disable Simple Theme Plugin, things magically work after Jenkins restarts

          Daniel Beck added a comment -

          What's the content of org.codefirst.SimpleThemeDecorator.xml in JENKINS_HOME?

          If URLs/paths are defined, please provide the content of the files at those URLs (relative paths are relative from Jenkins URL).

          Daniel Beck added a comment - What's the content of org.codefirst.SimpleThemeDecorator.xml in JENKINS_HOME? If URLs/paths are defined, please provide the content of the files at those URLs (relative paths are relative from Jenkins URL).

          Nick Hovaker added a comment -

          The output of /var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml is as follows:

          <?xml version='1.0' encoding='UTF-8'?>
          <org.codefirst.SimpleThemeDecorator plugin="simple-theme-plugin@0.3">
          <cssUrl></cssUrl>
          <jsUrl>https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js</jsUrl>
          </org.codefirst.SimpleThemeDecorator>

          Upon reading this, I removed "https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js" from line 4 and was able to save my configuration. Still not sure why that was included by default.

          Nick Hovaker added a comment - The output of /var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml is as follows: <?xml version='1.0' encoding='UTF-8'?> <org.codefirst.SimpleThemeDecorator plugin="simple-theme-plugin@0.3"> <cssUrl></cssUrl> <jsUrl> https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js </jsUrl> </org.codefirst.SimpleThemeDecorator> Upon reading this, I removed "https://ec01c392919812c4f818-79afe539d963810002081e6e2a51e67e.ssl.cf2.rackcdn.com/Embed.js" from line 4 and was able to save my configuration. Still not sure why that was included by default.

          Daniel Beck added a comment -

          Not a defect, there is no such default.

          Either you installed Jenkins from a different source than jenkins-ci.org, that came with plugins and options preinstalled; or you or one of the other admins of your instance added this configuration some time in the past.

          Daniel Beck added a comment - Not a defect, there is no such default. Either you installed Jenkins from a different source than jenkins-ci.org, that came with plugins and options preinstalled; or you or one of the other admins of your instance added this configuration some time in the past.

          Mark Chance added a comment -

          I had a similar problem - with the plugin installed and my skinning JavaScript, the "Loading..." never went away. I think it has to do with event handlers, etc. Try this in your Javascript:

          function myFunction() {
            // the stuff you want to do.
          }
          var body = document.getElementsByTagName('body');
          if (window.addEventListener) {
            window.addEventListener('load', myFunction, false);
          }
          else if (window.attachEvent) {
            window.attachEvent('onload', myFunction );
          }
          

          Then it works fine. I didn't run into the other issues.

          Mark Chance added a comment - I had a similar problem - with the plugin installed and my skinning JavaScript, the "Loading..." never went away. I think it has to do with event handlers, etc. Try this in your Javascript: function myFunction() { // the stuff you want to do. } var body = document.getElementsByTagName('body'); if (window.addEventListener) { window.addEventListener('load', myFunction, false); } else if (window.attachEvent) { window.attachEvent('onload', myFunction ); } Then it works fine. I didn't run into the other issues.

            Unassigned Unassigned
            urras Nick Hovaker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: