mongodb-js / vscode

Connect to MongoDB and Atlas and directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.
https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode
Apache License 2.0
319 stars 54 forks source link

Error connecting to Mongodb localhost:27017 instance in GitHub Codespace. #833

Open my382 opened 2 hours ago

my382 commented 2 hours ago

Bug Report

Current Behavior

Open GitHub codespace from repository. Add mongodb extension in Codespace environment and try to add connection. Mongodb instance doesn't get created. It fails to connect to localhost:27017 and throws an error every time

Unable to connect: connect ECONNREFUSED 127.0.0.1:27017, connect ECONNREFUSED ::1:27017

Expected Behavior/Code

Expected outcome is localhost:27017 should be connected successfully from Mongodb extension.

Environment

node.js v20.17.0 npm v10.8.2 mongodb extension installed on GitHub Codespace

Additional Context/Screenshots

Error image

image

Anemy commented 1 hour ago

@my382 From my understanding a GitHub codespace is hosted on GitHub's servers. Is the MongoDB instance you're trying to connect to also in the codespace? Or is it on your machine?