Open rushout09 opened 8 months ago
Thanks for the report.
When backend prod runs, it calls out to the program gunicorn
. However gunicorn program is only available once the virtual env is activated by source venv/bin/activate
. Simply calling venv/bin/reflex
is insufficient as that takes care only of libraries within the Python process.
This exposes a bug in the way to propagate errors though - it should have been straightforward from logs ("gunicorn not found"). #2296 above will address this.
@jackie-pc is there a way to properly initialize venv using systemd?
You would initialize like how you normally would. source ...../activate
. E.g.
source ...../activate && reflex run
. You can try that in ExecStart:
(not sure about exact Systemd support for &&
). Putting it in a custom run_from_systemd.sh
script that contains the same shell snippet would definitely work. You would call run_from_systemd.sh
from ExecStart
got it. thanks will try this
Describe the bug in systemd: env DEV work env PROD fails
running manually : both works
To Reproduce Steps to reproduce the behavior:
Create a systemd file
sudo systemctl daemon-reload sudo systemctl start test.service
Expected behavior ubuntu@ip-172-31-41-251:~$ sudo lsof -i -P -n | grep LISTE systemd-r 325 systemd-resolve 14u IPv4 15785 0t0 TCP 127.0.0.53:53 (LISTEN) sshd 565 root 3u IPv4 17438 0t0 TCP :22 (LISTEN) sshd 565 root 4u IPv6 17449 0t0 TCP :22 (LISTEN) reflex 6894 ubuntu 13u IPv4 68388 0t0 TCP :8000 (LISTEN) python3 6927 ubuntu 13u IPv4 68388 0t0 TCP :8000 (LISTEN) next-serv 6957 ubuntu 20u IPv6 69656 0t0 TCP *:3000 (LISTEN)
Screenshots If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
Additional context Add any other context about the problem here. https://discord.com/channels/1029853095527727165/1184109557946003576