java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test

Atlassian JIRA | Daniel Ponzio [Atlassian] | 3 months ago
  1. 0

    h3. Summary Confluence shows stack trace when accessing a page that uses a special character in the title h3. Environment * Confluence 5.10.2 * Safari * Mozilla Firefox h3. Steps to Reproduce # Create a page and add a special character (e.g. a '|'' in the title) # Save the page # In Firefox or Safari, log into Confluence and paste the URL directly, for example [http://localhost:8090/confluence/display/BATS/page+]|+test h3. Expected Results Page is displayed properly using any browser. This was tested in Confluence 5.8.5 and we found that going to that link directly even with a special character displayed the page without issues h3. Actual Results User sees a 'java.net.URISyntaxException: Illegal character in path at index' stack trace on the page. This error is thrown in the logs: {noformat} 2016-08-25 15:49:59,959 ERROR [http-nio-8090-exec-8] [[Standalone].[localhost].[/confluence].[simple-display]] log Servlet.service() for servlet [simple-display] in context with path [/confluence] threw exception java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test 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:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:23) at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72) at com.atlassian.confluence.web.ConfluenceJohnsonFilter.doFilter(ConfluenceJohnsonFilter.java:33) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:41) at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.confluence.impl.servlet.HoldingUntilStartedFilter.doFilter(HoldingUntilStartedFilter.java:88) at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:64) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46) at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parseHierarchical(URI.java:3105) at java.net.URI$Parser.parse(URI.java:3063) at java.net.URI.<init>(URI.java:588) at com.github.kristofa.brave.servlet.ServletHttpServerRequest.getUri(ServletHttpServerRequest.java:25) ... 49 more 2016-08-25 15:49:59,962 INFO [http-nio-8090-exec-8] [atlassian.confluence.status.SystemErrorInformationLogger] writeToLog Request Unique ID : 23256772-bdd8-43e3-a43d-260f641b7897 -------------------------- JVM Stats -------------------------- usedMemory = 891993208 usedMemoryInMegabytes = 850 availableHeap = 181748616 freeMemoryInMegabytes = 173 allocatedHeap = 1073741824 freeAllocatedHeap = 181748616 totalMemory = 1073741824 totalMemoryInMegabytes = 1024 availablePermGen = 0 maxPermGen = -1 maxHeap = 1073741824 usedHeap = 891993208 freeMemory = 181748616 usedPermGen = -1 -------------------------- Request Information -------------------------- URL: http://localhost:8090/confluence/500page.jsp Scheme: http Server: localhost Port: 8090 URI: /confluence/500page.jsp Context Path: /confluence Servlet Path: /500page.jsp Path Info: null Query String: null -------------------------- Attributes -------------------------- javax.servlet.forward.request_uri: /confluence/display/BATS/page+|+test javax.servlet.forward.context_path: /confluence javax.servlet.forward.servlet_path: /display javax.servlet.forward.path_info: /BATS/page+|+test javax.servlet.error.status_code: 500 com.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@698f04e0 com.opensymphony.sitemesh.APPLIED_ONCE: true javax.servlet.error.message: javax.servlet.error.servlet_name: simple-display atlassian.core.seraph.original.url: /500page.jsp javax.servlet.error.request_uri: /confluence/display/BATS/page+|+test loginfilter.already.filtered: true 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.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test os_securityfilter_already_filtered: true com.atlassian.seraph.auth.LoginReason: OK com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true -------------------------- Parameters -------------------------- caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test at com.github.kristofa.brave.servlet.ServletHttpServerRequest.getUri(ServletHttpServerRequest.java:27) caused by: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test at java.net.URI$Parser.fail(URI.java:2848) 2016-08-25 15:50:00,281 WARN [http-nio-8090-exec-6] [common.security.jersey.XsrfResourceFilter] passesAdditionalBrowserChecks Additional XSRF checks failed for request: http://localhost:8090/confluence/rest/webResources/1.0/resources , origin: null , referrer: http://localhost:8090/confluence/display/BATS/page+|+test , credentials in request: true , allowed via CORS: false -- referer: http://localhost:8090/confluence/display/BATS/page+|+test | url: /confluence/rest/webResources/1.0/resources | traceId: bb89b029c339b958 | userName: admin 2016-08-25 15:50:00,771 WARN [http-nio-8090-exec-2] [common.security.jersey.XsrfResourceFilter] passesAdditionalBrowserChecks Additional XSRF checks failed for request: http://localhost:8090/confluence/rest/analytics/1.0/publish/bulk , origin: null , referrer: http://localhost:8090/confluence/display/BATS/page+|+test , credentials in request: true , allowed via CORS: false -- referer: http://localhost:8090/confluence/display/BATS/page+|+test | url: /confluence/rest/analytics/1.0/publish/bulk | traceId: a3e3e661a783e3ff | userName: admin {noformat} h3. Notes This issue does not occur with Chrome h3. Workaround Use Chrome to access the page

    Atlassian JIRA | 3 months ago | Daniel Ponzio [Atlassian]
    java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 30: /confluence/display/BATS/page+|+test
  2. 0

    Spring PropertyPlaceHolder Issue

    Stack Overflow | 1 year ago | Ayodeji
    java.net.URISyntaxException: Illegal character in path at index 1: ${imi.ws.fulfillment.service}
  3. 0

    Httpclient 4.3.6: Invalid redirect URI

    Stack Overflow | 1 year ago | Sumit Kumar
    org.apache.http.ProtocolException: Invalid redirect URI: /harborone0457/Profile%20-%20{0}.aspx
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unhandled Exception on OS X

    GitHub | 2 years ago | daxxog
    java.net.URISyntaxException: Illegal character in path at index 31: /Users/daxxog/Desktop/Halo-test game.gm6
  6. 0

    Admin can create user with invalid username

    GitHub | 7 months ago | WhyINeedToFillUsername
    java.net.URISyntaxException: Illegal character in path at index 17: /api/users/mezery vadi?
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.URISyntaxException

    Illegal character in path at index 30: /confluence/display/BATS/page+|+test

    at java.net.URI$Parser.fail()
  2. Java RT
    URI.<init>
    1. java.net.URI$Parser.fail(URI.java:2848)
    2. java.net.URI$Parser.checkChars(URI.java:3021)
    3. java.net.URI$Parser.parseHierarchical(URI.java:3105)
    4. java.net.URI$Parser.parse(URI.java:3063)
    5. java.net.URI.<init>(URI.java:588)
    5 frames
  3. com.github.kristofa
    ServletHttpServerRequest.getUri
    1. com.github.kristofa.brave.servlet.ServletHttpServerRequest.getUri(ServletHttpServerRequest.java:25)
    1 frame
  4. com.atlassian.confluence
    ZipkinTracingFilter$1.lambda$create$0
    1. com.atlassian.confluence.web.filter.ZipkinTracingFilter$1.lambda$create$0(ZipkinTracingFilter.java:38)
    1 frame
  5. com.github.kristofa
    BraveServletFilter.doFilter
    1. com.github.kristofa.brave.http.HttpServerRequestAdapter.getSpanName(HttpServerRequestAdapter.java:41)
    2. com.github.kristofa.brave.ServerRequestInterceptor.handle(ServerRequestInterceptor.java:47)
    3. com.github.kristofa.brave.servlet.BraveServletFilter.doFilter(BraveServletFilter.java:56)
    3 frames
  6. com.atlassian.confluence
    ZipkinTracingFilter.doFilter
    1. com.atlassian.confluence.web.filter.ZipkinTracingFilter.doFilter(ZipkinTracingFilter.java:52)
    1 frame
  7. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  8. com.atlassian.confluence
    ResponseOutputStreamFilter.doFilter
    1. com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:23)
    1 frame
  9. com.atlassian.core
    AbstractHttpFilter.doFilter
    1. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
    1 frame
  10. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  11. com.atlassian.johnson
    AbstractJohnsonFilter.doFilter
    1. com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72)
    1 frame
  12. com.atlassian.confluence
    ConfluenceJohnsonFilter.doFilter
    1. com.atlassian.confluence.web.ConfluenceJohnsonFilter.doFilter(ConfluenceJohnsonFilter.java:33)
    1 frame
  13. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  14. com.atlassian.core
    AbstractHttpFilter.doFilter
    1. com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:41)
    2. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
    2 frames
  15. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  16. com.atlassian.confluence
    HoldingUntilStartedFilter.doFilter
    1. com.atlassian.confluence.impl.servlet.HoldingUntilStartedFilter.doFilter(HoldingUntilStartedFilter.java:88)
    1 frame
  17. com.atlassian.core
    AbstractHttpFilter.doFilter
    1. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
    1 frame
  18. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  19. com.atlassian.core
    HeaderSanitisingFilter.doFilter
    1. com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
    1 frame
  20. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  21. com.atlassian.confluence
    FourOhFourErrorLoggingFilter.doFilter
    1. com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:64)
    1 frame
  22. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    2 frames
  23. com.atlassian.confluence
    DebugFilter.doFilter
    1. com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)
    1 frame
  24. com.atlassian.core
    AbstractHttpFilter.doFilter
    1. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
    1 frame
  25. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    6. org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)
    7. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    8. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    10 frames
  26. Grizzly HTTP
    NioEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    4 frames
  27. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2 frames
  28. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  29. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame