mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #22258] issue: App crashes without error message after enabling database encryption with SQLCipher #58343
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @filbertlai on GitHub (Mar 5, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22258
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.8
Ollama Version (if applicable)
0.17.6
Operating System
Windows 11
Browser (if applicable)
Chrome 145.0.7632.117
Confirmation
README.md.Expected Behavior
The app work normally after enabling database encryption with SQLCipher.
Actual Behavior
After enabling database encryption with SQLCipher (following the documentation), I could reach the page for signing up the admin account.
However, after signing up the admin account, the container stopped immediately without any error message (log level=debug) or hint.
There is log message about successfully connected to encrypted SQLite database using SQLCipher.
I have installed libsqlcipher-dev and sqlcipher3-wheels using a shell script before running start.sh. Health check has been disabled to prevent it from stopping the container.
This issue happens in both docker swarm and docker compose (exit code: 139).
If I remove "DATABASE_TYPE" and "DATABASE_PASSWORD" from the environment variables, the app could work normally.
Steps to Reproduce
custom-start.sh:
docker-compose.yaml:
Run the following in the command prompt with Docker v4.63.0:
Logs & Screenshots
Complete logs:
logs.txt
I could access the sign up page:

App crashes after sign up admin account:

Docker log screenshot:

Docker inspect screenshot:

Additional Information
No response
@Classic298 commented on GitHub (Mar 5, 2026):
Root Cause
Exit code 139 (segfault) occurs because the code tries to open your existing unencrypted
webui.dbwith SQLCipher, which expects an encrypted database. SQLCipher attempts to decrypt unencrypted data and crashes.The repo has no migration logic for unencrypted→encrypted conversion.
Solutions
Start fresh:
Or migrate manually using
sqlcipher_export()before enabling encryption.@Classic298 commented on GitHub (Mar 5, 2026):
https://docs.openwebui.com/reference/env-configuration#encrypted-sqlite-with-sqlcipher
@filbertlai commented on GitHub (Mar 5, 2026):
@Classic298
Thanks for the help. I forgot to mention that I have deleted the external volume and created a new external volume before enabling database encryption but I still got the same issue.
@Classic298 commented on GitHub (Mar 5, 2026):
what logs do you see in the backend once the app crashes? the logs you shared above are only 200 - aka successful.
Did you configure websockets correctly?
@filbertlai commented on GitHub (Mar 5, 2026):
@Classic298
I have just tried your proposed solution and didn't work either.
@filbertlai commented on GitHub (Mar 5, 2026):
@Classic298

The logs I saw in the backend were the logs I shared. I could only see successful logs but nothing about error.
I accessed the web without using proxy at localhost:3000. Also, I could use it normally by just removing "DATABASE_TYPE" and "DATABASE_PASSWORD" from the environment variables and start it again with a fresh new volume.
@Classic298 commented on GitHub (Mar 5, 2026):
@filbertlai and you have sqlcipher installed also? How did you install open webui? The dependency is not included in all open webui installation types by default and needs to be installed in hindsights for some.
@filbertlai commented on GitHub (Mar 5, 2026):
@Classic298
Yes, I have installed sqlcipher by running a custom shell script before running start.sh of Open WebUI:
In fact, you could see a log (in the log file I posted previously) about successfully connected to the encrypted SQLite:
INFO:open_webui.internal.db:Connected to encrypted SQLite database using SQLCipherI installed Open WebUI by running the docker-compose.yaml that I posted above.
This issue is really weird and costed me hours to troubleshoot but still didn't get any progress. May I know whether if you could use the encrypted database in the latest version of Open WebUI? I really appreciate your help.
@Classic298 commented on GitHub (Mar 5, 2026):
@filbertlai just a QQ - does your password have any special characters in it? the database password?
@filbertlai commented on GitHub (Mar 5, 2026):
@Classic298
No special character, only alphabet.
I literally used "mysecretkey" for WEBUI_SECRET_KEY and "randompassword" for DATABASE_PASSWORD.
@Classic298 commented on GitHub (Mar 5, 2026):
Understood, thanks. Will investigate later. Reopening for now
@Classic298 commented on GitHub (Mar 5, 2026):
@filbertlai two things
its not good to install pip dependencies during runtine or on startup, best to create a custom Dockerfile and install the dependencies there
can you try with DATABASE_POOL_SIZE=0 being set?
@Classic298 commented on GitHub (Mar 5, 2026):
https://github.com/open-webui/open-webui/pull/22273
@filbertlai commented on GitHub (Mar 6, 2026):
@Classic298
Thanks a lot for your help.
I have tried to build a custom image with required dependencies, and setting DATABASE_POOL_SIZE=0, still not working.
@filbertlai commented on GitHub (Mar 6, 2026):
@Classic298
I have just tried to merge the commit you made in #22273 to the main branch locally and created a new custom docker image.
The app works perfectly fine now with your fix. Thank you so much again for your assistance.
@Classic298 commented on GitHub (Mar 6, 2026):
Amazing