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. :\
On Sun, Oct 18, 2020 at 3:11 PM Alan Orth <[email protected]> wrote:
> 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:
>
>
> http://localhost:8080/discover/search/csv?query=*&scope=~&filters=author:(Orth,\
> Alan)
>
> 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":
>
>
> http://demo.dspace.org/xmlui/discover?filtertype_1=author&filter_relational_operator_1=contains&filter_1=Lewis%2C+Stuart&submit_apply_filter=&query=&scope=%2F
>
> 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
> [email protected]
> https://picturingjordan.com
> https://englishbulgaria.net
> https://mjanja.ch
>
--
Alan Orth
[email protected]
https://picturingjordan.com
https://englishbulgaria.net
https://mjanja.ch
--
All messages to this mailing list should adhere to the DuraSpace Code of
Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/CAKKdN4WX8g1mEHYVBKCg7uLb070KO2b2atTk-mFnPmjCOeQdOQ%40mail.gmail.com.