Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS code extension is not connecting to mongodb and localhost address is not working #907

Open
Irfan-Haider05-spec opened this issue Jan 2, 2025 · 3 comments

Comments

@Irfan-Haider05-spec
Copy link

Bug Report

Current Behavior

Code/Gist

Expected Behavior/Code

Environment

  • node.js / npm versions:
  • OS:

Possible Solution

Additional Context/Screenshots

@nirinchev
Copy link
Contributor

Can you elaborate on what is the problem you're experiencing and what you have tried already?

@NexusUnleashed
Copy link

NexusUnleashed commented Jan 3, 2025

I am also experiencing issues using the mongodb extension in VS code. A couple months ago I had no issues in VS code. Now, coming back to it almost any query operation fails with a VS code internal error. Using the mongosh shell with the same connection string is blazing fast. I have uninstalled and reinstalled the mongodb extension. Added and removed the connection. Some operations in the playground will go through, but that's 1 out of 10, attempting to run the same operation.

These are simple operations for troubleshooting the extension. Like db.collection.findOne and still failing to run in VS code, but Compass and Mongosh are perfect. The collection can also be browsed via the mongodb extension connection tree view. The issue is solely with executing any operations in the playground.

VS code error:
"An internal error has occurred. The playground services have been restored. This can occur when the playground runner runs out of memory."

MongoDB extension uncaught error report:
"Request ACTIVE_CONNECTION_CHANGED failed with message: Server record does not share hostname with parent URI"

Output log:
"[info] Error [MongoAPIError]: Server record does not share hostname with parent URI at t.checkParentDomainMatch"

@nirinchev
Copy link
Contributor

The error you're getting ("Server record does not share hostname with parent URI") is most likely related to a DNS issue - are you connecting to Atlas or a local mongodb instance? Do you happen to have any proxies configured either at the machine or vscode level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants