-
Bug
-
Resolution: Fixed
-
High
-
8.3.2, 8.3.4, 8.5.3
-
8.03
-
26
-
Severity 3 - Minor
-
73
-
Issue Summary
Context path is duplicated when Jira performs self-request for Activity Stream Gadget, if the subdomain contains the same word as the context path. For example: jira.domain.com/jira or something.domain.com/something
The symptom looks similar to CONFSERVER-53081, but in this case the instance does not need to be linked to a Confluence instance.
Environment
- Jira 8.3.4
- Unable to reproduce in Jira 7.13.11
Steps to Reproduce
- Let's say Jira instance hostname is jira.domain.com
- Set context path to /jira, so the base URL would be jira.domain.com/jira
- This can also be reproduced if the hostname is jira-something1.domain.com, and context path is jira
If you are testing this with a dummy domain, add the domain/IP into both your PC and Jira server's host file to point to the Jira server's IP address
Expected Results
- Activity Stream Gadget works fine
Actual Results
- Activity Stream Gadget displays the following error:
- In the HTTP access logs, it shows that the self-request fails:
10.60.3.46 i867x450x3 jiraadmin [08/Nov/2019:14:27:49 +0800] "POST http://something.domain.com:8080/something/something/rest/webResources/1.0/resources HTTP/1.1" - - - - "Apache-HttpClient/4.5.5 (Java/1.8.0_74)" "1ghmye1" 10.60.3.46 o867x450x3 jiraadmin [08/Nov/2019:14:27:49 +0800] "POST http://something.domain.com:8080/something/something/rest/webResources/1.0/resources HTTP/1.1" 404 0 0.0240 - "Apache-HttpClient/4.5.5 (Java/1.8.0_74)" "1ghmye1"
Workaround
- Avoid having the same context path as the subdomain.
OR - Add a rewrite rule in Tomcat to remove the duplicate context path
- Add <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
into server.xml just above </host> - create a file named rewrite.config in Jira_install/conf/Catalina/localhost path
- Add the following into rewrite.config
RewriteRule ^/contextpath/contextpath/(.*)$ /contextpath/$1
Please make sure to change 'contextpath' to the actual context path you're using
- Add <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />