bin/logs Script Fails to Display Logs on Host, Logs Only Accessible Inside Container Description
I am using the Overleaf Toolkit to deploy Overleaf Community Edition (CE) via Docker. When attempting to view logs using the bin/logs script on the host machine (e.g., bin/logs -f web), the output is blank. However, I can find and view the log files (e.g., /var/log/overleaf/web.log) inside the container's shell after executing bin/shell. This indicates that logs are being generated but are not accessible via the bin/logs script as expected.
This issue hinders debugging and monitoring from the host machine, as I must manually enter the container to access logs. I believe this could be a configuration or scripting issue with the Toolkit's log retrieval mechanism.
as6325400@overleaf:~/overleaf-toolkit$ bin/logs web
as6325400@overleaf:~/overleaf-toolkit$ sudo bin/shell
root@60fd7209b119:/overleaf# ls -l /var/log/overleaf
total 220
-rw-r--r-- 1 root root 348 May 29 12:06 chat.log
-rw-r--r-- 1 root root 22994 May 29 12:06 clsi.log
-rw-r--r-- 1 root root 356 May 29 12:06 contacts.log
-rw-r--r-- 1 root root 808 May 29 13:05 cron-deactivate-projects.log
-rw-r--r-- 1 root root 404 May 29 12:20 cron-delete-projects.log
-rw-r--r-- 1 root root 772 May 29 12:15 cron-delete-users.log
-rw-r--r-- 1 root root 2868 May 29 13:00 cron-project-history-periodic-flush.log
-rw-r--r-- 1 root root 3232 May 29 12:06 docstore.log
-rw-r--r-- 1 root root 872 May 29 12:06 document-updater.log
-rw-r--r-- 1 root root 3530 May 29 12:06 filestore.log
-rw-r--r-- 1 root root 3856 May 29 12:06 history-v1.log
-rw-r--r-- 1 root root 1034 May 29 12:06 notifications.log
-rw-r--r-- 1 root root 370 May 29 12:06 project-history.log
-rw-r--r-- 1 root root 782 May 29 12:45 project-history-retry-hard.log
-rw-r--r-- 1 root root 743 May 29 12:30 project-history-retry-soft.log
-rw-r--r-- 1 root root 10829 May 29 12:38 real-time.log
-rw-r--r-- 1 root root 7102 May 29 12:38 web-api.log
-rw-r--r-- 1 root root 121835 May 29 13:01 web.log
root@60fd7209b119:/overleaf#
Would you mind sharing the output of running bin/doctor? This would help with diagnosing the issue.
Would you mind sharing the output of running
bin/doctor? This would help with diagnosing the issue.
====== Overleaf Doctor ======
- Host Information
- Linux
- Output of 'lsb_release -a':
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
- Dependencies
- bash
- status: present
- version info: 5.1.16(1)-release
- docker
- status: present
- version info: Docker version 27.5.1, build a187fa5
- realpath
- status: present
- version info: realpath (GNU coreutils) 8.32
- perl
- status: present
- version info: 5.034000
- awk
- status: present
- version info: GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
- openssl
- status: present
- version info: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
- docker compose
- status: present
- version info: Docker Compose version v2.32.4
- Docker Daemon
- status: DOWN !
====== Configuration ======
- config/version
- status: present
- version: 5.4.3-with-texlive-full
- config/overleaf.rc
- status: present
- values
- OVERLEAF_DATA_PATH: data/overleaf
- OVERLEAF_LOG_PATH: not set, keeping logs in container
- SERVER_PRO: false
- SIBLING_CONTAINERS_ENABLED: false
- OVERLEAF_LISTEN_IP: 0.0.0.0
- OVERLEAF_PORT: 9000
- MONGO_ENABLED: true
- MONGO_IMAGE: mongo
- MONGO_VERSION: 6.0
- MONGO_DATA_PATH: data/mongo
- REDIS_ENABLED: true
- REDIS_IMAGE: redis:6.2
- REDIS_AOF_PERSISTENCE: true
- REDIS_DATA_PATH: data/redis
- NGINX_ENABLED: false
- NGINX_CONFIG_PATH: config/nginx/nginx.conf
- TLS_PRIVATE_KEY_PATH: config/nginx/certs/overleaf_key.pem
- TLS_CERTIFICATE_PATH: config/nginx/certs/overleaf_certificate.pem
- NGINX_HTTP_LISTEN_IP: 127.0.1.1
- NGINX_HTTP_PORT: 80
- NGINX_TLS_LISTEN_IP: 127.0.1.1
- TLS_PORT: 443
- GIT_BRIDGE_ENABLED: false
- config/variables.env
- status: present
- values
/home/as6325400/overleaf-toolkit/config/variables.env: line 41: email: command not found
I discovered that the reason bin/logs produced no output was because I didn't use sudo. The command at line 81 suppresses all errors using 2>/dev/null || true, which also hides permission denied messages. This made it harder to understand what went wrong.
Is there a reason why this line swallows all errors silently?