Notification texts go here Contact Us Buy Now!

How to fix 'Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only' error in windows server 2019 with DockerProvider service

If you encounter the error 'Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only' when using DockerProvider service on Windows Server 2019, you can resolve it by implementing one of the following solutions:

  1. Map a Different Volume:
    • Avoid using the default volume mapping, such as '- rabbitmq:/var/lib/rabbitmq', which may lead to permission issues.
    • Instead, map a specific subdirectory where the cookie file will be created, for example: '- rabbitmq:/var/lib/rabbitmq/mnesia'.
  2. Overwrite Docker Image Command:
    • Assuming the cookie file is located at '/var/lib/rabbitmq/.erlang.cookie', overwrite the docker image command with the following:
    • ["bash", "-c", "chmod 400 /var/lib/rabbitmq/.erlang.cookie; rabbitmq-server"]
    • In your docker-compose file, it would appear as:
    • ... image: rabbitmq:3-management ... ports: - "5672:5672" - "15672:15672" volumes: - ... command: ["bash", "-c", "chmod 400 /var/lib/rabbitmq/.erlang.cookie; rabbitmq-server"]
    • Note that this introduces some technical debt, assuming that the 'rabbitmq-server' command remains unchanged in the future.
  3. Modify docker-compose File:
    • In your docker-compose file, add the following environment variable:
    • rabbitmq: ... environment: RABBITMQ_ERLANG_COOKIE: "rabbitcookie" ...
    • This sets a custom Erlang cookie that will be used by the RabbitMQ container.
  4. Delete '.erlang.cookie' File:
    • Locate the '.erlang.cookie' file on your host system.
    • Delete the file and restart the Docker container.
  5. Change File Permissions:
    • Find the '.erlang.cookie' file on your host system.
    • Change the file permissions to 400 using the 'chmod' command:
      chmod 400 .erlang.cookie
    • Restart the Docker container.

By implementing one of these solutions, you should be able to resolve the 'Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only' error when using DockerProvider service on Windows Server 2019.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.