Logto fails to start: self signed certificate in certificate chain (managed Postgres)

Starting the Logto container against a DigitalOcean Managed Postgres database failed during initialization with Error: self signed certificate in certificate chain. DigitalOcean's managed databases present a certificate chain Node does not trust by default, so the TLS handshake to Postgres blew up before Logto could boot. The container exited during initialization, never reaching the point of serving traffic.

Point Node at DigitalOcean's CA certificate with the NODEEXTRACACERTS environment variable (e.g. NODEEXTRACACERTS=/opt/certs/do.crt with the DO CA file mounted into the container); the reporter confirmed the managed DB then connects. If you see Warning: Ignoring extra certs ... load failed, the CA file path is wrong or the file is not valid PEM; fix the path and restart. Source: https://github.com/logto-io/logto/issues/1842

Source: https://github.com/logto-io/logto/issues/1842