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

Error connection mongoldb to viscose ECONNREFUSED 127.0.0.1:27017 #411

Closed
fadelfffar opened this issue Apr 30, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@fadelfffar
Copy link

Hi all,

OS: MacOS Monterey (12.3.1)
VSCode: 1.66.2
MongoDB Extension: 0.9.2

I just had some issue connecting to a MongoDB server running inside Visual Code

I kept getting the following error: Unable to connect: getaddrinfo ECONNREFUSED 127.0.0.1:27017 mongoldb and i can't seem to figure out the solution for it
Screen Shot 2022-04-30 at 10 32 05

@Anemy
Copy link
Member

Anemy commented May 3, 2022

Hi @fadelfffar - could you tell us a little more about your MongoDB instance you are trying to connect to? Is it running on your machine on the port 27017? Is it bound to localhost or 127.0.0.1?

Are you able to connect to the same instance using the MongoDB Shell mongosh?

@sadokmtir
Copy link

@Anemy I am also having the sam problem. I could connect with robo 3T. I have a Mongo server running in a docker compose:

  mongo:
    image: mongo:4.2.19-bionic
    command: ["--replSet", "rs0"]
    restart: unless-stopped
    volumes:
      - mongo-configdb:/data/configdb
      - mongo-db:/data/db
    ports:
      - 27017:27017

@Anemy
Copy link
Member

Anemy commented May 23, 2022

Possible duplicate of #408

@alenakhineika alenakhineika added the bug Something isn't working label May 24, 2022
@SethFalco
Copy link
Contributor

SethFalco commented May 31, 2022

I ran the following:

docker run -it -p 27017:27017 mongo

image

I can confirm all the following work:

  • mongodb://0.0.0.0:27017/?readPreference=primary&ssl=false
  • mongodb://127.0.0.1:27017/?readPreference=primary&ssl=false
  • mongodb://localhost:27017/?readPreference=primary&ssl=false

@Anemy
Copy link
Member

Anemy commented Nov 18, 2022

Going to close this issue, feel free to reopen if there's more information. Appreciate that you looked into it Seth!
Thanks for checking out the extension and opening the issue.

@Anemy Anemy closed this as completed Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants