hi, i have no idea why but now when i start and run npm run dev i get this error
[22:18:50] ERROR (payload): Error: cannot connect to MongoDB. Details: querySrv ENOTFOUND _mongodb._tcp.165687632f9.w3h7.mongodb.net
it was working fine a few days ago but now it does not work, does it have anything to do with my free trial ending, but it ended weeks ago and since I have been able to still use it
can you please help
does it have anything to do with my free trial ending
This is likely the case. Free trials that end are spun down if a valid payment method is not able to be charged (plus some grace period). It sounds like this may be the case for you. If you can provide me your Project ID or DM me the email associated, I can take a look.
hi
@967118574445547650the email associated is d.anianu@yahoo.com
It looks like this was a trial project without an associated payment method. Our policy for trial projects is to remove them at the end of the trial. This was the case for your project
The code that you write is still yours and safe inside of your github repo, but any associated database or file storage associated with the trial project is no longer available.
i want to use the payload cloud eventually, but forst i want to finish developing the project before i pay, how doi switchthe associated database to another one, do I just change the database_uri to a different one
@967118574445547650You can install mongodb locally and change your .env to point to it
thanks for the help, I have installed mogodb locally and also have mongo compass, how do i mimic the db structure that payload uses, in my local db, and how do i connect the payload app to the local db. I have changed the db url in the .env file to DATABASE_URI=mongodb://localhost:27017/payload-template-ecommerce
but when i run i get the same error
[23:09:24] ERROR (payload): Error: cannot connect to MongoDB. Details: querySrv ENOTFOUND _mongodb._tcp.660c9f1bda2e165687632f9.wyey3h7.mongodb.net
It looks like your code is not referencing
process.env.DATABASE_URI. I'd verify that is what is being used for connecting to the DB in your payload config
Somehow your code is trying to connect to a DB in atlas I'd guess
my bad my mistake was that there was duplicate .env files i wass changing a file called example .env. i chanegd the actual .env fil to the db localhost string and it now works. only problem is now after i connect to payload and see the new local database, my front end doesnt work, it just shows a blank page, any tips
HI
@191776538205618177after successfully changing my project to working with my local db when i load my project i get this message on the front end
"Welcome to your e-commerce store! Your database is currently empty. To seed your database with a few products and pages, log in to the admin dashboard and click "seed your database". If you have already seeded your database, you may need to hard refresh this page to clear the cached request." I have pressed the seed button and done a hard refresh but nothing is happening, i still get this message, any tips on how to do this, or is there a clone of the eccomernce db i can colen from somewhere into my db because pressing the seed button is not working
this is the message I get in terminal when i run yarn seed in the terminal yarn seed --verbose
yarn run v1.22.22
$ rm -rf media && cross-env PAYLOAD_SEED=true PAYLOAD_DROP_DATABASE=true PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts ts-node src/server.ts --verbose
(node:75238) [DEP0040] DeprecationWarning: The
punycodemodule is deprecated. Please use a userland alternative instead.
(Use
node --trace-deprecation ...to show where the warning was created)
[23:49:53] INFO (payload): ---- DROPPING DATABASE ----
unhandledRejection ValidationError: The following field is invalid: copyright
at beforeChange (/Users/desmondanianu/e-commerce/node_modules/payload/src/fields/hooks/beforeChange/index.ts:60:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async update (/Users/desmondanianu/e-commerce/node_modules/payload/src/globals/operations/update.ts:159:18)
at async Promise.all (index 6) {
data: [ { field: 'copyright', message: 'This field is required.' } ],
isOperational: true,
isPublic: false,
status: 400
}
[23:49:53] INFO (payload): ---- DROPPED DATABASE ----
[23:49:53] INFO (payload): Connected to MongoDB server successfully!
[23:49:53] INFO (payload): Starting Payload...
[23:49:54] INFO (payload): Payload Admin URL:
http://localhost:3000/admin[23:49:54] INFO (payload): Seeding database...
[23:49:54] INFO (payload): — Clearing media...
[23:49:54] INFO (payload): — Clearing collections and globals...
error Command failed with exit code 1.
info Visit
https://yarnpkg.com/en/docs/cli/runfor documentation about this command.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.