Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

IP adress issues - documentation MongoDb

default discord avatar
Alessio 🍣2 years ago
17

@olivier_vd 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



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

  • default discord avatar
    olivier_vd2 years ago

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



    Schermafbeelding_2023-03-31_om_17.27.56.png
  • default discord avatar
    Marťafiixek2 years ago

    Container? Are you trying to run a Docker container?



    Does a local non-Docker Payload work by running

    npm run dev

    ?

  • default discord avatar
    olivier_vd2 years ago

    I followed the tutorial above 🙂



    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/
  • default discord avatar
    Marťafiixek2 years ago

    So, did you whitelist all IP adresses at MongoDB Atlas as @Alessio 🍣 wrote?

  • default discord avatar
    olivier_vd2 years ago

    yes





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

    Schermafbeelding_2023-03-31_om_18.46.13.png
  • default discord avatar
    Marťafiixek2 years ago

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



    This is correct



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

  • default discord avatar
    olivier_vd2 years ago

    gives the same error; read ECONNRESET



    on my personal computer it seems to run fine.. in mongoatlas.. i guess there might be some corporate network restriction on my work computer .. :/


    I still get the same error on Northflank though. Could it be that node v18.8.0 is not supported yet?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.