Problem running container on Docker Windows

Hi all,

I’m trying to get manager V3.0 running on Windows 10 (build 19041.685)
When starting the container it will immediately exit (1).

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
72cf15f15b46 openremote/manager:latest “/bin/sh -c 'java $J…” 15 seconds ago Exited (1) 13 seconds ago

$ docker logs 72
Picked up JAVA_TOOL_OPTIONS:
Exception in thread “main” java.lang.ExceptionInInitializerError: LOGGING_CONFIG_FILE is not readable: /deployment/manager/logging.properties
at org.openremote.container.util.LogUtil.configureLogging(LogUtil.java:53)
at org.openremote.container.Container.(Container.java:62)
at org.openremote.manager.Main.main(Main.java:28)

I have spent a long time looking for a solution but no luck yet…
Could someone give me a hint?
Thanks in advance.

These are the versions I’m using:

$ docker-compose version
docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c 28 May 2019

$ docker -v
Docker version 20.10.0, build 7287ab3

$ docker-machine -v
docker-machine.exe version 0.16.0, build 702c267f

$ docker-compose -v
docker-compose version 1.27.4, build 40524192

$ java -version
java version “1.8.0_271”
Java™ SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot™ Client VM (build 25.271-b09, mixed mode)

$ node -v
v14.2.0

$ git --version
git version 2.29.2.windows.3

$ yarn -v
1.22.4

Try this procedure:

$ docker-compose down
$ docker-volume rm openremote_deployment-data
$ docker-compose up -d --no-build

Hi Michael,

Thanks for responding.
docker-compose down gives me this error:
Can’t find a suitable configuration file in this directory or any
parent. Are you in the right directory?

I’m just starting with Docker so if this is a stupid question apologies in advance…

You should find docker-compose.yml file either in current directory or give a path to the file with -f parameter.

Openremote stack is difficult to run on pure docker run. The problem is that one image is necessary to create a data volume when the other image uses it. The order in which these images are run is crucial, hence running it with docker-compose is advised. This of course wouldn’t work with other orchestration tools like docker swarm or kubernetes. Swarm image tries to solve this nuisance with embedding the data volume into image. You can use it instead of ‘openremote/manager’ image. You can find it here https://hub.docker.com/r/openremote/manager-swarm and it is in sync with the main branch.

docker-compose.yml is not found on my system.
Can I copy it from somewhere or create it myself?

docker-compose.yml is in the root directory of the openremote repo.

Which procedure of starting the openremote stack are you following? Perhaps we should refine the steps.

I’m not sure what procedure I should follow. For the moment I’m just curious on how V3 looks.
a Demo setup is the first thing I suppose

Making progress. I’ve reset the docker machine so we make a clean start and here are the commands so far. Only the last step seems to have a problem:

$ docker-compose up -d --no-build
Creating network “openremote-master_default” with the default driver
Creating volume “openremote-master_proxy-data” with default driver
Creating volume “openremote-master_deployment-data” with default driver
Creating volume “openremote-master_postgresql-data” with default driver
Creating volume “openremote-master_zwave-data” with default driver
Service ‘deployment’ needs to be built, but --no-build was passed.

$ docker swarm init

$ docker stack deploy --compose-file swarm-docker-compose.yml openremote
Creating network openremote_private
Creating network openremote_public
Creating service openremote_keycloak
Creating service openremote_postgresql
Creating service openremote_proxy
Creating service openremote_manager

$ docker-compose up --build
The Docker Engine you’re using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use docker stack deploy.

Building deployment
Step 1/5 : FROM debian:stretch-slim
stretch-slim: Pulling from library/debian
Digest: sha256:eb436e834ba416c45359aa0709febef17fdea65ab6a8f4db12016aa2fa63be0c
Status: Downloaded newer image for debian:stretch-slim
—> b87fae470195
Step 2/5 : ARG GIT_COMMIT=unknown
—> Running in 0d356ce29f76
Removing intermediate container 0d356ce29f76
—> 9df7a37aa92a
Step 3/5 : LABEL git-commit=$GIT_COMMIT
—> Running in c8bc6f53dcf4
Removing intermediate container c8bc6f53dcf4
—> 6c9f5d63580c
Step 4/5 : RUN mkdir -p /deployment/extensions
—> Running in 58d6260eb19c
Removing intermediate container 58d6260eb19c
—> 64c9072b6bb5
Step 5/5 : ADD build /deployment
Service ‘deployment’ failed to build : ADD failed: file not found in build context or excluded by .dockerignore: stat build: file does not exist

