Persistence configuration #42

Closed
opened 2026-02-15 19:15:42 -05:00 by yindo · 13 comments
Owner

Originally created by @dcieslak19973 on GitHub (Oct 29, 2024).

I'm trying to deploy OpenWebUI via the Helm Chart with persistence enabled. However, when I do so, the pod won't start, reporting:

File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3322, in execute_sql
cursor.execute(sql, params or ())
sqlite3.OperationalError: database is locked

Here is the configuration for persistence in my values.yaml

    persistence:
      enabled: true
      storageClass: azurefile
      accessMode: ReadWriteMany
      size: 2Gi

I do not have any mounts specified

Thanks!

Originally created by @dcieslak19973 on GitHub (Oct 29, 2024). I'm trying to deploy OpenWebUI via the Helm Chart with persistence enabled. However, when I do so, the pod won't start, reporting: ``` File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3322, in execute_sql cursor.execute(sql, params or ()) sqlite3.OperationalError: database is locked ``` Here is the configuration for persistence in my values.yaml ```yaml persistence: enabled: true storageClass: azurefile accessMode: ReadWriteMany size: 2Gi ``` I do not have any mounts specified Thanks!
yindo closed this issue 2026-02-15 19:15:42 -05:00
Author
Owner

@westbrook-ai commented on GitHub (Nov 3, 2024):

Hi @dcieslak19973, do you have more than one pod trying to read from the DB? I noticed you're using ReadWriteMany which I've never personally tested. Also, do you run into the same issue if you set accessMode: ReadWriteOnce?

@westbrook-ai commented on GitHub (Nov 3, 2024): Hi @dcieslak19973, do you have more than one pod trying to read from the DB? I noticed you're using `ReadWriteMany` which I've never personally tested. Also, do you run into the same issue if you set `accessMode: ReadWriteOnce`?
Author
Owner

@dcieslak19973 commented on GitHub (Nov 4, 2024):

Currently, I only have 1 pod running. I chose ReadWriteMany to future-proof a state where I need to run multiple pods. I'll try setting it to ReadWriteOnce and report back positive/negative results when I have them

@dcieslak19973 commented on GitHub (Nov 4, 2024): Currently, I only have 1 pod running. I chose ReadWriteMany to future-proof a state where I need to run multiple pods. I'll try setting it to ReadWriteOnce and report back positive/negative results when I have them
Author
Owner

@dcieslak19973 commented on GitHub (Nov 4, 2024):

It also fails (same message about the database lock) with a RWO volume claim

@dcieslak19973 commented on GitHub (Nov 4, 2024): It also fails (same message about the database lock) with a RWO volume claim
Author
Owner

@westbrook-ai commented on GitHub (Nov 10, 2024):

@dcieslak19973 I haven't been able to replicate this, but I also haven't used the azurefile storage class before. I was able to find a similar issue here, perhaps you could see if any of the solutions outlined here help you solve it: https://github.com/kubernetes/kubernetes/issues/59755

My next recommendation would be to use an external database (like a separate Postgres instance) to host your database instead to hopefully work around this issue. Let me know what you end up doing, thanks!

@westbrook-ai commented on GitHub (Nov 10, 2024): @dcieslak19973 I haven't been able to replicate this, but I also haven't used the `azurefile` storage class before. I was able to find a similar issue here, perhaps you could see if any of the solutions outlined here help you solve it: https://github.com/kubernetes/kubernetes/issues/59755 My next recommendation would be to use an external database (like a separate Postgres instance) to host your database instead to hopefully work around this issue. Let me know what you end up doing, thanks!
Author
Owner

@sir3mat commented on GitHub (Nov 11, 2024):

How to modify the PVC mount path for the Pipelines server?

Currently, when persistence.enabled is set to true, the PVC (Persistent Volume Claim) is mounted at /app/backend/data. However, should it be mounted at /app/pipelines instead? Which path is correct?

@sir3mat commented on GitHub (Nov 11, 2024): How to modify the PVC mount path for the Pipelines server? Currently, when persistence.enabled is set to true, the PVC (Persistent Volume Claim) is mounted at /app/backend/data. However, should it be mounted at /app/pipelines instead? Which path is correct?
Author
Owner

@dcieslak19973 commented on GitHub (Nov 11, 2024):

@0xThresh - I will see if that potential workaround for AzureFiles is an option.

