OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

MongoDB connector ignores Database Name field and defaults to test

Open GregorioBlazquez opened this issue 1 year ago • 0 comments

Affected module Ingestion Framework (MongoDB connector)

Describe the bug When configuring a MongoDB connection in OpenMetadata, the ingestion process does not correctly use the Database Name field. Even though a valid database name is provided, the connector always attempts to connect to the default test database.

This causes authentication failures if the MongoDB user does not have access to test.

To Reproduce

  1. Go to Service Connections → Databases → Add Service → MongoDB

  2. Fill in the connection fields as follows:

    Host and Port: IP or localhost
    Database Name: my_database
    Username: my_user
    Password: ****
    
  3. Click Test Connection

  4. The connection fails with an Authentication failed error.

If you instead include the database name in the host field:

Host and Port: IP/my_database
Database Name: my_database

…the connection succeeds.

Expected behavior The ingestion should correctly use the Database Name field when constructing the MongoDB URI, without requiring the database name to be appended to the host.

Version:

  • OS: Linux
  • Python version: 3.11
  • OpenMetadata version: 1.10.4
  • OpenMetadata Ingestion package version: openmetadata-ingestion[docker]==1.10.4

Additional context Tested with valid MongoDB credentials that work via mongosh. The issue appears to be that the database field is ignored or not passed correctly into the MongoDB connection string.

GregorioBlazquez avatar Nov 13 '25 15:11 GregorioBlazquez