Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Sail continues logging database errors after containers are stopped #749

Open
pejeio opened this issue Nov 8, 2024 · 0 comments

Comments

@pejeio
Copy link

pejeio commented Nov 8, 2024

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

  1. Set up a new Laravel project using Laravel Sail
  2. Follow the Local Only Installation section in the Telescope documentation
  3. Monitor your storage/logs/laravel.log file.
  4. You will see a lot of SQLSTATE errors.
  5. Stop Sail using sail down.
  6. Quit Docker Desktop entirely.
  7. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant