Attachment Links are unavailable in Confluence with java.net.URISyntaxException exception thrown in the UI
Problem
When clicking the link to an attachment, you are redirected to a 'Oops - an error has occurred page' with the following exception displayed on screen:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 47: /confluence/download/attachments/xxx/xxx
Diagnosis
Environment
- Network traffic goes through a proxy
Diagnostic Steps
- Bypass the proxy. If clicking the link takes you to the attachment, proceed with the resolution below.
Cause
The proxy server is not configured correctly for URI encoding.
Resolution
Ensure all steps listed in Proxying Atlassian server applications with Apache HTTP Server (mod_proxy_http) have been completed successfully, specially the ProxyPass and ProxyPassReverse directives. If using mod_jk, add the following option to your Apache mod_jk configuration:
JkOptions +ForwardURICompatUnparsed