MongoDB connector ignores Database Name field and defaults to test
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
-
Go to Service Connections → Databases → Add Service → MongoDB
-
Fill in the connection fields as follows:
Host and Port: IP or localhost Database Name: my_database Username: my_user Password: **** -
Click Test Connection
-
The connection fails with an
Authentication failederror.
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.