Hello Romain
Thanks for your feedback and for describing us all the problem. Indeed, something has to be wrong there. At least it should not time out.
First, I would propose to adjust a little permissions. If your webserver/PHP works with user and group www-data:www-data then your current setting with user bacula in www-data group can not work in some cases. I would propose to do the opposite, assign the www-data user to the bacula group and tune ownership a bit.
# remove bacula user from www-data
gpasswd --delete www-data bacula
# add www-data user to bacula group
usermod -a -G bacula www-data
# set permissions for bacula files
chown root:bacula /etc/bacula/bacula-{dir,sd,fd}.conf /etc/bacula/bconsole.conf
# restart PHP-FPM (example for version 7.4):
systemctl restart php7.4-fpm
Once we have the permissions ready, next thing what could be checked is - what causes this timeout. The easiest way of checking is is to load the page that loads slowly and quickly at the same time see the system process list on the host with Bacularis. Just simple "ps auxfwww" is sufficient. This way we will see what causes that the process times out.
From my perspective it can be bconsole process but you will see. I know, you showed that in the command line this bconsole works well, thanks for this test, however using bconsole from the command line and using it in a web application can be a bit different in results, not because of permissions but because of other things.
Once we know the process that takes most of the time until timeout, we will know what to do. Also I would propose to consider adding to the web server log information about how much time every request takes. Information about how to do it you can find in this mail thread on this group:
https://groups.google.com/g/bacularis/c/x0NLsBD24IMSo, the access log will look like here:
127.0.0.1 - - [18/Jun/2024:09:11:46 +0200] "GET /api/v3/jobs/?limit=15000&director=darkstar-dir HTTP/1.1" 200 202822 "-" "-" 1148ms
127.0.0.1 - - [18/Jun/2024:09:11:47 +0200] "GET /api/v3/joblog/messages?director=darkstar-dir HTTP/1.1" 200 66 "-" "-" 247ms
and we see that the first request to get jobs took 1.1 seconds, and second to get joblog messages took 0.2 second. It helps to find which request is the slowest and causes time out.
For now that is all. Good luck with checking the above. Please let us know about the results.
Best regards,
Marcin Haba (gani)