Home > Mobile >  Google Cloud Ops Agent Mongo Integration Error - AuthenticationFailed: SCRAM authentication failed,
Google Cloud Ops Agent Mongo Integration Error - AuthenticationFailed: SCRAM authentication failed,

Time:11-02

I'm getting this error when setting up the 3rd party integration for Mongo with Google Ops Agent:


AuthenticationFailed: SCRAM authentication failed, storedKey mismatch

Google Cloud Ops Agent Config

Mongo Integration

    mongodb:
      type: mongodb
      insecure: false
      cert_file: /etc/ssl/mongodb.pem
      key_file: /etc/ssl/mongodb.pem
      ca_file: /etc/ssl/mongodb.pem
      endpoint: 127.0.0.1:443
      username: user
      password: fub&r$
      collection_interval: 60s
      insecure_skip_verify: true

The Full error:

"jsonPayload": {
    "context": "conn4277",
    "severity": "I",
    "attributes": {
      "authenticationDatabase": "admin",
      "principalName": "user",
      "mechanism": "SCRAM-SHA-256",
      "client": "1.1.1.1:34542",
      "result": "AuthenticationFailed: SCRAM authentication failed, storedKey mismatch"
    },
    "id": 20249,
    "message": "Authentication failed",
    "component": "ACCESS"
 },

I'm using a config that works on other instances, and validated the user and password are working and also have permissions needed to the database.

I can't find any useful answers relating to this error, but it does seem to be fairly common outside of the Google Ops Agent. Any insight or suggestions would be appreciated.

CodePudding user response:

The problem was actually the password itself consisting of characters that the Ops Agent was not able to handle. No other system had an issue with this password including Robo3T or the mongo shell itself connecting to the replication set. I had tried putting the password string in quotes but that did not fix it either.

The characters that caused the issue were & and $. I did not validate which it was, just that replacing both of those for another special solved the error I was getting.

I looked all over for solutions to this, and nothing was relevant to the relatively new Ops Agent , so marking my own question as answered for anyone who may find this in the future.

CodePudding user response:

MongoDB requires the username and password be percent encoded. Your configuration file specified raw values instead of encoded values. The problem is not related to or caused by Google Cloud Ops Agent.

Connection String URI Format

  • Related