SSHOC / sshoc-marketplace-backend

Code for the backend
Apache License 2.0
2 stars 0 forks source link

Match max label length with solr search input #442

Open mkrzmr opened 6 months ago

mkrzmr commented 6 months ago

It is possible to create an item with a long label like this one here: {stage } publication/u2C8pK

You can access that item via the ID, but any item-search request will fail:

{stage}search?q=The+journal+_al-Muqtabas_+between+_Shamela.ws_%2C+HathiTrust%2C+and+GitHub+-+producing+open%2C+collaborative%2C+and+fully-referencable+digital+editions+of+early+Arabic+periodicals+-+with+almost+no+funds

response:

{"timestamp":"2024-03-20 07:54:54","status":500,"error":"Error from server at http://api-prod-sshomp-solr:8983/solr: Expected mime type application/octet-stream but got text/html. <h1>Bad Message 414</h1><pre>reason: URI Too Long</pre>; nested exception is org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://api-prod-sshomp-solr:8983/solr: Expected mime type application/octet-stream but got text/html. <h1>Bad Message 414</h1><pre>reason: URI Too Long</pre>"}

to do: Either reduce max length for label or increase max input for solr

KlausIllmayer commented 6 months ago

We once had this problem with media urls, see https://github.com/SSHOC/sshoc-marketplace-backend/issues/20 - this was solved, maybe helpful?

Seems that this is now an issue on side of Solr. Just an info to @tparkola: I still didn't update to the newer Solr version (see https://github.com/SSHOC/sshoc-marketplace-backend/pull/436) could this be helpful or is this something to be done in the code?

tparkola commented 6 months ago

I think a quick solution would be to increase allowed maximum header size in solr/jetty docker config, i.e. -Dsolr.jetty.request.header.size=65535 Apart from that we can add an issue to the backend to to change the method that backend uses to communicate with solr (from GET to POST). But I would wait with investigating this for our solr version is to be updated (relevant pull request is merged). Let me know if you managed to reconfigure docker deployment successfully and the issue is solved.

mkrzmr commented 22 hours ago

this issue still exists, see {stage}/publication/Rirecm

vronk commented 20 hours ago

@tparkola could you look into this? It seems the easiest to restrict the size of title, but maybe you have different suggestion?

tparkola commented 10 hours ago

The question is whether you tried to change the config to allow larger header size as I mentioned in my previous comment? It should be provided via SOLR_OPTS variable to the docker of solr. I think it should solve this issue. Please check and let me know.