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

Deploying with helm error when npm run migration. #1830

Open
RiddlerKnight opened this issue May 15, 2024 · 2 comments
Open

Deploying with helm error when npm run migration. #1830

RiddlerKnight opened this issue May 15, 2024 · 2 comments

Comments

@RiddlerKnight
Copy link

RiddlerKnight commented May 15, 2024

Describe the bug

I installed with infisical-standalone-postgres helm chart with these values

infisical:
  image:
    tag: v0.62.4-postgres
  kubeSecretRef: "formated-infisical-pg"
  autoDatabaseSchemaMigration: false

postgresql:
  enabled: false

I use external postgres and mount the connection string via secret. During migration, I face this error.

> backend@1.0.0 migration:latest
> knex --knexfile ./src/db/knexfile.ts --client pg migrate:latest
Requiring external module ts-node/register
Working directory changed to /backend/src/db
Using environment: production
SSL required
error: SSL required
at Parser.parseErrorMessage (/backend/node_modules/pg-protocol/src/parser.ts:369:69)
at Parser.handlePacket (/backend/node_modules/pg-protocol/src/parser.ts:188:21)
at Parser.parse (/backend/node_modules/pg-protocol/src/parser.ts:103:30)
at Socket.<anonymous> (/backend/node_modules/pg-protocol/src/index.ts:7:48)
at Socket.emit (node:events:519:28)
at Socket.emit (node:domain:488:12)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Socket.Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
npm notice
npm notice New minor version of npm available! 10.5.2 -> 10.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.7.0>
npm notice Run `npm install -g npm@10.7.0` to update!
npm notice

I try to fix with providing ?sslmode=disable in connection string but noting happen.
So I try to mount certificate but no any attribute to provide ssl certificate.

Expect behavior

be able to add ssl certificate
or disable ssl verification.

@akhilmhdh
Copy link
Member

@RiddlerKnight

You can remove the sslmode=disable and then add certificate using the following environment variables

@RiddlerKnight
Copy link
Author

@RiddlerKnight

You can remove the sslmode=disable and then add certificate using the following environment variables

Sure, I tried creating cert with cert-manager signed by Let's Encrypt with my domain. The cert was mounted to postgre db without any problem and tested by kubectl forward-port then connecting with the ca without any issue.

Unfortunately, the migration issue still exist but another error. I checked further that DB_ROOT_CERT env is mounted into the pod with base64 encoded so it seem everything is correct.

This is an error that I got.

> backend@1.0.0 migration:latest
> knex --knexfile ./src/db/knexfile.ts --client pg migrate:latest
Requiring external module ts-node/register
Working directory changed to /backend/src/db
Using environment: production
unable to get issuer certificate
Error: unable to get issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket.emit (node:domain:488:12)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:871:12)
npm notice
npm notice New minor version of npm available! 10.5.2 -> 10.8.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.0>
npm notice Run `npm install -g npm@10.8.0` to update!
npm notice

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

No branches or pull requests

2 participants