Skip to content

Unable to connect to MongoDB Atlas Cluster #462

Closed

Description

@mikevdberge

Describe the bug
Unable to connect to MongoDB Atlas Cluster.

2026-08-17T08:49:29 ERROR --- MongoDB Connection Error Details ---
2026-08-17T08:49:29 ERROR Target Host: somecluster-shard-00-00.tnoyu.azure.mongodb.net:27017
2026-08-17T08:49:29 ERROR Error Kind: ServerSelection { message: "Server selection timeout: No available servers. Topology: { Type: Unknown, Servers: [ { Address: somecluster-shard-00-00.tnoyu.azure.mongodb.net:27017, Type: Unknown, Error: Kind: I/O error: unexpected end of file, labels: {}, source: None, server response: None } ] }" }
2026-08-17T08:49:29 ERROR Full Error: Kind: Server selection timeout: No available servers. Topology: { Type: Unknown, Servers: [ { Address: somecluster-shard-00-00.tnoyu.azure.mongodb.net:27017, Type: Unknown, Error: Kind: I/O error: unexpected end of file, labels: {}, source: None, server response: None } ] }, labels: {}, source: None, server response: None
2026-08-17T08:49:29 ERROR Check you database network connectivity

To Reproduce
Create a free MongoDB Cluster at mongodb.com and create a databases.json with the provided connection details

Expected behavior
A working database connection.
It would be nice if we can pass in some additional connection parameters. At the moment the only connection parameter is authSource=admin and there seems no option to provide additional parameters

    Ok(format!(
        "mongodb://{}:{}@{}:{}/{}?authSource=admin",
        cfg.username, cfg.password, cfg.host, cfg.port, cfg.database
    ))

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

Activity

  1. RambokDev commented on Aug 17, 2026

    @RambokDev
    Collaborator

    Hi @mikevdberge,

    Thanks for that issue. There was an issue with cloud MongoDB databases, and a fix is currently in progress: Portabase/agent#96

    Regarding custom options, they will be available soon. We have already started implementing this for PostgreSQL through the options key in database.json, and more options will come once we release the ability to configure databases directly from the dashboard for those who do not want to use database.json.

    Both methods will be supported and compatible: databases configured through database.json and databases configured directly from the dashboard.

    I’ll keep you updated once it is released.

    {
      "name": "MongoDB Cluster Cloud",
      "database": "xxxxxxx",
      "type": "mongodb",
      "username": "xxxxx",
      "password": "xxxxxx",
      "host": "xxxx.xxxx.mongodb.net",
      "generated_id": "xxxxx"
    }

    Feel free to test it once released and provide feedback.

    Regards,

  2. changed the title [-]Unable to connect to MongoDB Atlas clustere[/-] [+]Unable to connect to MongoDB Atlas Cluster[/+] on Aug 17, 2026
  3. self-assigned this
    on Aug 17, 2026
  4. added theissue type on Aug 17, 2026
  5. RambokDev commented on Aug 17, 2026

    @RambokDev
    Collaborator

    The fix is available in agent version 1.18.6. If the issue still persists, feel free to ask for it to be reopened.

    Regards,

  6. mikevdberge commented on Aug 17, 2026

    @mikevdberge
    Author

    It's woking fine for me. Can I suggest to also update the docs so it's clear for everyone that for the MongoDB settings you can drop the port number and it will use the MongoDB SRV connection string.

  7. RambokDev commented on Aug 17, 2026

    @RambokDev
    Collaborator

    Yes, I will update the documentation accordingly. I was waiting for your feedback.

    Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions