Docker compose is not picking up the latest changes

Hello, I have a Zookeeper docker image which runs perfectly fine when started as a standalone container but it gets exited with the below error message while starting with docker compose.

Using config: /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
mkdir: cannot create directory ‘/opt/tuc/express/apache-zookeeper-3.9.1-bin’: Permission denied
2024-04-05 08:03:49,035 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@177] - Reading configuration from: /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
2024-04-05 08:03:49,038 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@431] -
clientPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@444] - secureClientPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@460] - observerMasterPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@477] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
Invalid config, exiting abnormally
2024-04-05 08:03:49,049 [myid:] - ERROR [main:o.a.z.s.q.QuorumPeerMain@99] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
Caused by: java.lang.IllegalArgumentException: myid file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.checkValidity(QuorumPeerConfig.java:792)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupQuorumPeerConfig(QuorumPeerConfig.java:663)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:487)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:194)
… 2 common frames omitted
2024-04-05 08:03:49,050 [myid:] - INFO [main:o.a.z.a.ZKAuditProvider@42] - ZooKeeper audit is disabled.
2024-04-05 08:03:49,051 [myid:] - ERROR [main:o.a.z.u.ServiceUtils@48] - Exiting JVM with code 2

As you can see in the highlighted text above, it is trying to create a directory for older version of the zookeeper (mkdir: cannot create directory ‘/opt/tuc/express/apache-zookeeper-3.9.1-bin’: Permission denied) while this image is for zookeeper 3.9.2.
I have nothing related to zookeeper 3.9.1 in my dockerfiles or docker compose or in my environment files and as I mentioned, it works perfectly fine with the standalone containers.

Any suggestions please?

I have already tried docker-compose up -d --force-recreate && docker-compose up --build . but it didn’t help.


Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

Thank you @rimelek

I have a Zookeeper docker image which runs perfectly fine when started as a standalone container but it gets exited with the below error message while starting with docker compose

Using config: /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
mkdir: cannot create directory ‘/opt/tuc/express/apache-zookeeper-3.9.1-bin’: Permission denied
2024-04-05 08:03:49,035 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@177] - Reading configuration from: /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
2024-04-05 08:03:49,038 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@431] -
clientPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@444] - secureClientPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@460] - observerMasterPort is not set
2024-04-05 08:03:49,039 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@477] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
Invalid config, exiting abnormally
2024-04-05 08:03:49,049 [myid:] - ERROR [main:o.a.z.s.q.QuorumPeerMain@99] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /opt/tuc/express/apache-zookeeper-3.9.2-bin/conf/zoo.cfg
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:198)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
Caused by: java.lang.IllegalArgumentException: myid file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.checkValidity(QuorumPeerConfig.java:792)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.setupQuorumPeerConfig(QuorumPeerConfig.java:663)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:487)
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:194)
… 2 common frames omitted
2024-04-05 08:03:49,050 [myid:] - INFO [main:o.a.z.a.ZKAuditProvider@42] - ZooKeeper audit is disabled.
2024-04-05 08:03:49,051 [myid:] - ERROR [main:o.a.z.u.ServiceUtils@48] - Exiting JVM with code 2

As you can see in the highlighted text above, it is trying to create a directory for older version of the zookeeper (mkdir: cannot create directory ‘/opt/tuc/express/apache-zookeeper-3.9.1-bin’: Permission denied) while this image is for zookeeper 3.9.2.
I have nothing related to zookeeper 3.9.1 in my dockerfiles or docker compose or in my environment files and as I mentioned, it works perfectly fine with the standalone containers.

Any suggestions please?

All I can see is that it loads a config file from a folder and wants to create another folder. The reason can’t be Docker, but an application or configuration error. The log shows the config is invalid:

It also mentions quorumpeerconfig and a missing file. Maybe you mount a wrong config to the container. If you need help with finding out what went wrong in the config, please, share a compose file or docker cli commands that you use to create and start the container and the content of the config file could help too, but I used zookeeper years ago and didn’t have to configure it actually.

Thank you @rimelek One of the volumes loading the config was not doing it properly for some reason. I re-created the volume and it has fixed the issue.