Getting errors during machine startup

Started getting the following errors over the past week, not sure whats changed on a standard laravel deploy:

[error][PC01] instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)

[error][PR04] could not find a good candidate within 20 attempts at load balancing

This usually leads to a 502 error, after a refresh it works fine until the machine auto stops.

I’ve tried adding the HOSTNAME=“0.0.0.0” to fly.toml, and resetting the machines with the same errors.

Can you start it locally in Docker?

Is the machine still running after it fails, such that you could console-ssh in, and root around for debug info or reasons why the listener failed?

Yeh starting it locally works fine, no error messages. This is specifically when the fly machines spin down after inactivity.

See below for a local startup;

2025-04-03 01:38:32,646 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2025-04-03 01:38:32,647 INFO Included extra file "/etc/supervisor/conf.d/fpm.conf" during parsing
2025-04-03 01:38:32,647 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
2025-04-03 01:38:32,652 INFO RPC interface 'supervisor' initialized
2025-04-03 01:38:32,652 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2025-04-03 01:38:32,652 INFO supervisord started with pid 1
2025-04-03 01:38:33,666 INFO spawned: 'php' with pid 19
2025-04-03 01:38:33,706 INFO spawned: 'nginx' with pid 20
[03-Apr-2025 01:38:33] NOTICE: fpm is running, pid 19
[03-Apr-2025 01:38:33] NOTICE: ready to handle connections
[03-Apr-2025 01:38:33] NOTICE: systemd monitor interval set to 10000ms
2025-04-03 01:38:34,821 INFO success: php entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-04-03 01:38:34,821 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Coolio. Can you shell into that machine and run netstat to see if Nginx has a running listener?

Also check the logs in /var/log/supervisord.log in case the Nginx process crashed/exited after the healthy report.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.