argosopentech / argosopentech/LibreTranslate-init
Is Nginx required? And PermissionError: [Errno 13] Permission denied: 'db'.
- Dominant language
- Shell
- Stars
- 64
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
First of all, thanks to @argosopentech for developing this product.
I followed [the process](https://github.com/argosopentech/LibreTranslate-init) and the video and installed it on a remote Linux (Ubuntu 24.04), but I couldn't use it.
I couldn't access 127.0.0.1:5000. I did set it during the installation process:
`$ curl 127.0.0.1:5000`
> curl: (7) Failed to connect to 127.0.0.1 port 5000 after 0 ms: Couldn't connect to server
I just ran the command again to set my host to 127.0.0.1, and the following error was returned:
`$ ~/LibreTranslate/env/bin/libretranslate --host 127.0.0.1`
> Traceback (most recent call last):
File "/home/libretranslate/LibreTranslate/env/bin/libretranslate", line 8, in
sys.exit(main())
^^^^^^
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/libretranslate/main.py", line 238, in main
app = create_app(args)
^^^^^^^^^^^^^^^^
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/libretranslate/app.py", line 1225, in create_app
Session(app)
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/flask_session/__init__.py", line 54, in __init__
self.init_app(app)
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/flask_session/__init__.py", line 61, in init_app
app.session_interface = self._get_interface(app)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/flask_session/__init__.py", line 90, in _get_interface
session_interface = FileSystemSessionInterface(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/flask_session/sessions.py", line 322, in __init__
self.cache = FileSystemCache(cache_dir, threshold=threshold, mode=mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/libretranslate/LibreTranslate/env/lib/python3.12/site-packages/cachelib/file.py", line 80, in __init__
os.makedirs(self._path)
File "", line 215, in makedirs
File "", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: 'db'
These commands all return nothing:
`$ netstat -ln | grep 5000`
`$ whereis libretranslate`
`$ whereis gunicorn`
Check the running status:
`$ sudo systemctl status libretranslate`
> ● libretranslate.service - LibreTranslate WSGI with Gunicorn and Nginx
Loaded: loaded (/etc/systemd/system/libretranslate.service; enabled; preset: enabled)
Active: active (running) since Fri 2025-04-25 00:48:58 UTC; 16h ago
Main PID: 21541 (gunicorn)
Tasks: 7 (limit: 9372)
Memory: 647.8M (peak: 796.6M)
CPU: 21.079s
CGroup: /system.slice/libretranslate.service
├─21541 /home/libretranslate/LibreTranslate/env/bin/python /home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
├─21593 /home/libretranslate/LibreTranslate/env/bin/python /home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
├─21594 /home/libretranslate/LibreTranslate/env/bin/python /home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
└─21595 /home/libretranslate/LibreTranslate/env/bin/python /home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
Apr 25 00:48:58 ip-10-0-1-226 systemd[1]: Started libretranslate.service - LibreTranslate WSGI with Gunicorn and Nginx.
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21541]: [2025-04-25 00:48:59 +0000] [21541] [INFO] Starting gunicorn 23.0.0
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21541]: [2025-04-25 00:48:59 +0000] [21541] [INFO] Listening at: unix:libretranslate.sock (21541)
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21541]: [2025-04-25 00:48:59 +0000] [21541] [INFO] Using worker: sync
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21593]: [2025-04-25 00:48:59 +0000] [21593] [INFO] Booting worker with pid: 21593
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21594]: [2025-04-25 00:48:59 +0000] [21594] [INFO] Booting worker with pid: 21594
Apr 25 00:48:59 ip-10-0-1-226 gunicorn[21595]: [2025-04-25 00:48:59 +0000] [21595] [INFO] Booting worker with pid: 21595
Check the configuration:
`sudo nano /etc/systemd/system/libretranslate.service`
> [Unit]
Description=LibreTranslate WSGI with Gunicorn and Nginx
After=network.target
[Service]
User=libretranslate
Group=www-data
WorkingDirectory=/home/libretranslate/LibreTranslate
Environment="PATH=/home/libretranslate/LibreTranslate/env/bin"
ExecStart=/home/libretranslate/LibreTranslate/env/bin/gunicorn --workers 3 --bind unix:libretranslate.sock -m 007 wsgi:app
EnvironmentFile=/home/libretranslate/LibreTranslate-init/.env
Restart=always
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=1
[Install]
WantedBy=multi-user.target
I realized that this doesn't seem to be what I want, because:
1. **My Linux is running Apache instead of Nginx**.
2. **I don't need any GUI, everything should be done programmatically**.
I want to reinstall it through other methods, but considering that more than 10GB of language packs and files have been downloaded, I don't want to delete them and download them again.
Can anyone give me some tips? Thank you.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the installation process and the referenced /etc/systemd/system/libretranslate.service and .env files. Reproduce the service and direct libretranslate --host commands, then trace the PermissionError and socket binding shown in the logs. Done means the supported Apache or non-GUI setup and reuse of existing language packs are clearly documented or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, flask, linux, nginx, python, shell, ubuntu
- Domain
- backend, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100