bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.97k stars 9.2k forks source link

auth.usernames, passwords, database not working? #17998

Closed nickpapadonis closed 1 year ago

nickpapadonis commented 1 year ago

Name and Version

bitnami/mongodb

What architecture are you using?

None

What steps will reproduce the bug?

 auth:
    rootPassword: "XXX"
    usernames:
      - mern-0
    passwords:
      - test
    databases:
      - mern-0

Are you using any custom parameters or values?

I'm trying to automatically add a database, user role for it and password. I use above Yaml, however, I find this user is not created.

What is the expected behavior?

Database user and password created

What do you see instead?

Nothing

migruiz4 commented 1 year ago

Hi @nickpapadonis,

Could you please provide more details about your issue? Version of the chart used and steps to reproduce would be helpful.

I have not been able to reproduce your issue using the latest version of the chart:

I have no name!@test-mongodb-5f894f7c4c-dpv4g:/$ mongosh --host 127.0.0.1 --authenticationDatabase admin -p my_password -u root
Current Mongosh Log ID: 64c7989f63661369e65344e3
Connecting to:          mongodb://<credentials>@127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&authSource=admin&appName=mongosh+1.10.1
Using MongoDB:          6.0.8
Using Mongosh:          1.10.1

For mongosh info see: https://docs.mongodb.com/mongodb-shell/

------
   The server generated these startup warnings when booting
   2023-07-31T11:00:09.408+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
   2023-07-31T11:00:10.159+00:00: vm.max_map_count is too low
------

test> db.getUsers( { usersInfo: { forAllDBs: true } } )
{
  users: [
    {
      _id: 'mern-0.mern-0',
      userId: new UUID("77172f25-9259-44f3-9790-233f747477fc"),
      user: 'mern-0',
      db: 'mern-0',
      roles: [ { role: 'readWrite', db: 'mern-0' } ],
      mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ]
    },
    {
      _id: 'admin.root',
      userId: new UUID("cf853052-95ef-4686-9fe0-617fa6ca37be"),
      user: 'root',
      db: 'admin',
      roles: [ { role: 'root', db: 'admin' } ],
      mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ]
    }
  ],
  ok: 1
}
github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.