payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.56k stars 1.56k forks source link

postgresAdapter not work well with postgreSQL database created by digitalocean #4328

Closed larryro closed 10 months ago

larryro commented 10 months ago

Link to reproduction

No response

Describe the Bug

When we create a postgreSQL database via digitalocean and used it with postgresAdapter. It doesn't work.

[13:01:59] ERROR (payload): Error: cannot connect to Postgres. Details: self-signed certificate in certificate chain

image

To Reproduce

Create a postgreSQL database in digitalocean and used it in postgresAdapter.

Now it can be temporay fixed by specify the ca certificate like this below. But I guess there should be better solution. Because we are also using Prisma for our project at the same time. Switching from MySQL to PostgreSQL has been seamless. There is no need to do any hacks or modifications.

image

Reference

https://github.com/brianc/node-postgres/issues/2558#issuecomment-1765441660 https://github.com/Budibase/budibase/issues/1967

Payload Version

2.2.1

Adapters and Plugins

@payloadcms/db-postgres

jmikrut commented 10 months ago

Hey @larryro - this is actually more of an issue for Drizzle than Payload as all we do is pass connection options straight to Drizzle for them to use.

Will you try looking on the Drizzle ORM GitHub repo to see if anyone else has any pointers for using a DigitalOcean Postgres droplet alongside of Drizzle?

https://github.com/drizzle-team/drizzle-orm

github-actions[bot] commented 1 month ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.