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

Change MONGODB_URI from mongodb://localhost:27017/bloglog to mongodb://127.0.0.1:27017/bloglog #5

Closed
Dnyaneshpise opened this issue Oct 2, 2024 · 4 comments

Comments

@Dnyaneshpise
Copy link

To avoid potential issues related to localhost DNS resolution on certain systems, I propose changing it to:

I encountered an issue where MongoDB failed to connect using localhost. This resulted in errors and delays during development. Changing localhost to 127.0.0.1 resolved the issue immediately. Here's a screenshot of the error I faced:

image

Reason for Change

  • localhost may sometimes resolve incorrectly due to system or network configurations, which can lead to connection issues with MongoDB.
  • Using 127.0.0.1 explicitly references the loopback address and is generally more reliable across different environments.

Steps to Reproduce

  1. On certain systems, running the app with the current MONGODB_URI may cause MongoDB connection issues.
  2. Changing localhost to 127.0.0.1 resolves the issue.

Proposed Solution

Update the .env file to use the following:

@Dnyaneshpise
Copy link
Author

Hey! I would love to resolve this issue quickly so that others can run the project locally and contribute to various features. Please assign this issue to me as part of GSSoC-EXT and Hacktoberfest.

@vedhcet-07
Copy link

Hey! I would love to resolve this issue quickly so that others can run the project locally and contribute to various features. Please assign this issue to me as part of GSSoC-EXT and Hacktoberfest.

can you tell me how to test this on my local machine . i am unable to try it

@Dnyaneshpise
Copy link
Author

It was already resolved now

Copy link

🎉 Congratulations @Dnyaneshpise! Your issue has been successfully closed! Thanks for your contribution! If you enjoyed contributing, please consider giving us a ⭐ and following us for updates!

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

2 participants