Question

App is unable to connect to MongoDB database when added as a trusted source.

I have an App and a MongoDB database both hosted by DigitalOcean. When I add the app as a trusted source (tripled checked the name) my web app is unable to connect to the database. When I remove the app as a trusted source and allow the database cluster to be open all incoming connections then the app is finally able to connect.

I don’t understand why this would be? Is it because the component (web service) within my App is accessing the database and that hasn’t been whitelisted yet? If so, how would i whitelist it?

This just doesn’t really make any sense to me. Why would the IP whitelisting not work for just this web app but work fine for other droplets? I don’t see what I am doing wrong.


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 11, 2022
Accepted Answer

Hey @tompeters,

Connecting to a database during the build phase is not supported in App Platform, and so this limitation also applies to trusted sources:

https://www.digitalocean.com/blog/new-in-digitalocean-app-platform-enhanced-security-insights-and-dbaas-integration

I’ve just tested this during the deploy/run stage and it seems to work as expected once the App is added to the Trusted sources list.

Are you still seeing that problem? If so, please reach out to our amazing support team who will be more than happy to assist you with your issue! :)

https://www.digitalocean.com/support/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.