Skip to content

clusterConfig failed to validate #255

@aeisma

Description

@aeisma

A trial deploy of the operator on OpenShift 4.4 in combination with deploy/crds/mongodb.com_v1_mongodb_openshift_cr.yaml configured for mongo 3.6 appeared to be successful, with all pods in running status, but mongod is not operational. I looked in the example-openshift-mongodb-0 pod's log, and mongodb-agent is repeatedly logging the following error:

[2020-11-24T13:14:31.584-00] [.error] [cm/main/cm.go:mainLoop:456] [13:14:31.584] Error loading desired cluster configs : [13:14:31.584] Error retrieving cluster config from '/var/lib/automation/config/cluster-config.json' : [13:14:31.584] Error validating syntax of cluster config : clusterConfig failed to validate:
&{builds 0xc000299020} : Invalid type. Expected: array, given: null

A cat of /var/lib/automation/config/cluster-config.json, as generated by the operator, does show a null indeed:

  ...
  "mongoDbVersions": [
    {
      "name": "3.6",
      "builds": null
    }
  ...

Any idea what could be causing this problem?
My mongodb.com_v1_mongodb_openshift_cr.yaml looks like this:

apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
  name: example-openshift-mongodb
spec:
  members: 3
  type: ReplicaSet
  version: "3.6"
  featureCompatibilityVersion: "3.6"
  security:
    authentication:
      modes: ["SCRAM"]
  users:
    - name: my-user
      db: admin
      passwordSecretRef:
        name: my-user-password
      roles:
        - name: clusterAdmin
          db: admin
        - name: userAdminAnyDatabase
          db: admin
      scramCredentialsSecretName: my-scram
  statefulSet:
    spec:
      template:
        spec:
          containers:
            - name: "mongodb-agent"
              env:
                - name: MANAGED_SECURITY_CONTEXT
                  value: "true"
            - name: "mongod"
              env:
                - name: MANAGED_SECURITY_CONTEXT
                  value: "true"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions