IP adress issues - documentation MongoDb

default discord avatar
Alessio 🍣
8 months 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_vd
    8 months 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ťafiixek
    8 months 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_vd
    8 months 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ťafiixek
    8 months ago

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

  • default discord avatar
    olivier_vd
    8 months 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ťafiixek
    8 months 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_vd
    8 months 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?

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.