I'm trying to add an ingestion for MongoDB but it ...
# troubleshoot
t
I'm trying to add an ingestion for MongoDB but it keeps failing. I've followed the instructions in the Quickstart and
datahub docker check
shows that there are no issues detected. Here is the specification that I'm using for the MongoDB ingestion source:
Copy code
source:
    type: mongodb
    config:
        connect_uri: '<mongodb://localhost>'
        username: '${MONGO-DB-USERNAME}'
        password: '${MONGO-DB-PASSWORD}'
        enableSchemaInference: true
        useRandomSampling: true
        maxSchemaSize: 300
sink:
    type: datahub-rest
    config:
        server: '<http://localhost:8080>'
But I am getting an error about a refused connection.
Copy code
'[2022-04-15 01:37:45,418] INFO     {datahub.cli.ingest_cli:88} - DataHub CLI version: 0.8.32.1\n'
           '[2022-04-15 01:37:45,423] WARNING  {urllib3.connectionpool:810} - Retrying (Retry(total=2, connect=None, read=None, redirect=None, '
           "status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f86471ada00>: Failed to "
           "establish a new connection: [Errno 111] Connection refused')': /config\n"
           '[2022-04-15 01:37:49,424] WARNING  {urllib3.connectionpool:810} - Retrying (Retry(total=1, connect=None, read=None, redirect=None, '
           "status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f86471add00>: Failed to "
           "establish a new connection: [Errno 111] Connection refused')': /config\n"
           '[2022-04-15 01:37:57,411] WARNING  {urllib3.connectionpool:810} - Retrying (Retry(total=0, connect=None, read=None, redirect=None, '
           "status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f86471ad520>: Failed to "
           "establish a new connection: [Errno 111] Connection refused')': /config\n"
           '[2022-04-15 01:37:57,658] ERROR    {datahub.entrypoints:152} - File '
           '"/tmp/datahub/ingest/venv-1f3b70e4-8933-4643-ad3e-d9279e37c6cd/lib/python3.9/site-packages/urllib3/connection.py", line 174, in '
e
Hey! Have you enabled auth on the API layer by any chance? https://datahubproject.io/docs/introducing-metadata-service-authentication/
teamwork 1
t
Unless it is set by running
datahub docker quicketart
and
datahub docker ingest-stample-data
then no. I also checked the environment variables of the
datahub-gms
container and it doesn't have ${METADATA_SERVICE_AUTH_ENABLED} set.
m
@tall-fall-45442: is your server running and reachable on "http://localhost:8080" from the place where you are running ingestion from (are you running ingestion from inside the UI?) If UI, then you should use "http://datahub-gms:8080" as the connection is being made from the ingestion container
plus1 1
teamwork 1
t
Thanks, that fixed it. I didn't know that I would have to think about what network the UI was running in.
For future reference I had to change my ingestion file to the following:
Copy code
source:
    type: mongodb
    config:
        connect_uri: '<mongodb://host.docker.internal>'
        username: mongo
        password: ${MONGO-DB-PASSWORD}
        enableSchemaInference: true
        useRandomSampling: true
        maxSchemaSize: 300
sink:
    type: datahub-rest
    config:
        server: '<http://datahub-gms:8080>'
e
Awesome!!
Thanks for sharing!!