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

[bitnami/postgresql] Unable to install pgvector extension #72511

Closed
naingthet opened this issue Sep 17, 2024 · 2 comments
Closed

[bitnami/postgresql] Unable to install pgvector extension #72511

naingthet opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels
postgresql solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@naingthet
Copy link

naingthet commented Sep 17, 2024

Name and Version

bitnami/postgresql:15.5.0-debian-11-r25

What architecture are you using?

amd64

What steps will reproduce the bug?

Hello, I am new to using bitnami and having quite a bit of trouble installing postgresql extensions. I am attempting to use preInitDb but have not had any success. Am I properly configuring root user?

  1. In AWS EKS
  2. Using this config:
postgresql:
  commonAnnotations:
    "helm.sh/hook": pre-install
    "helm.sh/hook-weight": "1"
    "helm.sh/hook-delete-policy": "hook-failed"
  image:
    tag: 15.5.0-debian-11-r25
  auth:
    postgresPassword: $password
  volumePermissions:
    enabled: true
  tls:
    enabled: true
    autoGenerated: true

  primary:
    persistence:
      enabled: false
    preInitDb:
      scripts:
        install-pgvector.sh: |
          #!/bin/bash
          set -e
          apt-get update && apt-get install -y postgresql-15-pgvector
    containerSecurityContext:
      runAsUser: 1001
      runAsGroup: root
    initdb:
      scripts:
        init.sql: |
          CREATE DATABASE main;
          \c main
          CREATE EXTENSION IF NOT EXISTS vector;

What is the expected behavior?

pgvector is installed into the environment and vector extension is created successfully

What do you see instead?

This does not seem to successfully install the vector extension, and migrations are unable to use the extension.

Additional information

No response

@naingthet naingthet added the tech-issues The user has a technical issue about an application label Sep 17, 2024
@github-actions github-actions bot added the triage Triage is needed label Sep 17, 2024
@naingthet naingthet changed the title Unable to install pgvector extension [bitnami/postgresql] Unable to install pgvector extension Sep 17, 2024
@javsalgar
Copy link
Contributor

Hi,

If you want to user root then you need to run set runAsUser: 0. However, in this kind of scenarios what we recommend is to create a fork of the PostgreSQL container.

This should help you: #32677 (comment)

@naingthet
Copy link
Author

This helped a lot, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants