Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-29795

Gadgets can't be added or saved in Confluence page when gzip is enabled

XMLWordPrintable

      Problem Description

      When Confluence, JIRA, and Fisheye are hooked through Application link, and after allowing JIRA gadget can be used in Confluence page, somehow for Fisheye gadget such as changeset gadget. This issue can be replicated in JIRA 5.1 and 5.1.2 and can't be reproduced in JIRA 5.0.

      There will be a stacktrace on Confluence's log, however this will only be thrown upon the first replication, it won't be thrown on second and onwards.

      2012-09-18 23:09:38,532 ERROR [http-8428-1] [renderer.internal.http.HttpClientFetcher] fetch Unable to retrieve response
       -- referer: http://10.60.1.122:8428/plugins/servlet/gadgets/ifr?container=atlassian&mid=292057907200&country=GB&lang=en&view=default&view-params=%7B%22writable%22%3A%22true%22%7D&st=atlassian%3Aw4byW9ErNHkhB5tc42%2FdOVI52u3fToRuxECvFwYUxZN3FbOL7g995XegdAOhJsPy9Rg7uvcp0dAmBP6Q08lhwXWowaL8Wg44HicF5F3RblrD68XSF%2BeBJAh3jiAFJcEZ9xuiXB2kFXR764iOu5PDGex4t5BUna5zvpbG4eEezajlUOJTvz6Yw17MfBwDtsO%2FeemmFsvSDpBjn1McIrFxQ5lpj3l0ZggPLzszfUHYabxxsZiF8iZDj%2Bu%2FBSBKQWZu5CsiR8Vki6gzB7Aw5OgIq82LMRkYz%2BIwdtNQlDzXo3m28MtAwb7fHsmGS%2FU5HC2NrDPUqxMTLx3A9TjX6YerYrng3YlUS1BubF75atUxDtyyHG4z&up_isConfigured=false&up_instance=&up_rep=&up_path=%2F&up_numberToShow=10&up_refresh=false&url=http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jirafisheyeplugin%3Afisheye-recent-commits-gadget%2Fgadgets%2Ffisheye-recent-commits-gadget.xml&libs=auth-refresh | url: /plugins/servlet/gadgets/makeRequest | userName: admin
      java.io.EOFException
      	at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:246)
      	at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:236)
      	at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:140)
      	...
      

      Here's the network trace, from Chrome's developer tools.

      request:
      GET http://10.60.1.122:8428/plugins/servlet/gadgets/makeRequest?refresh=3600&url=http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Ffegadgets%2F1.0%2Ffisheyerecentcommits%2Fvalidate%3Finstance%3D5786eee7-1096-31ba-98f8-fc288a88844e%26rep%3Dprojectsvn%26path%3D%252F%26numberToShow%3D10%26isConfigured%3Dtrue%26refresh%3Dfalse&httpMethod=GET&headers=&postData=&authz=&st=&contentType=JSON&numEntries=3&getSummaries=false&signOwner=true&signViewer=true&gadget=http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jirafisheyeplugin%3Afisheye-recent-commits-gadget%2Fgadgets%2Ffisheye-recent-commits-gadget.xml&container=atlassian&bypassSpecCache= HTTP/1.1
      
      response:
      HTTP/1.1 200 OK
      
      result:
      throw 1; < don 't be evil' > {
          "http://10.60.1.148:8082/rest/fegadgets/1.0/fisheyerecentcommits/validate?instance=5786eee7-1096-31ba-98f8-fc288a88844e&rep=projectsvn&path=%2F&numberToShow=10&isConfigured=true&refresh=false": {
              "headers": {},
              "body": "",
              "rc": 500
          }
      }
      
      request:
      POST /plugins/servlet/gadgets/makeRequest HTTP/1.1
      Host: 10.60.1.122:8428
      Connection: keep-alive
      Content-Length: 1016
      Origin: http://10.60.1.122:8428
      User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
      Content-Type: application/x-www-form-urlencoded
      Accept: */*
      Referer: http://10.60.1.122:8428/plugins/servlet/gadgets/ifr?container=atlassian&mid=313532874752&country=GB&lang=en&view=default&view-params=%7B%22writable%22%3A%22true%22%7D&st=atlassian%3AaAcqtDGsUWyZVrGjxXITuAQz5a2nxAwaiTvBbOLj7%2B6K6dtbIPWu9MUMKxLMCWI1VSq0OcI8hWoQhzQzNXGzP%2BiCz4MqUxSYfaAw1tSBIc2eItxITmYba9KpyoxppQfzrE3IB4zsWWic5OKcJ7MeU0Y139sWh8%2BF4XPnwoTM8vwA3PC28ZpBXr5hpfyYMmuaL%2FQkTY2jm5x8oT7kxYZw%2BE9cObylciD6cHhq8E5O63zJyfMAJ3g8WYifoMgSM2zuatEimBI19qZftJQhkl04SBkHaTd7u9%2BkoUvo67%2BzjgfHz4QqZU2oFN2Fjt0dpE6Tt%2BqjWEOr9YslX8et3a0CyQNwwzgI01TQuTNbB%2F0%2Fdo0wrmey&up_isConfigured=false&up_instance=&up_rep=&up_path=%2F&up_numberToShow=10&up_refresh=false&url=http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jirafisheyeplugin%3Afisheye-recent-commits-gadget%2Fgadgets%2Ffisheye-recent-commits-gadget.xml&libs=auth-refresh
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Cookie: doc-sidebar=300px; JSESSIONID=8147C2B60D1B5F8D7BEF8CB28E2DEE32; arp_scroll_position=640
      
      response:
      HTTP/1.1 200 OK
      Server: Apache-Coyote/1.1
      X-Confluence-Request-Time: 1347982830887
      X-Seraph-LoginReason: OK
      Expires: Tue, 18 Sep 2012 15:40:31 GMT
      Pragma: no-cache
      Cache-Control: no-cache
      Content-Disposition: attachment;filename=p.txt
      Content-Type: application/json;charset=UTF-8
      Content-Length: 3092
      Date: Tue, 18 Sep 2012 15:40:31 GMT
      
      result:
      throw 1; < don 't be evil' > {
          "http://10.60.1.148:8082/rest/fegadgets/1.0/fisheyerecentcommits/validate?instance=5786eee7-1096-31ba-98f8-fc288a88844e&rep=projectsvn&path=%2F&numberToShow=10&isConfigured=true&refresh=false": {
              "headers": {},
              "oauthError": "consumer_key_unknown",
              "body": "",
              "oauthErrorText": "Service provider rejected request\n\n==== Original request:\nGET /rest/fegadgets/1.0/fisheyerecentcommits/validate?instance=5786eee7-1096-31ba-98f8-fc288a88844e&rep=projectsvn&path=%2F&numberToShow=10&isConfigured=true&refresh=false\n\nHost: 10.60.1.148:8082\nX-Shindig-AuthType: oauth\nX-Seraph-Trusted-App-Cert: hFIcS7lUaaSMUUH6XnR2LdWiODcFXdjSGcMatERXbw==\nX-Seraph-Trusted-App-ID: confluence:3961549\nX-Seraph-Trusted-App-Key: iye1IjrDK6N0cUY6Jz27tIEeeb5xZ3IUjEMbQnyl2KNb8NFkTUfILwhJNb8bXI+6TZAu1WpOVihcU7UYsv/T8sEZSVlgKgM6TkJURnEAQqFEWohugUDlTqBpeRFKQkfRJYnBWlLGptfPMZRCsGsg/Z5/pN0xAn4UMoviov7yMkUbI29Q5bxMIm9z0cxxwGPNylCYcXxnx2ElUxwF9hFcc46tjpQvlVxofb2fD1XIVwq1Ylmz+U0GS3JR414If7dwAETHXAD8qG8Q3wPWU2wMtXP6UwexzanwPE9GH4EJMA1LbbNkY8Z9TmwQib3ROXnSsej1Qz+lIy+NMnOCshkGTw==\nX-shindig-dos: on\n\n\n====\n==== Sent request 1:\nPOST /plugins/servlet/oauth/request-token\n\nHost: 10.60.1.148:8082\nX-Shindig-AuthType: none\nAuthorization: OAuth oauth_callback=\"http%3A%2F%2F10.60.1.122%3A8428%2Fplugins%2Fservlet%2Fgadgets%2Foauth-callback\", opensocial_owner_id=\"admin\", opensocial_viewer_id=\"admin\", opensocial_app_id=\"http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jirafisheyeplugin%3Afisheye-recent-commits-gadget%2Fgadgets%2Ffisheye-recent-commits-gadget.xml\", opensocial_app_url=\"http%3A%2F%2F10.60.1.148%3A8082%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jirafisheyeplugin%3Afisheye-recent-commits-gadget%2Fgadgets%2Ffisheye-recent-commits-gadget.xml\", oauth_version=\"1.0\", oauth_timestamp=\"1347982831\", oauth_consumer_key=\"Confluence%3A1597675199\", oauth_signature_method=\"RSA-SHA1\", oauth_nonce=\"30017157088105\", oauth_signature=\"mu6sBCN%2BF8%2F82LyznrqOStYUx18TB9Vp%2BNi2JAB7kRdhffhxnRhJCoiptI%2B4kVwar22XEyJzlyJkusVp4Y3Bf%2BzTl5Zxm5D5EPmmASXafKVF9tJhVjVkDGuDJH9VPFWgTiUYOB%2BCybKcv7sAEiEVo3roe%2Fn8B4ySM3zsHccVdF0%3D\"\nContent-Type: application/x-www-form-urlencoded\nPragma: no-cache\nX-shindig-dos: on\n\n\n==== Received response 1:\nHTTP/1.1 401\r\n\r\nContent-Length: 34\r\nContent-Type: application/x-www-form-urlencoded;charset=UTF-8\r\nDate: Tue, 18 Sep 2012 15:40:31 GMT\r\nServer: Apache-Coyote/1.1\r\nWWW-Authenticate: OAuth realm=\"http%3A%2F%2F10.60.1.148%3A8082\"\r\nWWW-Authenticate: OAuth realm=\"http%3A%2F%2F10.60.1.148%3A8082\", oauth_problem=\"consumer_key_unknown\"\r\n\r\noauth_problem=consumer_key_unknown\r\n\n====",
              "st": "atlassian:WWfPiWb0q62O+w3CLCaXkjojuxjSbDnTfc3JgeNBJPWqGl8ivhw8zD4eqg/yqeNcu+yfSaIuEWy6/GCcsMsif2ravD+ATnDzJdwb70g0nzragkvN/okp32cvZflDbAlraKLPFvqlxV0N6SggWqTucE+WSF25ikzwGE4xY2Ej5X1LOshOqkr/QdB1mDdAfsFsbST68VjqBowX8gFRS5GW2A3rkhBNxknu240EJwdsiYuvr4JS6+Ok8wBjUVaIyWKJFCVIquASnglRsuFvN0bqi6lFvVHFriEqpwNs9IVsh2Hp4An40DRpRu1/B3VgxLky2OPdagZcLI205YtJhpYf8xfCJK4Lhvfp/LxziMB84AZMiF4p",
              "rc": 403
          }
      }
      

      Steps to reproduce

      1. Setup and Application link between Confluence, JIRA, and Fisheye, using Trusted application
      2. Register the gadget feed from JIRA to Confluence through Confluence Admin >> External Gadgets
      3. Add Fisheye Changesets Macro in Confluence page through Insert >> Other Macros >> Fisheye Changesets Macro
      4. Upon specifying the repository name, this error message will be displayed

        An internal server error occurred when requesting resource.

      Workaround

      In JIRA:
      1. Go to Administration > System > General Configuration > Edit Configuration
      2. Disable Use gzip compression > Update
      In user's or client's end

      Flush the browser cache. Otherwise the workaround won't work. To verify this, you can simply try it using Chrome's incognito mode

      Test result matrix

      Confluence Confluence GZIP JIRA JIRA GZIP FishEye GreenHopper FishEye Gadget in Confluence GreenHopper Gadget in Confluence
      4.3 v5.1.3#782 2.7.10 6.0.3
      4.3 v5.1.3#782 2.7.10 6.0.3
      4.2.8 v5.1.3#782 2.7.10 6.0.3
      4.2.8 v5.1.3#782 2.7.10 6.0.3
      4.2.8 v5.1.3#782 2.7.10 6.0.3
      4.2.8 v5.1.3#782 2.7.10 6.0.3
      4.2.8 v5.1.5#784 2.7.10 6.0.3
      4.2.8 v5.1.5#784 2.7.10 6.0.3
      4.2.8 v5.1.5#784 2.7.10 6.0.3
      4.2.8 v5.1.5#784 2.7.10 6.0.3
      4.3 v5.1.5#784 2.7.10 6.0.3
      4.3 v5.1.5#784 2.7.10 6.0.3
      4.3 v5.1.5#784 2.7.10 6.0.3
      4.3 v5.1.5#784 2.7.10 6.0.3
      Test notes
      • Confluence <-> JIRA = AppLink
      • JIRA <-> FishEye = AppLink
      • Each Atlassian app is located in different machine/box
      • All mentioned gadgets can be added in JIRA without any problem
      • Problem only occured when adding the gadget in Confluence, it can't be saved in the macro browser. For gadgets that has been added in Confluence, it'll still appear without any problem.
      • When GZIP is disabled in JIRA. Problem will not occur. This requires flushing browser cache. Force refresh through Shift+ReloadButton doesn't work for some reason. You need to flush it manually. Or simply try with Chrome Incognito mode to see the result. re: JRA-28930
      • When GZIP is enabled in JIRA. Problem will occur straight away without having to flush browser cache. re: JRA-28930
      • For some reason the java.io.EOFException stacktrace will only be thrown once.

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              rjmasikome RianA
              Votes:
              34 Vote for this issue
              Watchers:
              38 Start watching this issue

                Created:
                Updated:
                Resolved: