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

Bug 485962

Summary: Compute References for Workspace does not work at all (gives strange error message)
Product: [ECD] Orion Reporter: Steve Northover <steve_northover>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: ahunter.eclipse, libingw, steve_northover
Version: unspecified   
Target Milestone: 11.0   
Hardware: All   
OS: All   
Whiteboard:

Description Steve Northover CLA 2016-01-15 13:07:30 EST
1) Select any funtion
2) Tools->References->Project
3) BUG: You get this error message: 'Cannot compute references: undefined'
Comment 1 Steve Northover CLA 2016-01-15 13:08:55 EST
Mike, if this is really broken for everyone, we are total fools.  Libing/Anthony, we might want to deploy right away once this is fixed.
Comment 2 Steve Northover CLA 2016-01-15 14:13:34 EST
I meant PROJECT!!!!!

1) Select any funtion
2) Tools->References->Project
3) BUG: You get this error message: 'Cannot compute references: undefined'
Comment 3 Steve Northover CLA 2016-01-15 14:14:10 EST
I MEANT WORKSPACE!!!!!!

1) Select any funtion
2) Tools->References->Project
3) BUG: You get this error message: 'Cannot compute references: undefined'
Comment 4 Steve Northover CLA 2016-01-15 14:14:42 EST
WORKSPACE, WORSPACE, WORKSPACE!!
Comment 5 libing wang CLA 2016-01-15 15:19:46 EST
I've tried different things to reproduce it.

1. reproduced in orion.eclipse.org.
2. reproduced in hub.jazz.net
3. reproduced in beta3 self hosting.
4. But not reproducible in my selfhost.orion.eclipse.org. And I got my page crashed because my workspace is too big(??)

Anyway, I then used beta3 self hosting to see what happened.
The actual error I got comes from the search:


responseText: "<html><head><title>404 Not Found</title></head><body bgcolor="white"><center><h1>404 Not Found</h1></center><hr><center>nginx/1.8.0</center></body></html>"

