exaco / laravel-octane-dockerfile

Production-ready Dockerfile for Laravel Octane (FrankenPHP, Swoole, RoadRunner) powered web services and microservices. Done right.
MIT License
613 stars 92 forks source link

Error on clear-scheduler-cache job at startup: (exit status 0; not expected) #70

Closed denistorresan closed 6 months ago

denistorresan commented 6 months ago

Hi, I got this error at startup (I'm using your latest sources). Seems because "php artisan schedule:clear-cache" it's a command and not a deamon. Maybe moving to supercronic will solve the problem? Thank you!

2024-04-23 16:53:25 2024-04-23 14:53:25,805 INFO spawned: 'clear-scheduler-cache_00' with pid 128
2024-04-23 16:53:26 2024-04-23 14:53:26,389 WARN exited: clear-scheduler-cache_00 (exit status 0; not expected)
2024-04-23 16:53:28 2024-04-23 14:53:28,395 INFO spawned: 'clear-scheduler-cache_00' with pid 140
2024-04-23 16:53:28 2024-04-23 14:53:28,989 WARN exited: clear-scheduler-cache_00 (exit status 0; not expected)
2024-04-23 16:53:31 2024-04-23 14:53:31,995 INFO spawned: 'clear-scheduler-cache_00' with pid 159
2024-04-23 16:53:32 2024-04-23 14:53:32,653 WARN exited: clear-scheduler-cache_00 (exit status 0; not expected)
2024-04-23 16:53:33 2024-04-23 14:53:33,655 INFO gave up: clear-scheduler-cache_00 entered FATAL state, too many start retries too quickly
smortexa commented 6 months ago

That's a one-time command. Does your container crash on startup?

denistorresan commented 6 months ago

no, the container only display these errors / warning than continue to work. I think that since this command run and exit, supervisor tries to restart few times before mark as "failed". For a correct log without warnings I added the following configurations on [program:clear-scheduler-cache] :

startsecs = 0
startretries = 1

Now logs does not display any warning:

2024-04-29 10:05:33 2024-04-29 08:05:33,593 INFO spawned: 'clear-scheduler-cache_00' with pid 38
2024-04-29 10:05:33 2024-04-29 08:05:33,623 INFO success: clear-scheduler-cache_00 entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-04-29 10:05:34 2024-04-29 08:05:34,191 INFO exited: clear-scheduler-cache_00 (exit status 0; expected)
denistorresan commented 6 months ago

I sumbitted a PR #72 that solves the warn.