Description
Sail Version
1.37.0
Laravel Version
11.29.0
PHP Version
8.3.12
Operating System
macOS
OS Version
15.1 (Apple M1 Pro)
Description
After stopping all Sail containers with sail down
and even fully quitting Docker Desktop, the Laravel log file (storage/logs/laravel.log
) continues to receive error entries. This behavior is unexpected since no Docker containers should be actively running or producing logs at this point.
I initially identified this issue while working with Laravel Telescope (bug report filed here), where Telescope kept logging connection errors every minute, indicating SQLSTATE[08006] [7] could not translate host name "pgsql"
.
Additional Context
I’ve confirmed that:
- No other PHP, artisan, or PostgreSQL processes are running on the host machine.
- Manually clearing Laravel caches and stopping any local services does not prevent the logs from receiving new entries.
This issue may be related to how Laravel Sail (or Docker Desktop) handles host name resolution (host.docker.internal
vs. pgsql
) and could be a source of persistent network activity even after containers are stopped.
Let me know if any further information is needed to investigate this behavior.
Steps To Reproduce
- Set up a new Laravel project using Laravel Sail
- Follow the Local Only Installation section in the Telescope documentation
- Monitor your
storage/logs/laravel.log
file. - You will see a lot of
SQLSTATE
errors. - Stop Sail using
sail down
. - Quit Docker Desktop entirely.
- Observe that
laravel.log
continues to log errors
[2024-11-07 22:27:19] local.ERROR: SQLSTATE[08006] [7] connection to server at "pgsql" (127.0.0.1), port 5432 failed: Connection refused