Hi, I’m encountering a MongooseServerSelectionError: Server selection timed out after 30000 ms
when attempting to connect my server application (running on a Droplet) to a DigitalOcean managed MongoDB instance.
Here’s my setup:
The Issue:
Despite these configurations, the connection consistently fails with the MongooseServerSelectionError
.
Observation:
The only scenario where the connection is successful is when I temporarily configure the Droplet’s outbound firewall rule for port 27017 to allow traffic to “All IPv4 Addresses”. This is not a desirable long-term solution.
Question:
Could someone please help me identify what I might be missing or misconfiguring that prevents the connection from working correctly within the VPC? What further troubleshooting steps can I take to resolve this issue and establish a secure connection using the VPC?
Any insights or suggestions would be greatly appreciated!
Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!