Summary

      Confluence attachment is rendered as a broken link when viewed in JIRA Activity Stream gadget from JIRA and Activity Stream gadget from Confluence.

      Environment

      • Confluence 6.1.0, 6.1.2
      • JIRA 7.3.3, 7.3.5

      Steps to Reproduce

      1. Set up application links between JIRA and Confluence
      2. Add attachment in an existing Confluence page
      3. See JIRA Activity Stream gadget from JIRA Dashboard

      Expected Results

      The attachment is rendered correctly

      Actual Results

      • The attachment is rendered as a broken link
      • Opening the attachment in a new tab will result in a System Error page with below error:
      Cause
      java.lang.NullPointerException
      at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:105)
      Stack Trace:[hide]
      java.lang.NullPointerException
      at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:105)
      at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload$StreamResultCallback.doInTransaction(ServeAfterTransactionDownload.java:110)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.getStreamInTransaction(ServeAfterTransactionDownload.java:36)
      at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.serveFile(ServeAfterTransactionDownload.java:42)

      Notes

      • JIRA Activity Stream gadget can render the attachment correctly when JIRA 7.3.3 is integrated with Confluence 5.10.5
      • The same URL is used for linking the attachment when integrated with Confluence 5.10.5 and 6.1.0, for example http://10.60.2.82:8090//download/attachments

      Workaround

      Open the attachment link in a new tab and remove one of the 2 forward slashes between the Base URL and download/attachments. E.g. from:

      to

        1. 123.jpg
          123.jpg
          31 kB
        2. 1234.JPG
          1234.JPG
          37 kB
        3. 12345.JPG
          12345.JPG
          52 kB
        4. 123456.JPG
          123456.JPG
          16 kB
        5. Screen Shot 2018-02-16 at 9.10.44 am.png
          Screen Shot 2018-02-16 at 9.10.44 am.png
          135 kB

            [CONFSERVER-52102] Broken Attachment Link in JIRA Activity Stream Gadget

            Bespin Global Admin added a comment - - edited

            Well, it still remains for confluence 7.0.3 with a very specific case.

            When someone shares the confluence page to others at least 2 people, then the gadget mentions the page is shared with the other person. However, the profile photo path of the person has two slashes such as https://example.com//download/attachments/5472359/user-avatar and cannot see the photo, logging the errors.

             

            --------------------------
            Attributes
            --------------------------
            javax.servlet.forward.request_uri: //download/attachments/5472359/user-avatar
            javax.servlet.forward.context_path:
            javax.servlet.forward.servlet_path: /download
            javax.servlet.forward.path_info: /attachments/5472359/user-avatar
            javax.servlet.forward.mapping: org.apache.catalina.core.ApplicationMapping$MappingImpl@376f34de
            javax.servlet.error.status_code: 500
            com.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@1fbc1721
            com.opensymphony.sitemesh.APPLIED_ONCE: true
            __cleanup_recursion_counter: 0
            javax.servlet.error.message:
            javax.servlet.error.servlet_name: file-server
            com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter_already_filtered: true
            atlassian.core.seraph.original.url: /500page.jsp
            com.atlassian.labs.botkiller.BotKillerFilter: true
            com.atlassian.gzipfilter.GzipFilter_already_filtered: true
            Confluence-Request-Time: 1572058631091
            B3-TraceId: 6a9e3c11d71761
            loginfilter.already.filtered: true
            javax.servlet.error.request_uri: //download/attachments/5472359/user-avatar
            com.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true
            com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter: true
            com.atlassian.confluence.web.ConfluenceJohnsonFilter_already_filtered: true
            javax.servlet.error.exception: java.lang.NullPointerException
            os_securityfilter_already_filtered: true
            com.atlassian.seraph.auth.LoginReason: OK
            com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true
            --------------------------
            Parameters
            --------------------------
            caused by: java.lang.NullPointerException
            at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:108)
             

            Bespin Global Admin added a comment - - edited Well, it still remains for confluence 7.0.3 with a very specific case. When someone shares the confluence page to others at least 2 people, then the gadget mentions the page is shared with the other person. However, the profile photo path of the person has two slashes such as https://example.com//download/attachments/5472359/user-avatar  and cannot see the photo, logging the errors.   -------------------------- Attributes -------------------------- javax.servlet.forward.request_uri: //download/attachments/5472359/user-avatar javax.servlet.forward.context_path: javax.servlet.forward.servlet_path: /download javax.servlet.forward.path_info: /attachments/5472359/user-avatar javax.servlet.forward.mapping: org.apache.catalina.core.ApplicationMapping$MappingImpl@376f34de javax.servlet.error.status_code: 500 com.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@1fbc1721 com.opensymphony.sitemesh.APPLIED_ONCE: true __cleanup_recursion_counter: 0 javax.servlet.error.message: javax.servlet.error.servlet_name: file-server com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter_already_filtered: true atlassian.core.seraph.original.url: /500page.jsp com.atlassian.labs.botkiller.BotKillerFilter: true com.atlassian.gzipfilter.GzipFilter_already_filtered: true Confluence-Request-Time: 1572058631091 B3-TraceId: 6a9e3c11d71761 loginfilter.already.filtered: true javax.servlet.error.request_uri: //download/attachments/5472359/user-avatar com.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter: true com.atlassian.confluence.web.ConfluenceJohnsonFilter_already_filtered: true javax.servlet.error.exception: java.lang.NullPointerException os_securityfilter_already_filtered: true com.atlassian.seraph.auth.LoginReason: OK com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true -------------------------- Parameters -------------------------- caused by: java.lang.NullPointerException at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:108)

            A fix for this issue is available to Server and Data Center customers in Confluence 6.14.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Zhenhuan Zhou (Inactive) added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.14.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            Jira 7.12.1 + Confluence 6.12.0 not affected

            Bulanov Maxim added a comment - Jira 7.12.1 + Confluence 6.12.0 not affected

            Dmitriy Alekseev added a comment - - edited

            Workaround for HAproxy >1.6:

            acl has_multiple_slash path_reg /{2,}
            http-request redirect code 301 location http://%[hdr(host)]%[url,regsub(/+,/,g)] if has_multiple_slash
            

             Workaround for nginx:
            http://nginx.org/ru/docs/http/ngx_http_core_module.html#merge_slashes

            Dmitriy Alekseev added a comment - - edited Workaround for HAproxy >1.6: acl has_multiple_slash path_reg /{2,} http-request redirect code 301 location http: //%[hdr(host)]%[url,regsub(/+,/,g)] if has_multiple_slash  Workaround for nginx: http://nginx.org/ru/docs/http/ngx_http_core_module.html#merge_slashes

            +1

            • Jira: 7.6.1
            • Confluence: 6.5.2

            Igors Yansons added a comment - +1 Jira: 7.6.1 Confluence: 6.5.2

            +1

            • jira: v7.10.2
            • confuence: 6.10.0

            Martin Virág added a comment - +1 jira: v7.10.2 confuence: 6.10.0

            +1 with Jira 7.10.0 + Confluence 6.9.0

            Bulanov Maxim added a comment - +1 with Jira 7.10.0 + Confluence 6.9.0

            Just started happening out of the blue on our setup: Jira 7.7.0, Confluence  6.6.2.

            No Nginx.

             

            Ithai Swart added a comment - Just started happening out of the blue on our setup: Jira 7.7.0, Confluence  6.6.2. No Nginx.  

            same problem here: Jira 7.10, confluence 6.7.2

            Morten Byom added a comment - same problem here: Jira 7.10, confluence 6.7.2

            w.szumial1043431334 added a comment -

            The same in Jira 7.6.4 + Confluence 6.6.4 

            w.szumial1043431334 added a comment - The same in Jira 7.6.4 + Confluence 6.6.4 

            Anyone got a solution on Apache Tomcat? I don't have nginx installed.

            Chun-Chi Su added a comment - Anyone got a solution on Apache Tomcat? I don't have nginx installed.

            Seriously this is just a one line fix, and this issue has been over a year.

            This issue is visible on the front page of Jira, it impacts everyday user experience.

            Chun-Chi Su added a comment - Seriously this is just a one line fix, and this issue has been over a year. This issue is visible on the front page of Jira, it impacts everyday user experience.

            黑谷祈羽 added a comment - - edited

            Add 

            server{
            
            ...
            
                sub_filter                 //download /download;
                sub_filter_last_modified   on;
                sub_filter_once            off;
                sub_filter_types           application/atom+xml;
            
            ...
            
            }

            In your nginx proxy server website configuration file.... 

            You should have ngx_http_sub_module installed with your nginx.

            For more information: http://nginx.org/en/docs/http/ngx_http_sub_module.html

             

            黑谷祈羽 added a comment - - edited Add  server{ ... sub_filter //download /download; sub_filter_last_modified on; sub_filter_once off; sub_filter_types application/atom+xml; ... } In your nginx proxy server website configuration file....  You should have ngx_http_sub_module installed with your nginx. For more information: http://nginx.org/en/docs/http/ngx_http_sub_module.html  

            Same issue here:

            atlassian-confluence-6.9.0-x64.bin
            atlassian-jira-software-7.9.2-x64.bin

            //>Hardcore bug!

             

            Alexander Hadj Hassine added a comment - Same issue here: atlassian-confluence-6.9.0-x64.bin atlassian-jira-software-7.9.2-x64.bin //>Hardcore bug!  

            Jira 7.9.2 + Confluence 6.9

            Marcos PS [DEISER] added a comment - Jira 7.9.2 + Confluence 6.9

            Same issue in Jira 7.7.1 and Confluence 6.7.1  

            Diego Martínez Domínguez added a comment - Same issue in Jira 7.7.1 and Confluence 6.7.1  

            Same issue Confluence 6.4.1 and Jira 7.5.0

            Chris Jones added a comment - Same issue Confluence 6.4.1 and Jira 7.5.0

            Same isuee with Jira 7.9.0 and Confluence 6.8.1

            Kristof Mantei added a comment - Same isuee with Jira 7.9.0 and Confluence 6.8.1

            i can see the issue in Confluence 6..3.3 as well

            Hashimi Mansor added a comment - i can see the issue in Confluence 6..3.3 as well

            Could not reproduce with JIRA 7.3.3 and Confluence 6.3.4 (or later versions) running behind Apache 2.4.18.

            Looking at the attachment link, it indeed contains the doubled forward slash, but clicking the link works properly without throwing any system error.

            Lucas Machado (Inactive) added a comment - Could not reproduce with JIRA 7.3.3 and Confluence 6.3.4 (or later versions) running behind Apache 2.4.18. Looking at the attachment link, it indeed contains the doubled forward slash, but clicking the link works properly without throwing any system error.

            Same issue with Jira 7.8.0 and Confluence 6.2.0.

            Christoph Schötz added a comment - Same issue with Jira 7.8.0 and Confluence 6.2.0.

            Same issue with Jira 7.3.3 and Confluence 6.3.4

            Leena Bakshi added a comment - Same issue with Jira 7.3.3 and Confluence 6.3.4

            Same problem with Jira 7.6.4 and Confluence 6.6.3.

            Zhenlei Huang added a comment - Same problem with Jira 7.6.4 and Confluence 6.6.3.

            Same problem with Jira 7.7.1 and Confluence 6.7.1

            Wojtek Dziubinski added a comment - Same problem with Jira 7.7.1 and Confluence 6.7.1

            I wish the surging share price of Atlassian can motivate their engineering team to fix this issue soon.

            Martin Siu added a comment - I wish the surging share price of Atlassian can motivate their engineering team to fix this issue soon.

            Kyle Krug added a comment -

            We also experience this issue between our Jira 7.5.1 and Confluence 6.4.3

            Kyle Krug added a comment - We also experience this issue between our Jira 7.5.1 and Confluence 6.4.3

            Same problem here with using the bleeding edge Confluence 6.6.0 and Jira v7.7.0.

            Martin Siu added a comment - Same problem here with using the bleeding edge Confluence 6.6.0 and Jira v7.7.0.

            Same problem here with Confluence 6.5.1 and Jira v7.6.0

            Christian Lund added a comment - Same problem here with Confluence 6.5.1 and Jira v7.6.0

            Same problem here with Confluence 6.2.1 and JIRA 7.3.7

            Peter Müller added a comment - Same problem here with Confluence 6.2.1 and JIRA 7.3.7

            Same problem with Confluence 6.4.3 and JIRA 7.5.1

            Mario Mishev added a comment - Same problem with Confluence 6.4.3 and JIRA 7.5.1

            Hi all,

            the problem is also in Confluence 6.4.2. Any solution?

            Thank you!

            Deborah

            Deborah Falcone added a comment - Hi all, the problem is also in Confluence 6.4.2. Any solution? Thank you! Deborah

            brizzbane added a comment -

            Searched Google for this problem.  First link, awesome! Same problem here...was trying to debug it, didn't notice the double slash after beginning of URL...

            That definitely fixed the link JIRA was embedding in the activity stream.  Wondering if there is a setting somewhere for the integration where the URL shouldn't have a / after the http://confluencedomain.com

            brizzbane added a comment - Searched Google for this problem.  First link, awesome! Same problem here...was trying to debug it, didn't notice the double slash after beginning of URL... That definitely fixed the link JIRA was embedding in the activity stream.  Wondering if there is a setting somewhere for the integration where the URL shouldn't have a / after the http://confluencedomain.com

            Max Born added a comment - - edited

            Same problem here. Any updates? I chose Atlassian products for my team because being not-free products these things shouldn't satay broken for long (unlike with free stuff). It's already been too long if you ask me.

            Thanks.

            M.

             

            Max Born added a comment - - edited Same problem here. Any updates? I chose Atlassian products for my team because being not-free products these things shouldn't satay broken for long (unlike with free stuff). It's already been too long if you ask me. Thanks. M.  

            @wesseln64 did you try mod_rewrite? I think it may help.

            Maksim Melnikov added a comment - @wesseln64 did you try mod_rewrite? I think it may help.

            gpaunovic is it possible to show example configuration for a workaround on Apache httpd server? Current config:

            <Location /confluence>
            ProxyPass http://xxx.onior.com:8090/confluence
            ProxyPassReverse http://xxx.onior.com:8090/confluence
            Require all granted
            </Location>
            

            Wessel Nieboer added a comment - gpaunovic is it possible to show example configuration for a workaround on Apache httpd server? Current config: <Location /confluence> ProxyPass http: //xxx.onior.com:8090/confluence ProxyPassReverse http: //xxx.onior.com:8090/confluence Require all granted </Location>

            Wessel Nieboer added a comment - - edited

            Also experiencing this problem with JIRA 7.5.0 and Confluence 6.4.0. Does anyone know a workaround for httpd mod_proxy frontend?

            Wessel Nieboer added a comment - - edited Also experiencing this problem with JIRA 7.5.0 and Confluence 6.4.0. Does anyone know a workaround for httpd mod_proxy frontend?

            Any updates on this?

             

            It really is one line of code...

            Joseph Davis added a comment - Any updates on this?   It really is one line of code...

            same here with 2 environments:

            1) JIRA 7.5.0 and Confluence 6.3.1

            2) JIRA 7.4.4 and Confluence 6.3.4

            both with Apache as reverse proxy

            Andre Eikermann added a comment - same here with 2 environments: 1) JIRA 7.5.0 and Confluence 6.3.1 2) JIRA 7.4.4 and Confluence 6.3.4 both with Apache as reverse proxy

            I'm running JIRA and Confluence setup. Everything works, but for some reason the attachments/downloads have the slash added in my activity stream.

            I'm using reverse proxy with Nginx to add SSL encryption.

            JIRA version: 7.4.4

            Confluence version: 6.3.4

            I also posted about this issue here: https://community.atlassian.com/t5/Jira-questions/JIRA-activity-stream-not-showing-thumbnails-from-Confluence/qaq-p/639887#M210589%3Futm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_answer&utm_content=post 

            I followed the advice but it was not applicable to my situation.

            Shubash Chumber added a comment - I'm running JIRA and Confluence setup. Everything works, but for some reason the attachments/downloads have the slash added in my activity stream. I'm using reverse proxy with Nginx to add SSL encryption. JIRA version: 7.4.4 Confluence version: 6.3.4 I also posted about this issue here:  https://community.atlassian.com/t5/Jira-questions/JIRA-activity-stream-not-showing-thumbnails-from-Confluence/qaq-p/639887#M210589%3Futm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_answer&utm_content=post   I followed the advice but it was not applicable to my situation.

            The workaround is not acceptable in a production environment, for our user base it either work or not, they will not fiddle with the url, they don't have the knowledge for that.

            Olivier Bories added a comment - The workaround is not acceptable in a production environment, for our user base it either work or not, they will not fiddle with the url, they don't have the knowledge for that.

            DupontD added a comment -

            Same problem here ... JIRA 7.4.2 + Confluence 6.3.3

            Created: 30/Mar/2017 ... Atlassian ... What Else ?

            DupontD added a comment - Same problem here ... JIRA 7.4.2 + Confluence 6.3.3 Created: 30/Mar/2017 ... Atlassian ... What Else ?

            Kala Lui added a comment -

            Same here with JIRA v7.4.2 + Confluence 6.3.2...

             

             

            Kala Lui added a comment - Same here with JIRA v7.4.2 + Confluence 6.3.2...    

            Maksim Melnikov added a comment - - edited

            same here

            • JIRA v7.4.0#74002-sha1:4bbb6c3
            • Confluence 6.3.1

            (both running in docker container)

            As a workaround I can write nginx-rule, but that`s not right.

             

            But another running servers I have works fine (JIRA v7.3.1#73012-sha1:68837e3, Confluence 5.10.6).

            Maksim Melnikov added a comment - - edited same here JIRA v7.4.0#74002-sha1:4bbb6c3 Confluence 6.3.1 (both running in docker container) As a workaround I can write nginx-rule, but that`s not right.   But another running servers I have works fine (JIRA v7.3.1#73012-sha1:68837e3, Confluence 5.10.6).

            I'm going to add a +1 to this... 

            Base URL on JIRA and Confluence are both clean, however JIRA is adding an extra slash before the download in confluence attachments. *http://confluence-url.com//download/attachments/98758/1.png?version=1&modificationDate=1500319203046&api=v2*

            Deleted Account (Inactive) added a comment - - edited I'm going to add a +1 to this...  Base URL on JIRA and Confluence are both clean, however JIRA is adding an extra slash before the download in confluence attachments. * http://confluence-url.com//download/attachments/98758/1.png?version=1&modificationDate=1500319203046&api=v2*

            impsite added a comment -

            Same issue too

            impsite added a comment - Same issue too

            김성용 added a comment -

            same issue too

            김성용 added a comment - same issue too

            Julien JAY added a comment -

            Same issue too.

            Julien JAY added a comment - Same issue too.

            It is also happened in my environments, please fix ASAP

            Yoo InChul added a comment - It is also happened in my environments, please fix ASAP

            I do also have this issue with two slashes before the download path-component in attachment links

            Mark Joachim added a comment - I do also have this issue with two slashes before the download path-component in attachment links

            Like attachments, Confluenced's url is appended with /

            shlee@itall.net added a comment - Like attachments, Confluenced's url is appended with /

            I experience this issue, it seems two slashes are being added into attachments...

            Deleted Account (Inactive) added a comment - I experience this issue, it seems two slashes are being added into attachments...

              dluong Duy Truong Luong
              znoorsazali Zul NS [Atlassian]
              Affected customers:
              82 This affects my team
              Watchers:
              92 Start watching this issue

                Created:
                Updated:
                Resolved: