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 in workloop { MongoError: Unsupported OP_QUERY command: replSetGetStatus. The client driver may require an upgrade. #132

Open
antoniantonov opened this issue Mar 20, 2023 · 0 comments

Comments

@antoniantonov
Copy link

antoniantonov commented Mar 20, 2023

Running mongo-k8s-sidecar in AKS attempting to initialize 3 replica statefulset MongoDB. I'm getting this error:

Error in workloop { MongoError: Unsupported OP_QUERY command: replSetGetStatus. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal
    at Function.MongoError.create (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/error.js:31:11)
    at /opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at Socket.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/connection.js:333:22)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at Socket.Readable.push (_stream_readable.js:223:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:122:17)
  name: 'MongoError',
  message:
   'Unsupported OP_QUERY command: replSetGetStatus. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal',
  ok: 0,
  errmsg:
   'Unsupported OP_QUERY command: replSetGetStatus. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal',
  code: 352,
  codeName: 'UnsupportedOpQueryCommand',
  '$clusterTime':
   { clusterTime:
      Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1679318758 },
     signature:
      { hash:
         Binary {
           _bsontype: 'Binary',
           sub_type: 0,
           position: 20,
           buffer:
            <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00> },
        keyId: 0 } },
  operationTime:
   Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1679318758 } }

Here's my StatefulSet yaml:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongodb
spec:
  serviceName: "mongodb"
  replicas: 3
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo:latest
        command: ["mongod"]
        args:
          - --bind_ip_all
          - --replSet
          - rs0
        ports:
        - containerPort: 27017
        volumeMounts:
        - name: mongo-data
          mountPath: /data/db
      - name: mongodb-sidecar
        image: cvallance/mongo-k8s-sidecar:latest
        env:
          - name: MONGO_SIDECAR_POD_LABELS
            value: "app=mongodb"
          - name: KUBERNETES_MONGO_SERVICE_NAME
            value: mongodb
  volumeClaimTemplates:
  - metadata:
      name: mongo-data
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 20Gi
---
apiVersion: v1
kind: Service
metadata:
  name: mongodb
spec:
  selector:
    app: mongodb
  ports:
    - protocol: TCP
      port: 27017
      targetPort: 27017
  clusterIP: None
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: default-view
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects:
  - kind: ServiceAccount
    name: default
    namespace: default

Workaround: Using mongo:5.0.15 for the primary container image resolves the issue.

Suggestion: Not sure but it seems upgrading the client driver might be required.

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