5

I just started using Laravel Sail (v1.4.7) and if I run this:

sail up -d

Then all container started.

Then I try run this:

sail composer dump-autoload

And the response is:

projectname-               docker-              Exit 1
Shutting down old Sail processes...
Sail is not running.

You may Sail using the following commands: './vendor/bin/sail up' or './vendor/bin/sail up -d'

I tried to run composer dump-autoload without sail, and it's working fine. But this isn't run inside the container (so maybe it'll run on different versions in the future).

UPDATE:

I run my containers in WSL2, Ubuntu 20.04.

Why shutting down containers at this point? But actually not just this command occurs shut down. Every sail ... command occurs the same.

Any idea?

netdjw
  • 5,419
  • 21
  • 88
  • 162
  • 4
    Could you see if `docker-compose ps` contains any exited services after running `sail up -d` ? In my case Meilisearch wasn't properly starting, because of an issue with Docker on ARM. Sail does a check for any exited services and stops if any were found. Disabling Meilisearch in docker-compose.yml temporarily fixes the issue, until a fix is released. – Sander Mar 16 '21 at 14:32
  • I did `docker-compose ps` and I see that my mysql service has `Exit 1` state. What do I do to fix it? I use default `docker-compose.yaml` file – Andrew P. Apr 06 '21 at 19:15
  • 3
    In my case, mysql container wasn't booting because I was using DB_USER=root and it complains. At least on macos. On linux I don't think it does. Remember to check `sail up`logs – mwm May 05 '21 at 22:53
  • exactly 1 year ago the sql user being called root was fine for me, but changing it today from root has fixed this – Ben Gooding Dec 23 '21 at 16:22

2 Answers2

1

If any containers in your docker-compose.yml file in the root of your project do not start properly for any reason, then Laravel Sail will do this. The solution is to make sure all containers start. The reason for a container not starting would be a separate question since there is a multitude of reasons why this could happen.

Try commenting out the service of a failing container in docker-composer.yml to confirm this is the problem.

Jason
  • 4,411
  • 7
  • 40
  • 53
0

Just like @mwm suggested in the comment it can be related to the username of the database.

I just had the same issue and it was related to username. After I have changed username root to something else it started working fine.