So best thing to do when troubleshooting a docker container is to use docker logs <container-id>
in this case docker logs sensu-backend
You may be able to find an error message that gives you some insight.
But in this case, If I were a betting man… I’d bet you a doughnut the volume mount option is probably the problem. It could be that you are trying to volume mount a directory from the host system /var/lib/sensu to act as /var/lib/sensu in the container that you don’t have write permissions to or does not exist. You may need to adjust the volume mount argument in the example command to work for you Windows system. I can’t tell you what that argument should be, it just needs to be a directory you can write to so docker can mount it and use it to persist database information to.
You can start by just removing the -v /var/lib/sensu:/var/lib/sensu and see if that lets you get unstuck.
But ideally, you’ll want a persistent volume mount for /var/lib/sensu as this holds the backing store database for etcd, for your configuration. If you don’t have a persistent mount for this directory, you’ll lose state when you destroy the container (essentially losing all the work you did to configure your sensu resources…so having a persistent volume mount for that directory is very useful).
I removed everything from docker desktop (clean/purge data) in order to start over from scratch.
I tried both removing the -v /var/lib/sensu:/var/lib/sensu from the command and replacing /var/lib/sensu with c:/data/ (i.e. -v c:/data/:/var/lib/sensu). Unfortunately neither made any difference.
Hmm,
the logs definitely indicate there is a problem with the embedded etcd service coming up…which is unexpected.
I’ll dig up a windows 10 with docker tonight and try to reproduce.
Running docker my Fedora desktop just works…so I’m a little surprised this is falling over on Docker on Windows. It should just work.
How well do you know how to inspect a running docker container using the docker cmdline tool?
I think docker inspect will let you get the details … id be interested to see if docker sees tcp 2379 port is as exposed inside the service.
output of docker inspect sensu-backend has all the info.
Be careful about posting that… it has ENV secrets…so
you are looking for a section called ‘ExposedPorts’
should look like this.
Hey,
So i just did a fresh instal of Docker for Windows 10 Pro,
The sensu instructions minus the volume mount argument definitely worked as I expected.
I was able to get to the dashboard just fine
Not sure what to tell you, it;s probably something in your docker setup but since I didn’t hit the problem myself its gonna be difficult for me to give you a good idea where to look. I think docker on windows is already sort of a special kinda magic, since there is a linux kernel somewhere deep in the guts of this.
I will say that when I installed the latest Docker for Windows it required me to install the WSL 2 components and do a couple of restarts of the OS before it was usable at all. But once I was able to run the Docker for Windows provided tutorial, the sensu backend install worked as I expected.
Thanks again for taking the time to help out! When looking at the output of docker inspect sensu-backend everything looks perfectly fine. I’m guessing something is wrong with my Win 10 + docker desktop + wsl - combo. I think I’ll resort to setting this up in a linux VM instead. I’ll keep in mind to post here if I’ll ever find out what was the cause of the issue.
Thanks!