As far as using an external database, the documentation seems a bit thin or unclear in this regard. Is simply configuring DATABASE_URL ( https://docs.openwebui.com/getting-started/advanced-topics/env-configuration#database_url ) sufficient?

@dcieslak19973 commented on GitHub (Nov 11, 2024): @0xThresh - I will see if that potential workaround for AzureFiles is an option. As far as using an external database, the documentation seems a bit thin or unclear in this regard. Is simply configuring DATABASE_URL ( https://docs.openwebui.com/getting-started/advanced-topics/env-configuration#database_url ) sufficient?
Author
Owner

@westbrook-ai commented on GitHub (Nov 11, 2024):

Yes, you'd set your database connection string in that variable and Open WebUI will connect to that DB instead. Note that it will not automatically migrate existing data though, so you'll either have to copy your data over, or just start with a fresh install that uses the external DB.

@westbrook-ai commented on GitHub (Nov 11, 2024): Yes, you'd set your database connection string in that variable and Open WebUI will connect to that DB instead. Note that it will not automatically migrate existing data though, so you'll either have to copy your data over, or just start with a fresh install that uses the external DB.
Author
Owner

@dcieslak19973 commented on GitHub (Nov 13, 2024):

Thanks @0xThresh . I've gone the Postgres route for now and can confirm chat history persists across pod restarts. In our dev environment, I don't have OIDC auth enabled, and saw that user accounts persisted to Postgres. In our Prod env, we are using OIDC for auth, so presumably the user accounts table in postgres will be empty?

@dcieslak19973 commented on GitHub (Nov 13, 2024): Thanks @0xThresh . I've gone the Postgres route for now and can confirm chat history persists across pod restarts. In our dev environment, I don't have OIDC auth enabled, and saw that user accounts persisted to Postgres. In our Prod env, we are using OIDC for auth, so presumably the user accounts table in postgres will be empty?
Author
Owner

@westbrook-ai commented on GitHub (Nov 13, 2024):

I would assume that table would still map some info to the SSO user, such as their chat IDs, but I'm not intimately familiar with the DB schema. I asked others in Discord and will report back once I hear more.

Since the issue seemed external to Open WebUI/ the Helm chart and more specific to the AzureFile storage class, I'm going to close this out now. Thanks for reporting your issue, please feel free to open another issue if you see other weird behavior in the future!

@westbrook-ai commented on GitHub (Nov 13, 2024): I would assume that table would still map some info to the SSO user, such as their chat IDs, but I'm not intimately familiar with the DB schema. I asked others in Discord and will report back once I hear more. Since the issue seemed external to Open WebUI/ the Helm chart and more specific to the AzureFile storage class, I'm going to close this out now. Thanks for reporting your issue, please feel free to open another issue if you see other weird behavior in the future!
Author
Owner

@westbrook-ai commented on GitHub (Nov 13, 2024):

@dcieslak19973 that DB should have users with an oauth_sub column mapped to their federated ID. Another contributor sent this as an example: image

@westbrook-ai commented on GitHub (Nov 13, 2024): @dcieslak19973 that DB should have users with an oauth_sub column mapped to their federated ID. Another contributor sent this as an example: ![image](https://github.com/user-attachments/assets/350712e1-ce1f-42b4-8deb-d2a8cdc011fc)
Author
Owner

@ryadavso commented on GitHub (Nov 23, 2024):

i am using external postgres to persist data but it does not seam to persist files uploaded to knowledge base
but facing similar issue with AzureFile storage

what are the other option we have to persist files uploaded by users

@ryadavso commented on GitHub (Nov 23, 2024): i am using external postgres to persist data but it does not seam to persist files uploaded to knowledge base but facing similar issue with AzureFile storage what are the other option we have to persist files uploaded by users
Author
Owner

@kaliavarun commented on GitHub (Mar 13, 2025):

Hello @dcieslak19973 I am facing the same issue with SQLLite. How did you configure external database? Can you please share the values.yml config?

@kaliavarun commented on GitHub (Mar 13, 2025): Hello @dcieslak19973 I am facing the same issue with SQLLite. How did you configure external database? Can you please share the values.yml config?
Author
Owner

@dcieslak19973 commented on GitHub (Mar 14, 2025):

Hello @dcieslak19973 I am facing the same issue with SQLLite. How did you configure external database? Can you please share the values.yml config?

All I do is set DATABASE_URL as an environment variable to postgresql://...

@dcieslak19973 commented on GitHub (Mar 14, 2025): > Hello [@dcieslak19973](https://github.com/dcieslak19973) I am facing the same issue with SQLLite. How did you configure external database? Can you please share the values.yml config? All I do is set `DATABASE_URL` as an environment variable to `postgresql://...`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/helm-charts#42