Skip to content

rocketchat-mongodb-fix-clustermonitor-role-configmap script is buggy #158

@mhkarimi1383

Description

@mhkarimi1383

Bitnami Chart will run this script on first Pod (not primary one)

So this script should handle that and try to connect to the primary one

failed to add role clusterMonitor to user "rocketchat"; Error: rs0 [direct: secondary] admin> 
MongoServerError: not primary> ... ... ... ... ... ... ... ... Uncaught 
rs0 [direct: secondary] admin> 
rs0 [direct: secondary] admin>

this script will work correctly on initial install, not later upgrades/restarts

I think a better approach would be moving this script to a simple job and waiting for primary before running script (or making a replica set connection to primary node in current approach)

as you can see it's connecting in a direct way witch is incorrect
Problem solved After setting

mongodb:
  initdbScriptsConfigMap: ""

Before setting this we will get restart loops on first mongodb instance after upgrades/restarts when first instance is not primary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions