#IP adress issues - documentation MongoDb

16 messages · Page 1 of 1 (latest)

spiral wind
#

@crystal topaz All you need to adjust is the MONGODB_URI environment variable with a correct connection string and well, set up the IP whitelisting correctly. That's all payload needs to work.

You can watch me set it up here: https://youtu.be/0XmQE03y5Ek?t=162 from 2:42 if that helps. Maybe you'll notice some mistake happened during the setup

This is an extensive introduction to deploying Payload CMS. It explains how to deploy Payload CMS step-by-step on either Northflank or Railway. The concepts (environment variables etc.) are universally applicable. After seeing how the deployment works on both services, you should know how to deploy it anywhere.

Dockerfile:

FROM node:18.8.0-alp...

▶ Play video
#

I personally just whitelisted all IPs, so you could test that out to eliminate the possibility that you got the IP wrong

crystal topaz
#

I got petty far but when starting the container I got an error

azure island
#

Container? Are you trying to run a Docker container?

#

Does a local non-Docker Payload work by running npm run dev?

crystal topaz
#

I followed the tutorial above 🙂

crystal topaz
# azure island Does a local non-Docker Payload work by running `npm run dev`?

hmm no; it gives the same error - [15:38:47] ERROR (payload): Error: cannot connect to MongoDB. Details: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/

azure island
#

So, did you whitelist all IP adresses at MongoDB Atlas as @spiral wind wrote?

crystal topaz
#

yes

#

Do i need to change something in the payload.config.ts?

azure island
#

No, you don't need to change anything in payload.config

azure island
azure island
#

And can you connect to the database via external software like MongoDB Compass?

crystal topaz
#

gives the same error; read ECONNRESET