rapidfort / community-images

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

[Bug]:CouchDB Startup Errors- Missing _users Database and Corrupt Mochiweb Module #617

Open Ayush-Vashisht opened 3 months ago

Ayush-Vashisht commented 3 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

RF error

What steps will reproduce the bug?

  1. Pull the Rapidfort/CouchDB Docker Image: docker pull rapidfort/couchdb-official
  2. Create and Start a CouchDB Container: docker run --name rapidfort-couchdb -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password -d rapidfort/couchdb-official:3.3.3
  3. Access the CouchDB Web Interface (Fauxton): http://127.0.0.1:5984/_utils/ It gives error and and the container exit.
  4. Check CouchDB Logs: docker logs rapidfort-couchdb It gives errors indicating issues with the _users database or Mochiweb module.

Are you using any custom parameters or values?

No response

What is the expected behavior?

  1. Logs Should Show Successful Startup: Running docker logs rapidfort-couchdb should show logs indicating successful startup without errors related to _users database or Mochiweb module.
  2. Fauxton Interface Should Be Accessible and Functional: Accessing http://127.0.0.1:5984/_utils/ should load the Fauxton interface without issues. Logging in with admin credentials should work and show the databases.

What do you see instead?

  1. Logs Show Errors: Running docker logs rapidfort-couchdb shows errors related to _users database or Mochiweb module.
  2. Fauxton Interface Shows Errors or Is Inaccessible: Accessing http://127.0.0.1:5984/_utils/ may result in an error page or an incomplete interface. Logging in may fail, or the interface may show errors related to missing databases.

Additional information

CouchDB Version in RapidFort Image: 3.3.3 CouchDB Version in Official Image: 3.3.3 Docker Version: 25.0.3 Operating System: Docker Desktop (which runs Docker containers within a Linux virtual machine)

utkarsh-1905 commented 3 months ago

Hi @Ayush-Vashisht , I tested it out with the same image, the container is not crashing for me, although there is error with setup so its showing unknown_error. For fauxton interface, I believe they removed the frontend to reduce attack surface in rapidfort image also you can mitigate the _users database error by running curl -X PUT localhost:5984/_replicator -u admin. Thanks

Ayush-Vashisht commented 3 months ago

Hey, @utkarsh-1905, There are several errors related to databases not being found, specifically _users and _replicator. These errors suggest that CouchDB is trying to access these databases but they don't exist. After using curl -X PUT http://127.0.0.1:5984/_users & curl -X PUT http://127.0.0.1:5984/_replicator -u admin the error persists. Here is a link to gist which contain errors: https://gist.github.com/Ayush-Vashisht/abe428e32d2ed121cfac74d1cdc3b7f4

utkarsh-1905 commented 3 months ago

Yes I faced these too, the _users error goes away after the curl command, but we need to restart the container to apply the changes, and the _replicator db is an active issue #616

Ayush-Vashisht commented 3 months ago

Yes we need to restart the container to apply the changes. But even after that the error perists and it gets shutdown gist for errors: https://gist.github.com/Ayush-Vashisht/219b3c10a2f6e616137e175c3ae636fb

utkarsh-1905 commented 3 months ago

yes exactly it crashes after the initialization