There is too much you want to do at once. It isn’t all necessary. From your steps, the docker stack deploy... seems to work. After it you can check it with docker service ls command.

Remove stacks created with docker-compose, i.e. docker-compose down. Swarm orchestrator gives the most resilient deployment, therefore you can stick with it.

Obviously, the docs need improvement for docker beginners.

docker ps tells me that all 4 containers are up and healthy.
docker service ls:
ID NAME MODE REPLICAS IMAGE PORTS
q06y7u9g6byc openremote_keycloak replicated 1/1 openremote/keycloak:latest *:8081->8080/tcp
w3wxa42h4ric openremote_manager replicated 1/1 openremote/manager-swarm:latest
9fbrzfakmwpi openremote_postgresql replicated 1/1 openremote/postgresql:latest
cbfxrvvv3052 openremote_proxy replicated 1/1 openremote/proxy:latest *:80->80/tcp, *:443->443/tcp

However when I try to connect on http I get “internal server error”

You are one step closer. The stacks is deployed and there are no errors on docker level. Now you can debug where the 500 error comes from, most probably from the manager. Check

$ docker service logs openremote_manager -f

no errors in openremote-manager…
however I see this log entry for openremote-proxy:
[ALERT] 356/084536 (34) : parsing [/etc/haproxy/haproxy.cfg:81] : ‘server proxy_backend_host’ : could not resolve address ‘manager’.
could this be the problem?
I also tried 3 different browsers with a cleaned cache. Same result.

Yes, this can be the problem. Seems like you have problems with networks. Of course you can try to debug it with docker networks ..., but I think that network inconsistency is caused by unsuccessful mixing stack deploy with docker-compose. The best way is to delete stack, prune system and start again.

$ docker stack rm openremote
$ docker system prune -f
$ docker stack deploy --compose-file swarm-docker-compose.yml openremote

Could you give me some insight on the relation of the different network adapters and IP adresses?
This is what I have now:
Local ethernet 192.168.x.x
Ethernet adapter vEthernet (Default Switch): 172.22.112.1
Ethernet adapter vEthernet (WSL): 172.20.128.1
Docker bridge 172.17.0.0 gateway 172.17.0.1
Docker docker_gwbridge 172.19.0.0 172.19.0.1

  • several ip adresses in 172.19.0.x
    Which process is handling the routing between the subnets?

This the whole magic of docker, it manages routing. Actually it just configures routing tables behind the scene, so you don’t have to do it manually. Nevertheless, if you want some more insights try the following

$ docker network ls
$ docker network inspect openremote_public
$ docker network inspect openremote_private

Both openremote_public and private are in the same subnet as Docker.
It looks fine to me.
That leaves the resolve problem. Shouldn’t this be done bij the proxy?
So “manager” should be resolved in something.

Do you see attached manager and proxy containers when you inspect _private network? Here is what I see on my demo:

...
        "Containers": {
            "0a5527f52beb638d9ca8625f45c0936c49127217c3f079a8bbb952affec56642": {
                "Name": "demo_proxy.1.twxm39mza2mdiemedzgvgls0y",
                "EndpointID": "4193a731c131643216202cba3c23ab3b995c6a7b63a3943feaf241800e14a6ae",
                "MacAddress": "02:42:0a:00:05:18",
                "IPv4Address": "10.0.5.24/24",
                "IPv6Address": ""
            },
            "2c0d94a123dac79b020e8e28cd5cdaee743f2953c4948bc0844361cbd857d08d": {
                "Name": "demo_manager.1.kf9cli9nbh0xvrrsl6j7uj12t",
                "EndpointID": "a99bb0ab73881a268450b10aa820ba457db78a88e5fd1cf14ad3093cafb5b6a5",
                "MacAddress": "02:42:0a:00:05:17",
                "IPv4Address": "10.0.5.23/24",
                "IPv6Address": ""
            },

Have you tried removing and redeploying the stack? Are there any errors/warnings when networks are created?

I did a factory reset of Docker. After that there were no containers, services or networks.
a clean install gives only one error the same as before in docker-compose up --build:

Step 5/5 : ADD build /deployment
Service ‘deployment’ failed to build : ADD failed: file not found in build context or excluded by .dockerignore: stat build: file does not exist

All services started but the error 500 remains.

Why are you running docker-compose up --build?

Anyway, you have to decide, either you want to run the stack with docker-compose or docker stack deploy. Both methods are different and shouldn’t be used together.

Ok, still learning :slight_smile:
What commands should I use with a clean setup if I want docker-compose ?