Unleash / helm-charts

Contains helm-charts for Unleash
Apache License 2.0
40 stars 52 forks source link

Error: The server does not support SSL connections #144

Open sturman opened 1 month ago

sturman commented 1 month ago

Describe the bug

Unable to deploy Unleash with built-in Postgres DB with default DB values.

Helm Chart: unleash Helm Chart Version: 4.1.1

Steps to reproduce the bug

  1. helm repo add unleash https://docs.getunleash.io/helm-charts
  2. helm template unleash unleash/unleash
  3. helm install unleash unleash/unleash
  4. check Unleash pod logs

Expected behavior

Unleash migrate a postgres DB and started successfully.

Logs, error output, etc.

[2024-05-10T16:01:04.890] [ERROR] server-impl.js - Locking error: The server does not support SSL connections
[2024-05-10T16:01:04.892] [ERROR] server-impl.js - Failed to migrate db Error: The server does not support SSL connections
    at Socket.<anonymous> (/unleash/node_modules/pg/lib/connection.js:77:37)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:308:9)
    at Readable.push (node:internal/streams/readable:245:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: The server does not support SSL connections
    at Socket.<anonymous> (/unleash/node_modules/pg/lib/connection.js:77:37)
    at Object.onceWrapper (node:events:632:26)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:308:9)
    at Readable.push (node:internal/streams/readable:245:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Node.js v18.18.2

Screenshots

No response

Additional context

Most likely the issue is related to this change https://github.com/Unleash/helm-charts/pull/139/files#diff-9576a5f35de34ba1784129471c2262fc5bc8bd10b69c258b07f25e1a0d1f5d44R51-R54 When I downgraded to Helm Chart Version 4.0.2, Unleash started without any errors

Unleash version

No response

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

vasiliyskysql commented 1 month ago

Came here to report the same bug. Pinning to version: 4.0.2 can be used as a temporary fix.

chriswk commented 1 month ago

Alternately adding an environment variable saying DATABASE_SSL=false should revert back to not needing SSL for postgres. I'll have a look at updating the defaults so it should work out of the box again.

vsimon commented 1 month ago

There are probably multiple issues going on currently related to SSL. At a glance there is a typo in the deployment template sslRejectUnauthorizaed but that wouldn't be the root cause of this issue.

            {{- if .Values.dbConfig.sslRejectUnauthorized }}
            - name: DATABASE_SSL_REJECT_UNAUTHORIZED
              value: "{{ .Values.dbConfig.sslRejectUnauthorizaed }}"
            {{- end }}

https://github.com/Unleash/helm-charts/blob/main/charts/unleash/templates/deployment.yaml#L77