---
title: Troubleshooting MongoDB
description: "Debugging a MongoDB connection string can be a bit tricky. Here are some troubleshooting steps you can perform: Check the syntax: Make sure that the connection string is properly formatted with the co"
---

[Skip to content](https://support.cobrowse.io/troubleshooting-mongodb-connection-string#main-content)

[![logo cobrowse purple.svg](https://support.cobrowse.io/hubfs/logo%20cobrowse%20purple.svg)](https://cobrowse.io/)

Open main navigation

Close main navigation

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://support.cobrowse.io/?hsLang=en)
2. [Enterprise self-hosting](https://support.cobrowse.io/enterprise-self-hosting?hsLang=en)

# Troubleshooting MongoDB

Here are some troubleshooting steps you can perform to debug a MongoDB connection string:

1. Check the syntax: Make sure that the connection string is [properly formatted](https://www.mongodb.com/docs/manual/reference/connection-string/) with the correct syntax. MongoDB connection strings typically start with **mongodb://**, followed by the hostname and port number, and end with the name of the database.
2. Check the hostname: Ensure that the hostname in the connection string is correct and resolvable. Try pinging the hostname from within the host and container to ensure that it is accessible from your system.
3. Check the port number: Verify that the port number in the connection string matches the port number that MongoDB is listening on. By default, MongoDB listens on port **27017**.
4. Check the authentication details: If your MongoDB instance is configured to require authentication, make sure that the username and password in the connection string are correct. You can test authentication by connecting to the MongoDB instance with a MongoDB client tool.
5. Check the firewall: Ensure that your firewall is not blocking the MongoDB port. If you're connecting to a remote MongoDB instance, make sure that the appropriate firewall rules are in place.
6. Check the MongoDB logs: Check the MongoDB logs for any errors or warnings that may be related to the connection issue. The MongoDB logs are typically located in the **/var/log/mongodb/** directory.
7. Test the connection: Try connecting to the MongoDB instance with a MongoDB client tool, such as the **mongo** shell or a GUI tool like **Robo 3T**. This can help you identify any issues with the connection string or with the MongoDB instance itself.

- [Features overview](https://support.cobrowse.io/features-overview?hsLang=en)
- [Account management](https://support.cobrowse.io/account-management?hsLang=en)
- [User guides](https://support.cobrowse.io/user-guides?hsLang=en)
- [Cloud hosting (SaaS)](https://support.cobrowse.io/cloud-hosting-saas?hsLang=en)
- [Enterprise self-hosting](https://support.cobrowse.io/enterprise-self-hosting?hsLang=en)
- [Data privacy & security](https://support.cobrowse.io/data-privacy-security?hsLang=en)
- [Session data & recordings](https://support.cobrowse.io/session-data-recordings?hsLang=en)
- [Licenses & billing](https://support.cobrowse.io/licenses-billing?hsLang=en)
- [Web SDK questions](https://support.cobrowse.io/web-sdk-questions?hsLang=en)
- [Mobile SDKs questions](https://support.cobrowse.io/mobile-sdks-questions?hsLang=en)
- [Zendesk integration](https://support.cobrowse.io/zendesk-integration?hsLang=en)
- [Genesys Cloud integration](https://support.cobrowse.io/genesys-cloud-integration?hsLang=en)
- [Genesys Engage integration](https://support.cobrowse.io/genesys-engage-integration?hsLang=en)

[![Chill listening crop-3](https://support.cobrowse.io/hubfs/logo%20cobrowse%20purple-1.svg "Chill listening crop-3")](https://cobrowse.io/)

Cobrowse.io Knowledge Base

Copyright © 2026, Cobrowse.io LLC