A TCP Issue with ZeroTurst

An issue I am experiencing with connecting to our development database. Elobrated Dev A in Israel and a Dev B in the USA. While Dev A members in Israel can successfully connect to the development database and work on local applications, Dev B from the USA are encountering difficulties when trying to connect through local applications. What do I mean? The DB in question is MongoDB. Both Dev A and Dev B are able to connect to MongoDB Compass (A free UI application to manage MongoDB databases) the DB is running on a docker They are both using the same command cloudflared access tcp --hostname mongo-dev-discord.mydomain.com --url localhost:3436 When Dev A is developing the app, his application is able to connect to the DB. But when Dev B is developing the app, his application can't connect to the DB. This is the code, that the app is running...
const uri = "mongodb://localhost:3436";
const { MongoClient } = require('mongodb');

const mClient = new MongoClient(uri);

async function connectToDatabase() {
try {
await mClient.connect();
console.log("Connected to MongoDB");
return mClient.db('Bot');
} catch (error) {
console.error("Error connecting to MongoDB:", error);
throw error;
}
}

connectToDatabase();
const uri = "mongodb://localhost:3436";
const { MongoClient } = require('mongodb');

const mClient = new MongoClient(uri);

async function connectToDatabase() {
try {
await mClient.connect();
console.log("Connected to MongoDB");
return mClient.db('Bot');
} catch (error) {
console.error("Error connecting to MongoDB:", error);
throw error;
}
}

connectToDatabase();
Dev A can connect when he runs it, but Dev B gets this error Error connecting to MongoDB: MongoServerSelectionError: connect ECONNREFUSED ::1:3436 and the most important thing both are able to connect to the DB using MongoDB Compass
No description
4 Replies
thefourcraft
thefourcraftOP•14mo ago
Here's an illustration of what's happening <a:up_rainbow:822122719045746759>
Chaika
Chaika•14mo ago
and the most important thing both are able to connect to the DB using MongoDB Compass
Weird, the only thing I can think of that wouldn't be something application specific (I haven't played around with mongodb in a long time), would be either: A: Some localhost weirdness. localhost can be either 127.0.0.1 or ::1, make it explicit and cloudflared access tcp --hostname mongo-dev-discord.mydomain.com --url 127.0.0.1:3436 and then connect directly to it, ex: "mongodb://127.0.0.1:3436" B: You have two connectors, and dev a is just getting lucky. You can check in the ZT dash, Access -> Tunnels, click on your tunnel name on the left. If you have more then one connector, you can click on the connector ID and see the IP and Hostname. Ensure you only have ones running on the actual server Otherwise, basic restart/etc, and if none of those work, I'm out of ideas. Could maybe try private networking as well
./Ticker
./Ticker•14mo ago
Hi there, I am currently speaking for David (one of he's colleagues) That does seem to fix the issue, I cannot thank you enough Heart Best
thefourcraft
thefourcraftOP•14mo ago
Thanks, and hi @./Ticker welcome to the server 😂
Want results from more Discord servers?
Add your server