Accessing Jira with a non-base URL for the first time will cause gadgets to fail to load even when accessed through the correct base URL

XMLWordPrintable

    • 9.12
    • 10
    • Severity 3 - Minor
    • 52

      Issue Summary

      Accessing Jira with a non-base URL for the first time will cause gadgets to fail to load even when accessed through the correct base URL, showing the Requests to URL are not allowed message:

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Add a new URL entry /etc/hosts pointing to the Jira baseURL (I'm using localhost as Jira is running on localhost)
        127.0.0.1 jiratest2.com
        
      2. Start Jira and access it from the non-baseURL, e.g.:
        jiratest2.com:port
        
      3. The Gadgets like Activity Stream will not load:
      4. When accessing Jira from the base URL, the following message will be blocking the gadgets to load:

      Video recording reproducing the issue: 

      Expected Results

      Even though the gadget will not load when using a non-base URL, as Jira only supports a single baseURL, this should not block the gadget from loading when accessing Jira via baseURL.

      Actual Results

      The below exception is thrown in the gadget when accessing it via baseURL

      Requests to <non-base-url> are not allowed. See your administrator about configuring a whitelist entry for this destination (http://confluence.atlassian.com/x/KQfCDQ). 

      A similar error is presented in the atlassian-jira.log

      2024-08-15 15:18:45,645-0300 http-nio-45171-exec-9 url: /j5171/plugins/servlet/gadgets/makeRequest; user: rodrigo WARN rodrigo 918x311x1 127099c 0:0:0:0:0:0:0:1 /plugins/servlet/gadgets/makeRequest [c.a.g.r.internal.http.HttpClientFetcher] A request to http://jirabug.com:45171/j5171/plugins/servlet/oauth/request-token has been denied. To allow requests to this URL add the application URL to your whitelist (http://confluence.atlassian.com/x/KQfCDQ).
      

      Workaround

      • Reboot the affected node and access the Dashboard via the Base URL for the first time so that the node will set this URL in the cache for the first time.
      • Configure a redirect in the OS level to direct the non-base URL to the Jira base URL.

        1. bug.mov
          49.41 MB
        2. screenshot1.png
          screenshot1.png
          73 kB
        3. screenshot2.png
          screenshot2.png
          531 kB
        4. screenshot3.png
          screenshot3.png
          611 kB

            Assignee:
            Bartosz Radaczyński
            Reporter:
            Rodrigo Jose Zaparoli
            Votes:
            8 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: