Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error initializing MongoDB (failed to add role clusterMonitor to user) #119

Open
ccoors opened this issue Oct 27, 2023 · 0 comments
Open

Comments

@ccoors
Copy link

ccoors commented Oct 27, 2023

Hi,

I experience some issues deploying the helm chart v6.4.4 in a test environment. The user_set_role_clusterMonitor.sh generated in mongodb-init-configmap.yaml appears to cause some issues.

Log from the pod:

mongodb 18:55:26.66 INFO  ==> ** Starting MongoDB setup **                                                                                                                                                        
mongodb 18:55:26.67 INFO  ==> Validating settings in MONGODB_* env vars...                                                                                                                                        
mongodb 18:55:26.70 INFO  ==> Initializing MongoDB...                                                                                                                                                             
mongodb 18:55:26.73 INFO  ==> Enabling authentication...                                                                                                                                                          
mongodb 18:55:26.73 INFO  ==> Deploying MongoDB with persisted data...                                                                                                                                            
mongodb 18:55:26.75 INFO  ==> Loading user's custom files from /docker-entrypoint-initdb.d ...                                                                                                                    
mongodb 18:55:29.16 INFO  ==> attempting to add clusterMonitor role to user rocketchat                                                                                                                            
/docker-entrypoint-initdb.d/..2023_10_27_18_55_25.1951182286/user_set_role_clusterMonitor.sh: line 39: ((: ...: syntax error: operand expected (error token is "...")                                             
mongodb 18:55:30.70 ERROR ==> failed to add role clusterMonitor to user "rocketchat"; Error: admin>                                                                                                               
admin> ... ... ... ... ... ... ... ... { ok: 1 }                                                                                                                                                                  
admin>                                                                                                                                                                                                            
admin>                                                                                                                                                                                                            
mongodb 18:55:30.71 INFO  ==> Stopping MongoDB...

This is the relevant configuration from my values.yaml:

mongodb:
  enabled: true
  auth:
    rootPassword: rocketchatroot
    usernames:
      - rocketchat
    passwords:
      - rocketchat
    databases:
      - rocketchat

  architecture: standalone

  persistence:
    enabled: true
    accessMode: ReadWriteOnce
    size: 8Gi

  volumePermissions: { enabled: true }

The issue appears to be in the parsing of the stdout output of mongodb_execute_print_output - unfortunately both my awk- and MongoDB-knowledge isn't too great, otherwise I would have prepared a PR instead of this issue. Is there no better way to detect success?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant