Source MongoDB: returns error when trying to run check locally

  • Is this your first time deploying Airbyte?: Yes
  • OS Version / Instance: Ubuntu 20.05
  • Memory / Disk: 32GB RAM, 300+GB disk
  • Deployment: Docker
  • Airbyte Version: 0.39.30-alpha
  • Source name/version: MongoDb-v2 0.1.15
  • Destination name/version: -
  • Step:
    running
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-mongodb-v2:dev check --config /secrets/config.json

inside the source-mongodb-v2 directory returns an error

config.json (as instructed here):

{
    "database": "myFirstDatabase",
    "user": "peltolai",
    "password": "xxxxxxxxxxxxxxxxxxxxx",
    "cluster_url": "cluster0.bxrls.mongodb.net"
}
  • Description:
    error:
{"type":"CONNECTION_STATUS","connectionStatus":{"status":"FAILED","message":"Could not connect with provided configuration. Error: Cannot invoke \"com.fasterxml.jackson.databind.JsonNode.get(String)\" because \"instanceConfig\" is null"}}

Hey you also need to give more details something like this

{ "database": "", "user": "", "password": "", "cluster_url": "", "host": "", "port":}

also you can check this file https://github.com/airbytehq/airbyte/blob/555169800298d8d2a741c08444c1d75a811135e4/airbyte-integrations/connectors/source-mongodb-v2/src/main/resources/spec.json

Not quite, but almost.

When I look at the code, it has these lines:

49:   private static final String INSTANCE_TYPE = "instance_type";
...
212:     final JsonNode instanceConfig = config.get(INSTANCE_TYPE);
213:     final MongoInstanceType instance = MongoInstanceType.fromValue(instanceConfig.get(INSTANCE).asText());

These lines get executed in all cases, so I figured the config needs to look like this instead:

{
    "database": "test",
    "user": "peltolai",
    "password": "xxxxxxxxxxxxxxxxxxxxx",
    "instance_type": {
        "instance": "atlas",
        "cluster_url": "cluster0.bxrls.mongodb.net"
    },
    "auth_source": "admin"
}

This works, but now I get another error

{"type":"CONNECTION_STATUS","connectionStatus":{"status":"FAILED","message":"Could not connect with provided configuration. Error: Unable to execute any operation on the source!"}}

And in fact, I get the exact same error when using the UI to connect. Error log attached.

error.log (9.2 KB)

Hey I suspect it could be a issue with permissions could you check our docs once https://docs.airbyte.com/integrations/sources/mongodb and see if following the steps is resolving this