URL: /code/file/../filesearch?sort=undefined&rows=undefined&start=undefined&q=getModel+Name:*.js/*.html/*.htm+CaseSensitive:true+Location:*
Comment 6 Steve Northover CLA 2016-01-18 08:38:45 EST
I MEANT WORKSPACE!!!!!!

1) Select any funtion
2) Tools->References->Workspace
3) BUG: You get this error message: 'Cannot compute references: undefined'

... can't seem to get this right.  It works for Project and fails for Workspace.
Comment 7 Steve Northover CLA 2016-01-18 08:38:52 EST
I MEANT WORKSPACE!!!!!!

1) Select any funtion
2) Tools->References->Workspace
3) BUG: You get this error message: 'Cannot compute references: undefined'

... can't seem to get this right.  It works for Project and fails for Workspace.
Comment 8 Michael Rennie CLA 2016-01-18 12:42:47 EST
The problem is coming from the search, which ends up causing the refs deferred to be rejected, with no error message. There is however error.responseText which contains this:

"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <style>
 body{
 margin:0px;
 padding:0px;
 background-color: #ffffff;
 color:#000;
 font-family:Arial,Verdana,Helvetica,Tahoma,sans-serif;
 }
 #content {
 font-size: 1em;
 margin-left: 1em;
 margin-right: 1em;
 padding: 1em;
 }
 h4.basichead {
 font-family:Arial,Verdana,Helvetica,Tahoma,sans-serif;
 }
 p {
 padding-top: .5em;
 }
 ul {
 line-height: 1.3em;
 }
 a:link { 
 color: #c00000 
 } 
 a:visited { 
 color: #c00000 
 }
 #page { 
 border: 7px; 
 padding: 7px
 }
 #box { 
 margin: 0; 
 }
 #title {
 font-family:Arial,Verdana,Helvetica,Tahoma,sans-serif;
 font-size:24px;
 font-weight: normal;
 color:#274a71;
 padding-bottom:6px;
 }
 #error { 
 colory: #c00004; 
 margin-bottom: 10px;
 }
 #code { 
 font-family: monospace; 
 font-size: 8pt;
 }
 #stack { 
 margin-left: 30px;
 }
 </style>
 </head>
 <body>
 
 <div id="content">
 <div id="page">
 <div id="box">
 <div id="error"> Exception thrown by application class 'java.lang.String.substring:1235' </div> <div id="code"> java.lang.StringIndexOutOfBoundsException: String index out of range: 14<br> <div id="stack">at java.lang.String.substring(String.java:1235)<br>at org.eclipse.orion.internal.server.search.SearchServlet.buildSearchOptions(SearchServlet.java:94)<br>at org.eclipse.orion.internal.server.search.SearchServlet.doGet(SearchServlet.java:200)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)<br>at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)<br>at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:38)<br>at org.eclipse.orion.server.hosting.HostedSiteRequestFilter.doFilter(HostedSiteRequestFilter.java:71)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.XSRFPreventionFilter.doFilter(XSRFPreventionFilter.java:64)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.WelcomeFileFilter.doFilter(WelcomeFileFilter.java:99)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.CacheFilter.doFilter(CacheFilter.java:73)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.CacheFilter.doFilter(CacheFilter.java:73)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.ExcludedExtensionGzipFilter.doFilter(ExcludedExtensionGzipFilter.java:141)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.orion.server.servlets.LoggedInUserFilter.doFilter(LoggedInUserFilter.java:60)<br>at org.eclipse.equinox.http.registry.internal.FilterManager$FilterWrapper.doFilter(FilterManager.java:173)<br>at org.eclipse.equinox.http.servlet.internal.FilterRegistration.doFilter(FilterRegistration.java:81)<br>at org.eclipse.equinox.http.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:35)<br>at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:132)<br>at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)<br>at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:154)<br>at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)<br>at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1274)<br>at [internal classes]<br> </div> </div> </div>
 </div>
 </div>
 
 </body>
 </html>
 "
Comment 9 Michael Rennie CLA 2016-01-18 13:28:42 EST
Looks like the search servlet is failing with:

java.lang.StringIndexOutOfBoundsException: String index out of range: 14.

To prevent the exception, I pushed in some code to the JS tools to make sure that the workspace search location is not the empty string (it will default to the file client root URL):

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8ed09c992baad51a8f7603ba857abf6d657c93a4

But the servlet code should be fixed to not thrown IOOB exceptions
Comment 10 libing wang CLA 2016-01-21 15:09:00 EST
(In reply to Michael Rennie from comment #9)
> Looks like the search servlet is failing with:
> 
> java.lang.StringIndexOutOfBoundsException: String index out of range: 14.
> 
> To prevent the exception, I pushed in some code to the JS tools to make sure
> that the workspace search location is not the empty string (it will default
> to the file client root URL):
> 
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> ?id=8ed09c992baad51a8f7603ba857abf6d657c93a4
> 
> But the servlet code should be fixed to not thrown IOOB exceptions

I've setup my localhost with latest serve rand client code. I roll back Mike's refsCommand and scriptResolver changes so that we pass "" as the search location to the server. I do not see the IOOB exception and the find refs from work space works.

We need the same user work space that can reproduce the issue.
Comment 11 Michael Rennie CLA 2016-01-25 16:37:15 EST
(In reply to libing wang from comment #10)
> (In reply to Michael Rennie from comment #9)
> > Looks like the search servlet is failing with:
> > 
> > java.lang.StringIndexOutOfBoundsException: String index out of range: 14.
> > 
> > To prevent the exception, I pushed in some code to the JS tools to make sure
> > that the workspace search location is not the empty string (it will default
> > to the file client root URL):
> > 
> > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> > ?id=8ed09c992baad51a8f7603ba857abf6d657c93a4
> > 
> > But the servlet code should be fixed to not thrown IOOB exceptions
> 
> I've setup my localhost with latest serve rand client code. I roll back
> Mike's refsCommand and scriptResolver changes so that we pass "" as the
> search location to the server. I do not see the IOOB exception and the find
> refs from work space works.
> 
> We need the same user work space that can reproduce the issue.

Since this is fixed / prevented from the JS tools, I'm going to close this as fixed. I opened bug 486516 for us to track fixing the search servlet.