Confluence displays java.net.URISyntaxException: Expected authority at index 2: // error

Still need help?

The Atlassian Community is here for you.

Ask the community

For Atlassian eyes only

This article is Work In Progress and cannot be shared with customers.


Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Summary

When logging into Confluence, the following stacktrace and message display:

2020-11-23 22:28:46,842 ERROR [http-nio-8090-exec-11] [[Standalone].[localhost].[/].[action]] log Servlet.service() for servlet [action] in context with path [] threw exception
java.lang.IllegalArgumentException: java.net.URISyntaxException: Expected authority at index 2: //
	at com.github.kristofa.brave.servlet.ServletHttpServerRequest.getUri(ServletHttpServerRequest.java:27)
	at com.atlassian.confluence.web.filter.ZipkinTracingFilter$1.lambda$create$0(ZipkinTracingFilter.java:38)
	at com.github.kristofa.brave.http.HttpServerRequestAdapter.getSpanName(HttpServerRequestAdapter.java:41)
	at com.github.kristofa.brave.ServerRequestInterceptor.handle(ServerRequestInterceptor.java:47)
	at com.github.kristofa.brave.servlet.BraveServletFilter.doFilter(BraveServletFilter.java:56)
	at com.atlassian.confluence.web.filter.ZipkinTracingFilter.doFilter(ZipkinTracingFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
...
Caused by: java.net.URISyntaxException: Expected authority at index 2: //
	at java.base/java.net.URI$Parser.fail(Unknown Source)
	at java.base/java.net.URI$Parser.failExpecting(Unknown Source)
	at java.base/java.net.URI$Parser.parseHierarchical(Unknown Source)
	at java.base/java.net.URI$Parser.parse(Unknown Source)
	at java.base/java.net.URI.<init>(Unknown Source)
	at com.github.kristofa.brave.servlet.ServletHttpServerRequest.getUri(ServletHttpServerRequest.java:25)


Environment

Confluence 7.9.x

NGINX proxy

Diagnosis


As displayed in the UI, the Confluence application log contains the stacktrace shown above.

Cause


The NGINX proxy has a configuration that contains an extra forward slash - here, after the $host variable:

proxy_redirect http://mycompany.com:8090 $scheme://$host/;


Solution

  1. Stop NGINX.
  2. Remove the forward slash trailing the $host variable.
  3. Start NGINX.


Last modified on Dec 9, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.