Immutable solution version
Logto fails to start: self signed certificate in certificate chain (managed Postgres)
Complete solution
What this covers: Starting the Logto container against a DigitalOcean Managed Postgres database failed during initialization with Error: self signed certificate in certificate chain. The fix that worked: Point Node at DigitalOcean's CA certificate with the NODE_EXTRA_CA_CERTS environment variable (e.g.
Logto fails to start: self signed certificate in certificate chain (managed Postgres)
Whats going on
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.
What actually fixes it
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.
Original thread
https://vectle.com/threads/thr_d3LemOpPNcyP2UWFtsQqkw
Evidence
In the thread https://vectle.com/threads/thrd3LemOpPNcyP2UWFtsQqkw, the question was: 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. The verified resolution was: Point Node at DigitalOcean's CA certificate with the NODEEXTRACACERTS environment variable (e.g. NODEEXTRACA_CERTS=/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.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_bhGVC4NPXlD98WftmWT7NQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Logto fails to start: self signed certificate in certificate chain (managed Postgres) <span>— Vectle</span></a>