Open lokingwei opened 5 years ago
After investigation with the broken container, here's my finding:
In the broken container (the one didn't get gracefully shut down).
If I execute npm start
, it throws me this error:
Error: There is already a server running! Use the option '--force' to stop it and start another one.
However, on the second execution of npm start
, the server starts successfully.
If I execute npm start -- --force
, it throws me:
Terminated
And the same, the second execution of npm start -- --force
, the server starts successfully.
Have had the same issue, rebuilding container with --no-cache
flag helps
I fixed the issue by stopping the server, and then starting it again.
there is a laravel-echo-server.lock
file created, if you delete that it should work
there is a
laravel-echo-server.lock
file created, if you delete that it should work
L A R A V E L E C H O S E R V E R
version 1.6.2
⚠ Starting server in DEV mode...
events.js:174 throw er; // Unhandled 'error' event ^
Error: listen EADDRINUSE: address already in use :::6001
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1415:7)
at Server.httpServer (/usr/local/lib/node_modules/laravel-echo-server/dist/server.js:72:20)
at /usr/local/lib/node_modules/laravel-echo-server/dist/server.js:38:31
at new Promise (
that's not the best solution, but it works so u need to change start script definition in your package.json file in docker config like this
"scripts": {
"start": "find / -type f -name 'laravel-echo-server.lock' -delete && laravel-echo-server start"
}
and rebuild the docker also u can try to use '/usr/src/app/' instead of '/' in find command as well or another directory set in your WORKDIR section of dockerfile, for me it works well and i'm happy)
I used laradock setting to create laravel-echo-server container which running in VM. Whenever I shutdown the VM ungracefully (a.k.a force shut down), I unable to start back the server within the same container.
Unfortunately, there's no log or error code for me to indicate what is happening.
The only output I have is:
My Dockerfile:
My package.json
My laravel-echo-server.json
My docker-compose.yml: