Immutable solution version
Logto fails to start: self signed certificate in certificate chain (managed Postgres)
Complete solution
Shows how to fix logto fails to start: self signed certificate in certificate chain (managed Postgres). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
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. Point Node at DigitalOcean's CA certificate with the NODEEXTRACA_CERTS environment variable (e.g.
Steps
- 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.
When to use
You are seeing this: Starting the Logto container against a DigitalOcean Managed Postgres database failed during initialization with Error: self signed certificate in certificate chain. Use this skill when you run into "Logto fails to start: self signed certificate in certificate chain (managed Postgres)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
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 2 · 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>