-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Not sure if this is specifically related to prefect-helm, but because of the custom setup I'm going to assume we probably have something misconfigured here. We're deploying prefect-server via helm and unable to create work pools (either created by helm, UI, or CLI inside or outside of the server pod).
I see the appropriate queries make it to the prefect-server DB, but they end up hanging.
In pg_stat_activity
I see the following query remains stuck in idle in transaction
and never finishes:
UPDATE work_pool SET default_queue_id=$1::UUID, updated=now() WHERE [work_pool.id](http://work_pool.id/) = $2::UUID RETURNING work_pool.updated
via this query
SELECT pid, usename, application_name, state,
wait_event_type, wait_event,
now() - xact_start AS xact_age,
query
FROM pg_stat_activity
WHERE datname = current_database()
ORDER BY xact_start
LIMIT 50;
Ultimately, this results in timeouts from the API.
The db is an Aurora Postgres DB running PG 17.4.
Here are my server chart values (including various db tuning configs that I've tried):
global:
prefect:
image:
repository: prefecthq/prefect
prefectTag: 3.4.14-python3.13
pullPolicy: IfNotPresent
server:
replicaCount: 1
resources:
requests:
cpu: "1"
memory: 1Gi
limits:
cpu: "2"
memory: 2Gi
env:
- name: PREFECT_LOGGING_LEVEL
value: "DEBUG"
- name: PREFECT_SERVER_DATABASE_CONNECTION_TIMEOUT
value: "60"
- name: PREFECT_SERVER_DATABASE_TIMEOUT
value: "120"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_STATEMENT_CACHE_SIZE
value: "0"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_PREPARED_STATEMENT_CACHE_SIZE
value: "0"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_RECYCLE
value: "1800"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_TIMEOUT
value: "60"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE
value: "15"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE
value: "15"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_APPLICATION_NAME
value: "prefect-server"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_PRE_PING
value: "true"
uiConfig:
prefectUiApiUrl: "http://${base_prefect_server_url}:4200/api"
backgroundServices:
runAsSeparateDeployment: true
env:
- name: PREFECT_LOGGING_LEVEL
value: "DEBUG"
- name: PREFECT_SERVER_DATABASE_CONNECTION_TIMEOUT
value: "60"
- name: PREFECT_SERVER_DATABASE_TIMEOUT
value: "120"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_STATEMENT_CACHE_SIZE
value: "0"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_PREPARED_STATEMENT_CACHE_SIZE
value: "0"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_RECYCLE
value: "1800"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_TIMEOUT
value: "60"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE
value: "15"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE
value: "15"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_CONNECT_ARGS_APPLICATION_NAME
value: "prefect-server"
- name: PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_PRE_PING
value: "true"
resources:
requests:
cpu: "1"
memory: 1Gi
limits:
cpu: "2"
memory: 2Gi
serviceAccount:
create: true
name: "prefect-server-background-services"
messaging:
redis:
host: "${redis_host}"
port: 6379
db: 0
username: "${redis_username}"
password: "${redis_password}"
ssl: false
serviceAccount:
create: true
name: "prefect-server"
service:
type: LoadBalancer
annotations: {
"service.beta.kubernetes.io/aws-load-balancer-type": "nlb",
"service.beta.kubernetes.io/aws-load-balancer-internal": "true"
}
ingress:
enabled: false
secret:
create: false
name: "${postgres_secret_name}"
postgresql:
enabled: false
redis:
enabled: false
Chart version: 2025.8.21160848
Prefect version: 3.4.14
Let me know if there is anything else I can do to help debug.