Open Martinsos opened 1 year ago
We decided to close this one for now, as it is not so simple for us to correctly detect if docker deamon is not running, and result will be us investing work into at the end mostly forwarding docker errors while they are already being forwarded. We can reopen if the need is great and then consider the solution again, but at this moment I think it is not worth the effort.
I would maybe consider doing the most basic check possible (without parsing the error that Docker produces and doing some smart error reporting). Just some simple output modification if docker info
errors.
If we detect an exit code 1 from docker info
or similar we alter the output to be:
docker info
to see (or we just show the output)and that's it.
I feel it improves the experience for our users since Wasp exits earlier and doesn't give mixed signals (here's the connection string but also an error).
Custom error message gives the opportunity to educate our users as well:
Some thing is off, make sure that Docker is installed AND running
You can install Docker like this ...
Ok so the main purpose of this is to run it first, so they see that first, and don't have a feeling that db started already. Ok makes sense!
I am voting for forwarding the error output to them, but also telling them to investigate on their own.
We could possibly even go a step further then and try to figure out if error was caused by the fact that docker daemon is not running, and if so, let them know that explicitly. But we can also skip that.
Btw I just quickly tested if docker info actually does return error when docker deamon is not running, and ok yeah, it seems it does -> I had to stop both docker.service and docker.socket though, stopping just docker.service wasn't enough, but I guess that makes sense? I don't know enough which does what, would have to investigate.
@modotte @infomiho gave some fresh ideas here on how to approach this simply, so if you are still interested, it might be worth trying out this new direction. If you are occupied with other stuff don't worry, no expectations here, just wanted to keep you in the loop :).
User on Discord found docker missing to be a bit complicated to figure out: https://discord.com/channels/686873244791210014/1216028386829537362/1216028386829537362 .
This is what it currently looks like:
While I thought message here is clear ("Is the docker daemon running") it turns out, based on feedback, that it is easy to miss. So it would be much better if we detected this explicitly with Wasp and provided a nice, explicit error message about it + some instructions on how to go about it.
We will probably want to run
docker info
and parse its output to determine if docker daemon is running or not.