Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ca-certificates to docker image #721

Merged
merged 1 commit into from
Feb 20, 2024
Merged

fix: add ca-certificates to docker image #721

merged 1 commit into from
Feb 20, 2024

Conversation

sweatybridge
Copy link
Contributor

@sweatybridge sweatybridge commented Feb 20, 2024

What kind of change does this PR introduce?

Bug fix #719

What is the current behavior?

When using sslmode=prefer on a database that enforces ssl, node-postgres throws an error about self-signed certificate.

$ supabase gen types typescript --db-url 'postgres://aws-0-ap-southeast-1.pooler.supabase.com:5432/postgres'
Connecting to aws-0-ap-southeast-1.pooler.supabase.com
(node:1) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
file:///usr/src/app/dist/server/server.js:57
        throw new Error(schemasError.message);
              ^

Error: self-signed certificate in certificate chain
    at file:///usr/src/app/dist/server/server.js:57:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.18.2
error running container: exit 1
Try rerunning the command with --debug to troubleshoot the error.
exit status 1

This error is misleading because we don't use self-signed cert on hosted projects. The root cause is missing ca-certificates package in the docker image.

What is the new behavior?

Installs the ca-certificates package so that typegen works correctly on projects that enforce ssl.

Additional context

Add any other context or screenshots.

@sweatybridge sweatybridge requested review from a team as code owners February 20, 2024 06:44
@soedirgo soedirgo merged commit 823f0ec into master Feb 20, 2024
4 checks passed
@soedirgo soedirgo deleted the add-ca branch February 20, 2024 06:53
@kamilogorek
Copy link
Member

Oooooh so that was the error I got locally in my docker container :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sslmode=require ignored on postgresql URL with gen types --db-url
3 participants