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

Dashboard web pages don't render correctly in Chrome because of bad cache/session

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      After using Chrome for a day, the page renders incorrectly.

      Screenshot: http://imgur.com/9Y11bqz

      It doesn't matter if I hit refresh multiple times, it always renders the same way. If I open another browser, it works fine.

      If I debug under Chrome Dev Tools, I don't see any errors when fetching the resources... just a whole bunch of 304s.

      If I clear the cache manually using the Chrome Web settings, then everything works fine again.

      I went to #jenkins on freenode and apparently other people were having the same issue.

      *Update* I can make the error go away by simply clearing the jenkins cookie and leaving the rest of the cache intact. It seems the error is session related (all the cookie contains is a session id).

      I am using the GitHub plugin for authentication/authorization.

        1. css_issue
          238 kB
        2. css_issue.jpg
          css_issue.jpg
          238 kB
        3. jenkins_broken_stylesheet.png
          jenkins_broken_stylesheet.png
          129 kB
        4. jenkins_css_3.PNG
          jenkins_css_3.PNG
          84 kB
        5. jenkins-chrome-scroll.JPG
          jenkins-chrome-scroll.JPG
          104 kB
        6. jenkins-gui.png
          jenkins-gui.png
          69 kB

          [JENKINS-17684] Dashboard web pages don't render correctly in Chrome because of bad cache/session

          If anyone else sees a similar issue, please attach your screenshots as well.

          http://imgur.com/9Y11bqz has no table borders, which indicates that style.css isn't kicking in. The chrome dev output indicates that Jenkins had sent 304 without content, which then makes me wonder what Chrome thinks it has in its cache.

          One would think somehow the cache gets poluted, and Chrome isn't even noticing that because the server keeps sending 304 to the client.

          Kohsuke Kawaguchi added a comment - If anyone else sees a similar issue, please attach your screenshots as well. http://imgur.com/9Y11bqz has no table borders, which indicates that style.css isn't kicking in. The chrome dev output indicates that Jenkins had sent 304 without content, which then makes me wonder what Chrome thinks it has in its cache. One would think somehow the cache gets poluted, and Chrome isn't even noticing that because the server keeps sending 304 to the client.

          Same problem here with Google Chrome, Version 26.0.1410.64 m under Windows 7, 64-bit.

          Can't enforce the bug, but it happens quite regularly after automatic refresh ran in the background for a while. Agree that it looks like a problem with CSS. Maybe a bug of Chrome, not necessarily Jenkins.

          Lars Rosenboom added a comment - Same problem here with Google Chrome, Version 26.0.1410.64 m under Windows 7, 64-bit. Can't enforce the bug, but it happens quite regularly after automatic refresh ran in the background for a while. Agree that it looks like a problem with CSS. Maybe a bug of Chrome, not necessarily Jenkins.

          Ragi Burhum added a comment -

          I can get it to happen without having automatic refresh for awhile. After the site goes into a bad state, it remain so.

          I was also told (in IRC) to look at the contents of screen.css. I don't see any screen.css file though.

          *I found something interesting though*. If I delete the jenkins cookie and open the page again, the page starts working again. The cookie contains the session value, so it seems that the error is related to a session id expiring. I am using the GitHub plugin for authentication/authorization.

          Ragi Burhum added a comment - I can get it to happen without having automatic refresh for awhile. After the site goes into a bad state, it remain so. I was also told (in IRC) to look at the contents of screen.css. I don't see any screen.css file though. * I found something interesting though *. If I delete the jenkins cookie and open the page again, the page starts working again. The cookie contains the session value, so it seems that the error is related to a session id expiring. I am using the GitHub plugin for authentication/authorization.

          Ragi Burhum added a comment -

          I am going to update the main bug description to account for this.

          Ragi Burhum added a comment - I am going to update the main bug description to account for this.

          kutzi added a comment -

          Seeing something similar quite frequently (Jenkins ver. 1.480.2, Chrome Version 26.0.1410.64)
          I can resolve it by forcing a full reload (CTRL+SHIFT+R)

          kutzi added a comment - Seeing something similar quite frequently (Jenkins ver. 1.480.2, Chrome Version 26.0.1410.64) I can resolve it by forcing a full reload (CTRL+SHIFT+R)

          Seeing the same problem here on Jenkins v1.512 + Chrome 26.0.1410.43-r189671, ctrl-shift-r works around the issue.
          Might be related to JENKINS-17526?

          Michael Prokop added a comment - Seeing the same problem here on Jenkins v1.512 + Chrome 26.0.1410.43-r189671, ctrl-shift-r works around the issue. Might be related to JENKINS-17526 ?

          Ragi Burhum added a comment -

          To clarify:

          • hitting 'refresh' does not fix it.
          • Command-R ('regular' refresh), does not fix it.
          • Command-Shift-R (refresh & ignore cache) temporarily makes the problem go away. It comes back after some time (less than a day).

          It does look like it is similar to JENKINS-17526

          Ragi Burhum added a comment - To clarify: hitting 'refresh' does not fix it. Command-R ('regular' refresh), does not fix it. Command-Shift-R (refresh & ignore cache) temporarily makes the problem go away. It comes back after some time (less than a day). It does look like it is similar to JENKINS-17526

          Chris Z added a comment -

          Same issue for me, jenkins 1.512 Chrome 26.0.1410.64 m, Win 7 64bit. Usually I use ctrl + F5 which clears cache for web page and helps. Offtop: Chrome have now new feature for cleaning cache you can check http://stackoverflow.com/questions/12633425/chrome-browser-reload-options-new-feature

          Chris Z added a comment - Same issue for me, jenkins 1.512 Chrome 26.0.1410.64 m, Win 7 64bit. Usually I use ctrl + F5 which clears cache for web page and helps. Offtop: Chrome have now new feature for cleaning cache you can check http://stackoverflow.com/questions/12633425/chrome-browser-reload-options-new-feature

          Justin Patrin added a comment -

          I'm having the same problem with jira v5.2.8#851-sha1:3262fdc with Chrome 26.0.1410.65 on Max OSX 10.7.5. If I hold Option while clicking refresh, it gets fixed for a short time.

          Justin Patrin added a comment - I'm having the same problem with jira v5.2.8#851-sha1:3262fdc with Chrome 26.0.1410.65 on Max OSX 10.7.5. If I hold Option while clicking refresh, it gets fixed for a short time.

          Ken Garland added a comment -

          15:51:06 <+rpetti> IMO, just assign it to kohsuke

          Ken Garland added a comment - 15:51:06 <+rpetti> IMO, just assign it to kohsuke

          mbarczak added a comment -

          Same problem here : Chrome 26 , Jenkins 1.489 . Ctrl+Shift+R fixes problem for a while

          mbarczak added a comment - Same problem here : Chrome 26 , Jenkins 1.489 . Ctrl+Shift+R fixes problem for a while

          Vlad Aginsky added a comment - - edited

          this is how it looks for me at chrome Version 26.0.1410.64 m(attached jenkins-gui.png)

          Vlad Aginsky added a comment - - edited this is how it looks for me at chrome Version 26.0.1410.64 m(attached jenkins-gui.png)

          Kevin Cross added a comment -

          Seeing the same issue with Jenkins 1.509.1 running as a native package on CentOS release 6.4. Ctrl-shift-R seems to fix the issue. Attaching jenkins_css_3.PNG. Chrome Version 26.0.1410.64 m.

          Kevin Cross added a comment - Seeing the same issue with Jenkins 1.509.1 running as a native package on CentOS release 6.4. Ctrl-shift-R seems to fix the issue. Attaching jenkins_css_3.PNG. Chrome Version 26.0.1410.64 m.

          I think that a problem may be sending content-type header when http response is 304 in winstone.
          Looking a capture http://imgur.com/9Y11bqz, css files are interpreted as 'text/html', but should be 'text/css'.

          According to RFC, the 304 response should not include non-releated header.

          If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers.

          For example, Plack ( which is web app framework by Perl ) excludes Content-Type / Content-Length / Content-Disposition headers.

          So, I fix a source code to exclude content-type when 304, and trying it in my using Jenkins server.

          If no problem for a week, I'll send a pull request this.
          Currently, content-type header is normal and no problem occurs for three days.

          It's ok that you fix in main repository source code before sending my pull request.
          At which time, consider about other headers (Content-length, content-disposition, and so on), please.

          Tomonari Nakamura added a comment - I think that a problem may be sending content-type header when http response is 304 in winstone. Looking a capture http://imgur.com/9Y11bqz , css files are interpreted as 'text/html', but should be 'text/css'. According to RFC , the 304 response should not include non-releated header. If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. For example, Plack ( which is web app framework by Perl ) excludes Content-Type / Content-Length / Content-Disposition headers. https://metacpan.org/source/MIYAGAWA/Plack-1.0024/lib/Plack/Middleware/ConditionalGET.pm#L19 So, I fix a source code to exclude content-type when 304, and trying it in my using Jenkins server. https://github.com/ikikko/winstone/commit/1fedebd8095de85a378640f71c3de4bce2e25cae If no problem for a week, I'll send a pull request this. Currently, content-type header is normal and no problem occurs for three days. https://cacoo.com/diagrams/J5lvJfdIi8t9UCof It's ok that you fix in main repository source code before sending my pull request. At which time, consider about other headers (Content-length, content-disposition, and so on), please.

          Nice! That sounds like a plausible explanation, and other people are having similar problems with Chrome:

          http://productforums.google.com/forum/#!msg/chrome/zID6uQQfKH8/AOUiKiAp8fwJ
          https://code.google.com/p/chromium/issues/detail?id=176430

          I guess everybody here seeing this issue is running Winstone?

          Christopher Orr added a comment - Nice! That sounds like a plausible explanation, and other people are having similar problems with Chrome: http://productforums.google.com/forum/#!msg/chrome/zID6uQQfKH8/AOUiKiAp8fwJ https://code.google.com/p/chromium/issues/detail?id=176430 I guess everybody here seeing this issue is running Winstone?

          Justin Patrin added a comment -

          I can confirm that we are using jenkins "standalone" (jenkins.war), which apparently uses Winstone.

          Are you saying that if we used something else, like Tomcat, this problem would go away?

          Justin Patrin added a comment - I can confirm that we are using jenkins "standalone" (jenkins.war), which apparently uses Winstone. Are you saying that if we used something else, like Tomcat, this problem would go away?

          Chris Wozny added a comment -

          Broken stylesheet on Jenkins 1.515 in Google Chrome 26.0.1410.64 m on Windows 7

          Chris Wozny added a comment - Broken stylesheet on Jenkins 1.515 in Google Chrome 26.0.1410.64 m on Windows 7

          Joe Rattazzi added a comment -

          Did it look like Tomonari's proposal was a solution to this problem?

          Joe Rattazzi added a comment - Did it look like Tomonari's proposal was a solution to this problem?

          I've tried to use my fixed winstone, and broken stylesheet isn't appearing for over a week.
          So, I send a pull request (https://github.com/jenkinsci/winstone/pull/9 ).

          Check it and merge if no problem, please.

          Tomonari Nakamura added a comment - I've tried to use my fixed winstone, and broken stylesheet isn't appearing for over a week. So, I send a pull request ( https://github.com/jenkinsci/winstone/pull/9 ). Check it and merge if no problem, please.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/java/winstone/WinstoneResponse.java
          src/test/winstone/WinstoneResponseTest.java
          http://jenkins-ci.org/commit/winstone/7e57b9d574818516c2a01c3807c60a90c4ea6594
          Log:
          Merge pull request #9 from ikikko/master

          JENKINS-17684 Remove Content-Type header when 304 not modified.

          Compare: https://github.com/jenkinsci/winstone/compare/b844d0dc6b86...7e57b9d57481

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/java/winstone/WinstoneResponse.java src/test/winstone/WinstoneResponseTest.java http://jenkins-ci.org/commit/winstone/7e57b9d574818516c2a01c3807c60a90c4ea6594 Log: Merge pull request #9 from ikikko/master JENKINS-17684 Remove Content-Type header when 304 not modified. Compare: https://github.com/jenkinsci/winstone/compare/b844d0dc6b86...7e57b9d57481

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980
          Log:
          [FIXED JENKINS-17684] Integrate new Winstone with caching fix.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html war/pom.xml http://jenkins-ci.org/commit/jenkins/0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980 Log: [FIXED JENKINS-17684] Integrate new Winstone with caching fix.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2561
          [FIXED JENKINS-17684] Integrate new Winstone with caching fix. (Revision 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980)

          Result = SUCCESS
          Jesse Glick : 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980
          Files :

          • war/pom.xml
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2561 [FIXED JENKINS-17684] Integrate new Winstone with caching fix. (Revision 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980) Result = SUCCESS Jesse Glick : 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980 Files : war/pom.xml changelog.html

          Shannon Kerr added a comment -

          I'm still getting this issue in 1.517 running with latest Chrome. Jenkins host is Ubuntu Server 12.04. Client OS is any (reproduced on Win 7 and Mac OS Mountain Lion).

          Shannon Kerr added a comment - I'm still getting this issue in 1.517 running with latest Chrome. Jenkins host is Ubuntu Server 12.04. Client OS is any (reproduced on Win 7 and Mac OS Mountain Lion).

          Shannon Kerr added a comment -

          I'm still getting this issue with Jenkins 1.517 and latest Chrome.

          Shannon Kerr added a comment - I'm still getting this issue with Jenkins 1.517 and latest Chrome.

          Owen Mehegan added a comment -

          I don't think the fix has made it into a release yet: http://jenkins-ci.org/changelog

          Owen Mehegan added a comment - I don't think the fix has made it into a release yet: http://jenkins-ci.org/changelog

          Shannon Kerr added a comment -

          Ah, OK, thanks owenmehegan. Do I just keep an eye on the changelog or will I be notified of its release since I'm watching this ticket?

          Shannon Kerr added a comment - Ah, OK, thanks owenmehegan. Do I just keep an eye on the changelog or will I be notified of its release since I'm watching this ticket?

          Christopher Orr added a comment - - edited

          New versions are normally released weekly, so you should see 1.518 released with this fix in the next few days.

          So keep an eye on the changelog. There's no automated notification for tickets which are fixed by a new release.

          Christopher Orr added a comment - - edited New versions are normally released weekly, so you should see 1.518 released with this fix in the next few days. So keep an eye on the changelog. There's no automated notification for tickets which are fixed by a new release.

          Owen Mehegan added a comment -

          Watch the changelog.

          Owen Mehegan added a comment - Watch the changelog.

          Shannon Kerr added a comment -

          Thanks very much to both of you and sorry for my newbie-ness This issue and JENKINS-10442 are the first two real issues I've experienced on Jenkins. Looking forward to the fixes being rolled out.

          Shannon Kerr added a comment - Thanks very much to both of you and sorry for my newbie-ness This issue and JENKINS-10442 are the first two real issues I've experienced on Jenkins. Looking forward to the fixes being rolled out.

          Version 1.518 was released today, which fixes this issue.

          Christopher Orr added a comment - Version 1.518 was released today, which fixes this issue.

          Shannon Kerr added a comment -

          Verified. It's beautiful! Great work! Thanks.

          Shannon Kerr added a comment - Verified. It's beautiful! Great work! Thanks.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/804c2ed42e15dcf8576f1697d174550e1370b779
          Log:
          [FIXED JENKINS-17684] Integrate new Winstone with caching fix.

          Cherry-picked-from: 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/804c2ed42e15dcf8576f1697d174550e1370b779 Log: [FIXED JENKINS-17684] Integrate new Winstone with caching fix. Cherry-picked-from: 0866cf5c190bcfc8f5b04dd9e335e7ca74bd4980

          lacostej added a comment -

          Would like to have this backported to lts-candidate. Seems I cannot add a label on closed issues.

          lacostej added a comment - Would like to have this backported to lts-candidate. Seems I cannot add a label on closed issues.

          Srinivasan Venkataraman added a comment - - edited

          I just upgraded to 2.7.1 I am seeing this problem again. I am not able to reach the post build sections of the dashboard at all.

          Please see

          Srinivasan Venkataraman added a comment - - edited I just upgraded to 2.7.1 I am seeing this problem again. I am not able to reach the post build sections of the dashboard at all. Please see

            accountapp Account App Run by Kohsuke
            rburhum Ragi Burhum
            Votes:
            24 Vote for this issue
            Watchers:
            46 Start watching this issue

              Created:
              Updated: