Can't connect to one database
kremalicious
PROOP

a year ago

Hello there, having a problem connecting to a MongoDB database service in one of my projects. It is setup exactly like databases in other projects where I can connect without problems. That is for both, internal connection and public connection although I usually connect via Tailscale but for this project still have public connection to database activated but have just no luck connecting with anything.

Your app's Data UI also can't connect telling me "We are unable to connect to the database over the public network. Can you connect using this command?" And then I can't connect with the provided command either, where mongosh says "MongoServerError: Authentication failed."

Also tried to remove and add back the service but also can't connect. My app also can't connect and tells me "MongoDB connection error: MongoServerError: Authentication failed."

Any pointers as to why there is no connection possible despite being setup exactly like other projects?

5 Replies

a year ago

Have you perhaps changed the password without updating the service variable?

I just deployed a mongo database and the data tab can connect.


kremalicious
PROOP

a year ago

Think I found it. Switching the volume as to not loose data when creating new db service does not seem to work out. Can now reproduce that MongoDB service only works with the initially created and mounted volume. Switching to another volume formerly attached to another MongoDB service, will break connecting to the database. Which is probably expected as db config incl. credentials are on those volumes?


a year ago

That's correct.


kremalicious
PROOP

a year ago

Had no luck connecting to any database in that specific project. So nuked the whole project, recreated it and now also your UI tool can connect to it.

Another confusing thing is the Tailscale subnet router where your documentation does not make it very clear how to use that in multiple projects as all the internal domains generated for a service are exactly the same. How is that supposed to work when trying to connect from one outside machine to one of the project's databases? I suppose all internal domain names then also need to be different for the routing to reach correct database? In my tests only the first created database with the first attached Tailscale service can be connected to. All additionally created ones can't be connected to from outside via internal URL even if their internal URLs are changed.


a year ago

The Tailscale subnet router simply cannot be used in multiple projects at the same time, you would need to only run one instance.


Loading...