ecotaxa / ecotaxa_front

Front end of the EcoTaxa application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subset (and probably other actions) fail with very long URLs

jiho opened this issue · comments

On project https://ecotaxa.obs-vlfr.fr/prj/6433 which has many samples, once a selection of ~half of them is made, using Filtered > Subset results in an error 414 - Request URI Too Large (displayed by Nginx). I am not sure if this is a limitation of the config of nginx or something unsolvable because URIs have a hardcoded maximum length.

Here is the URL giving rise to the error
ectaxa_url.txt

#716 fix was apparently not enough

#656 was similar but before the move to docker infrastructure

Added into nginx config:

# vi /etc/nginx/sites-available/ecotaxa

server {
        listen 443 default_server;

.
.
.
        large_client_header_buffers 4 16k;

Need also to adjust the max size (32K needed) in the front docker, @see:

# Due to https://github.com/ecotaxa/ecotaxa_dev/issues/716

Until image rebuild, a temp solution is to adjust it inside the running image, e.g.:

# docker exec -it ecotaxafront /bin/bashroot@7e75997c39fb:/app# vi uwsgi.ini
... adjust param
root@7e75997c39fb:/app# kill -SIGHUP 1
... restarts uwsgi

Root cause: while the plain origin page with filters send "only" a 12K URL, choosing to Subset composes a request where sample names are in a list: 410059,410247,410910.. which URL Encoded gives: 410059%2C410247%2C410910 -> 2 more chars per sample ID -> more than 16K in total with the rest of HTTP request e.g. auth cookies.
There is probably no real need for this URLEncode

a solution will really be needed with collections (more samples )