Error in DSpace 6.3 "Export Search Metadata"

196 views
Skip to first unread message

Alan Orth

unread,
Oct 18, 2020, 8:12:04 AM10/18/20
to DSpace Technical Support
Dear DSpace community,

I'm trying to test the "Export Search Metadata" feature of DSpace 6. I search my repository for authors containing a name like "Orth, Alan" where there are 22 results. When I try to export the results from the Context → Export Search Metadata link I see a blank page with an HTTP 400 in the browser's network console. The resulting URL is:


If I search for "Orth" instead then I do get a CSV. For what it's worth I see the same issue on demo.dspace.org when I search for "Lewis, Stuart":


The export works if I search for "Lewis" instead (note that you have to be logged in as a site admin to see the export link).

Is this a known issue? Should I file one?

Alan Orth

unread,
Jan 26, 2021, 6:52:54 AM1/26/21
to DSpace Technical Support
Dear list, I have filed DS-4566 for this issue.

After a bit of digging I realized that the issue here is that DSpace incorrectly escapes search filter parameters in the query string using a backslash (\). Tomcat 7.0.107 (at least) returns an HTTP 400 due to invalid characters in the URL. For example, if I try to search for author containing "Alan Orth", the resulting "export search metadata" link causes this error in Tomcat:

Jan 26, 2021 10:47:23 AM org.apache.coyote.http11.AbstractHttp11Processor process
INFO: Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target [/discover/search/csv?query=*&scope=~&filters=author:(Alan\%20Orth)]. The valid characters are defined in RFC 7230 and RFC 3986
        at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:213)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1108)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

The string is already URL encoded so there is no need to add a backslash. For some reason the query works on demo.dspace.org, though it should not. I suspect that Tomcat has been configured to allow "\" in query parameters using the relaxedQueryChars option.

Regards,

See: https://jira.lyrasis.org/browse/DS-4566. Note that I accidentally hit Enter before I was done with the report and there is no edit function. :\
Reply all
Reply to author
Forward
0 new messages