Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 497011

Summary: Cannot login to orionhub.org when adding a trailing slash to the URL
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Grant Gayed <grant_gayed>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: matthias.sohn, rafael, Silenio_Quarti
Version: 12.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2016-06-29 10:22:24 EDT
As mentioned in the mailing list, some users cannot log into https://orionhub.org/ if they add the trailing slash to the URL. The exception in the orion log is:

[2016-06-29 14:14:23.662 Z] [qtp564625385-3400] WARN  o.e.jetty.servlet.ServletHandler - /
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.eclipse.orion.server.servlets.ContentTypeFilter.doFilter(ContentTypeFilter.java:53) ~[na:na]
        at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35) ~[na:na]
        at org.eclipse.orion.server.servlets.WelcomeFileFilter.doFilter(WelcomeFileFilter.java:99) ~[na:na]
        at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35) ~[na:na]
        at org.eclipse.orion.server.servlets.CacheFilter.doFilter(CacheFilter.java:73) ~[na:na]
        at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35) ~[na:na]
        at org.eclipse.orion.server.servlets.CacheFilter.doFilter(CacheFilter.java:73) ~[na:na]
        at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35) ~[na:na]
        at org.eclipse.orion.server.servlets.ExcludedExtensionGzipFilter.doFilter(ExcludedExtensionGzipFilter.java:141) ~[na:na]
        at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:132) ~[na:na]
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) ~[na:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ~[javax.servlet_3.0.0.v201112011016.jar:na]
        at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360) ~[org.eclipse.equinox.http.jetty_3.0.200.v20131021-1843.jar:na]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) ~[org.eclipse.jetty.servlet_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [org.eclipse.jetty.servlet_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429) [org.eclipse.jetty.servlet_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.Server.handle(Server.java:370) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) [org.eclipse.jetty.http_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [org.eclipse.jetty.http_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [org.eclipse.jetty.server_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696) [org.eclipse.jetty.io_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53) [org.eclipse.jetty.io_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [org.eclipse.jetty.util_8.1.15.v20140411.jar:8.1.15.v20140411]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [org.eclipse.jetty.util_8.1.15.v20140411.jar:8.1.15.v20140411]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
Comment 1 Matthias Sohn CLA 2016-06-29 10:42:30 EDT
For me it's the opposite: without trailing slash I get status 500 if I add the trailing slash Orion tries to load my workspace. Though it seems to be stuck in the phase "loading resources".
Comment 2 Grant Gayed CLA 2016-06-29 11:35:59 EDT
I've released a fix for this, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=c8ca323ca3e549a5d0aa214470429fc31feaddf8 .  I'm not sure that this is the cause of the login problems though.

A R12.0_maintenance branch has been created, based on the R12_0 tag + this change.  Will deploy this to OrionHub to see if it helps, as the problem was not reproducible locally.
Comment 3 Rafael Chaves CLA 2016-08-06 07:54:03 EDT
Just to add another data point, I see this occasionally with my local Orion install (v12).

Usually, after a few browser refreshes, it goes away. Usually, it goes like this:

1) hit the local Orion URI - I get a blank page, no errors on the server; or I get a 500 server error, the stacktrace above gets logged, 
2) hit the local Orion URI - Orion landing page finally loads

1 requires a variable number of attempts until I get 2. When 2 finally happens, if I had Orion loaded on a different browser tab that was stuck in phase 1 above, as well (the blank page mode), it automatically loads as well. 

When the issue goes away, I cannot make it happen again. But eventually it will happen.
Comment 4 Grant Gayed CLA 2016-08-08 10:00:23 EDT
(In reply to Rafael Chaves from comment #3)

Is that with or without the fix from comment 2?  You said "v12", which does not include the fix.
Comment 5 Rafael Chaves CLA 2016-08-08 10:12:10 EDT
@Grant: I am running vanilla v12, IOW, without the fix. Since it seemed you were unable to reproduce it/unsure of the causes, I thought it worth mentioning that the issue is seen in the wild, with some frequency, and apparently associated with a blank page symptom.