rapidfort / community-images

:gem: RapidFort hardened secure images
https://www.rapidfort.com
MIT License
218 stars 39 forks source link

[Bug]: Error in container startup when going for cluster setup in rapidfort/couchdb-official #611

Open utkarsh-1905 opened 6 months ago

utkarsh-1905 commented 6 months ago

Name and Version

rapidfort/couchdb-official:3.3.3

Which runtime are you using to reproduce this issue?

Is this issue reproducible on the original source image?

Reproducible

Could you please identify the category? Details in TROUBLE_SHOOTING.md

Unknown

What steps will reproduce the bug?

Run the container using the following command docker run -d --name rcdb-3e -e COUCHDB_SECRET=hello -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password -e ERL_FLAGS="-setcookie brumbrum" -e NODENAME=couchdb1 rapidfort/couchdb-official:3.3.3 The container should exit.

Are you using any custom parameters or values?

Yes, -e NODENAME=couchdb1 , the error is coming on passing this variable

No response

What is the expected behavior?

The container should start normally

What do you see instead?

sh: 1: /opt/couchdb/bin/../erts-12.3.2.14/bin/epmd: Exec format error as it is not able to parse it. I believe it has similar reasons related to env as #610

Additional information

This prevents the user to create a cluster setup directly. Other environment variables are parsed only this is one is crashing the container. Docs and requirement of the NODENAME variable.

Rapidfort Image => rapidfort/couchdb-official:3.3.3 tested against => couchdb:3.3

utkarsh-1905 commented 6 months ago

When manually writing the variable in /opt/couchdb/etc/vm.args the same error is being thrown and container crashes. Screenshot from 2024-05-21 09-54-01

To reproduce:

  1. docker exec -it rcdb-3 cat /opt/couchdb/etc/vm.args > vm.args
  2. Add -name couchdb@127.0.0.1 (from docs) at the end of this file.
  3. Copy the file docker cp <your-local-path>/vm.args rcdb-3:/opt/couchdb/etc/
  4. Restart the container, it will crash

Other ways to test out: Screenshot from 2024-05-21 09-25-12 At port 5985 is the official image of couchdb running where as on 5984, rapidfort/couchdb-official is running, we can see that in the first container, clustering is working fine and setup is done, where as in second container its giving an error due to above mentioned causes