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,