Solution
add the following line to /etc/uwsgi/apps-available/searx.ini
buffer-size = 5120
Reference
uWSGI Options [uwsgi-docs.readthedocs.io]
Root Cause
searx preference changes made from the seax web page may create a request which exceeds the uwsgi buffer size. If the problem comes back you can check the request size in /var/log/uwsgi/app/searx.log filtering for error messages similar to this:
at May 6 09:36:14 2023 - invalid request block size: 4604 (max 4096)…skip
You would then add a bit more to than 4604 to estimate a new buffer size to allow that searx request. I am going up from the default of 4096 in steps of 125% (4096 to 5120). The uwsgi documentation suggest that this approach is more sensible than just maxing-out the request size.
update 6 may: adding UWSGI_BUFFER_SIZE=5120 did not solve the problem. Here is a log entry for request block size <5120 and uwsgi logging max of 4096 rather than 5120.
- added UWSGI_BUFFER_SIZE=5120 to /etc/init.d/uwsgi
- stopped searx, radicale, and bepasty services
- stopped uwsgi service
- started uwsgi service
- started searx service
at May 6 09:36:14 2023 - invalid request block size: 4604 (max 4096)…skip
quick workaround: delete your freedombox cookies from your browser to revert to default searx client configuration for your browser.
point of suspicion: error in /var/log/uwsgi/app/searx.log:
Sun Apr 30 20:10:00 2023 - invalid request block size: 4612 (max 4096)…skip
perhaps the uwsgi buffer is undersized?
Problem Description
When setting search engines for searx using the client web GUI (my.freedombox.rocks/searx) I will receive a 500 error.
Steps to Reproduce
- log in to freedombox
- go to the searx application shortcut
- select the searx preferences link in the upper right corner
- select the engines tab
- selecting all video search providers seems to be a reliable way to generate this error.
Expected Results
After a successful configuration change is saved the browser returns to the searx query page.
Actual results
I receive a 500 error in the web browser
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.56 (Debian) Server at
Error in /var/log/uwsgi/app/searx.log:
Sun Apr 30 20:10:00 2023 - invalid request block size: 4612 (max 4096)…skip
Screenshot
Information
- FreedomBox version:
You are running Debian GNU/Linux 11 (bullseye) and FreedomBox version 23.6. FreedomBox is up to date.
- Hardware: Supermicro A2SDi-2C-HLN4F board with Intel Atom C3338, intel chipset
- How did you install FreedomBox?:
- debian stable net-inst
- DEBIAN_FRONTEND=noninteractive apt-get install -y freedombox (more than a year ago)
Analysis:
- error message includes, “invalid request block size”
- this could be related to UWSGI_BUFFER_SIZE=4096 (default) being too small
I’m willing to try setting the buffer to a larger size, say 8192. I have memory to spare and I think my FreedomBox can could deal with doubling this size to eliminate this as a source of the problem. It appears that uwsgi uses a global configuration in /etc/init.d/uwsgi where I see no explicit UWSGI_BUFFER_SIZE set. I’m not sure if this will wreck my server, though.