HumanSignal / HumanSignal/label-studio
DB user cannot create extensions during db migrations (using PostgreSQL - Flexible Server in Azure)
- Dominant language
- TypeScript
- Stars
- 28.3k
- Forks
- 3.7k
- Avg merge
- 14h
- Merged PRs (30d)
- 15
Description
**Describe the bug**
We installed the helm chart on our AKS and we wanted to use an `Azure Database for PostgreSQL - Flexible Server`. When the container tries to do the DB migrations it throws the following error (see bellow). As discussed [here](https://learn.microsoft.com/en-us/answers/questions/2113337/azure-database-for-postgres-flexible-server-why-cr) and documented [here](https://learn.microsoft.com/en-us/azure/postgresql/extensions/how-to-allow-extensions?tabs=portal#create-extension) the user needs to be member of the `azure_pg_admin` role (something that we want to avoid). This was introduces in the new updates of the server.
It would be nice to have this create-extension disabled when using `Azure Database for PostgreSQL - Flexible Server` as host. For other applications we already use a workaround (pod that executes the create extension commands for us). Of course we would need to know which extensions we have to create.
The error that we get is:
```
django.db.utils.ProgrammingError: Only members of "azure_pg_admin" are allowed to use CREATE EXTENSION
```
**To Reproduce**
Steps to reproduce the behavior:
1. Install the helm chart on AKS
```
helm repo add heartex https://charts.heartex.com/
helm search repo heartex
helm install my-release heartex/label-studio --values values.yaml
```
2. Use `Azure Database for PostgreSQL - Flexible Server` as host
with the following values.yaml
```
global:
image:
pgConfig:
dbName: labelstudio #POSTGRE_NAME
host: examplepsql.postgres.database.azure.com #POSTGRE_HOST
port: 5432 #POSTGRE_PORT
userName: labelstudio #POSTGRE_USER
password: #POSTGRE_PASSWORD
secretName: label-studio-db-credentials
secretKey: POSTGRES_PASSWORD
persistence:
enabled: true
type: azure
config:
azure:
storageAccountNameExistingSecret: "azure-secret"
storageAccountNameExistingSecretKey: "azurestorageaccountname"
storageAccountKeyExistingSecret: "azure-secret"
storageAccountKeyExistingSecretKey: "azurestorageaccountkey"
containerName: "label-studio"
app:
FullnameOverride: label-studio
ingress:
enabled: false
postgresql:
enabled: false
cronjob:
enabled: false
metrcis:
enabled: true
```
**Expected behavior**
DB migrations to be succesfull
**Environment (please complete the following information):**
- OS: AKS
- Label Studio Version: 1.14.0.post0
Contributor guide
Assessment
This issue has not been assessed yet.