500 Error when accessing the fileContentSummary.view for certain folders

General Server Forum (Inactive)
500 Error when accessing the fileContentSummary.view for certain folders Brian Connolly (Proteinms.net)  2018-06-07 17:13
Status: Closed
 

I have written a script which crawls the LabKey Server project list to determine the FileRoot for a given project and if any subfolders might be using a custom file or pipeline root. The script finds this information by accessing fileContentSummary.view for each container.

One our server, there are a number of folders where this view returns a HTTP response code of 500 with JSON output of

{
"exception" : "Malformed input or input contains unmappable characters: /path/to/files/on disk/",
"exceptionClass" : "java.nio.file.InvalidPathException",
"stackTrace" : [ "sun.nio.fs.UnixPath.encode(UnixPath.java:147)", "sun.nio.fs.UnixPath.<init>(UnixPath.java:71)", "sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)", "java.io.File.toPath(File.java:2234)", "org.labkey.filecontent.FileContentServiceImpl.getDefaultRootPath(FileContentServiceImpl.java:255)", "org.labkey.filecontent.FileContentServiceImpl.getFileRootPath(FileContentServiceImpl.java:216)", "org.labkey.filecontent.FileContentServiceImpl.getMappedDirectory(FileContentServiceImpl.java:666)", "org.labkey.filecontent.FileContentServiceImpl.getMappedAttachmentDirectory(FileContentServiceImpl.java:653)", "org.labkey.filecontent.FileContentServiceImpl.getNodes(FileContentServiceImpl.java:1181)", "org.labkey.filecontent.FileContentController$FileContentSummaryAction.getChildren(FileContentController.java:702)", "org.labkey.filecontent.FileContentController$FileTreeNodeAction.execute(FileContentController.java:794)", "org.labkey.filecontent.FileContentController$FileTreeNodeAction.execute(FileContentController.java:786)", "org.labkey.api.action.ApiAction.handlePost(ApiAction.java:180)", "org.labkey.api.action.ApiAction.handleGet(ApiAction.java:133)", "org.labkey.api.action.ApiAction.handleRequest(ApiAction.java:127)", "org.labkey.api.action.BaseViewAction.handleRequest(BaseViewAction.java:177)", "org.labkey.api.action.SpringActionController.handleRequest(SpringActionController.java:415)", "org.labkey.api.module.DefaultModule.dispatch(DefaultModule.java:1231)", "org.labkey.api.view.ViewServlet._service(ViewServlet.java:205)", "org.labkey.api.view.ViewServlet.service(ViewServlet.java:132)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:742)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.labkey.api.data.TransactionFilter.doFilter(TransactionFilter.java:38)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.labkey.api.module.ModuleLoader.doFilter(ModuleLoader.java:1138)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.labkey.api.security.AuthFilter.doFilter(AuthFilter.java:214)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.labkey.core.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:118)", "org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)", "org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)", "org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)", "org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)", "org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)", "org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)", "org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)", "org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)", "org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)", "org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)", "org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)", "org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)", "org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)", "org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)", "org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)", "java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)", "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)", "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)", "java.lang.Thread.run(Thread.java:748)" ]
}

To access this page I am using a URL similar to https://panoramaweb.org/home/filecontent-fileContentSummary.view??node=CONTAINERID

Is this error occurring when the server is reading the file path from the database or is the server attempting to access the filesystem and the information returned from the filesystem is bad or encoded in some bad way.

Please note, we have had some filename encoding problems where the server was using UTF-8 encoding when storing the file/directory names in the database, but filesystem was using something different (such as ISO-8859-2). This is most like the cause, but I want to verify it is not something else.

Brian

 
 
jeckels responded:  2018-06-10 20:58

Hi Brian,

Are you still seeing this error? I've tried but I can't repro it directly via the URL and the admin console more generally. Nor do I see any recent evidence of this error showing up in the server log file. I'm wondering if it might have somehow been related to the error the server encountered last week with running out of file handles?

Thanks,
Josh

 
Brian Connolly (Proteinms.net) responded:  2018-06-11 08:38

Josh,
Yes it is still occurring. I have sent you an email with a couple of the URLs where it is occurring. If you do not have access to the projects/folders please email me back I am provide you the access required.

Thanks for looking into this.

Brian

 
jeckels responded:  2018-06-11 21:00

Hi Brian,

This does indeed look related to the file encoding path issue you reported a little while ago on the server. The exception indicates that there is a character in the path that can't be represented in the encoding used for the file system. Is it possible that the explicit setting of the preferred encoding got unset?

From what I can tell from looking at the Admin Console's Environment Variables link, the property you previously set is still configured as desired:

LANG=en_US.UTF-8

but is it possible that something else has changed?

Thanks,
Josh