[GH-ISSUE #22258] issue: App crashes without error message after enabling database encryption with SQLCipher #35206

Closed
opened 2026-04-25 09:26:38 -05:00 by GiteaMirror · 16 comments
Owner

Originally created by @filbertlai on GitHub (Mar 5, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22258

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

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

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

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:

apt-get update
apt install -y libsqlcipher-dev
pip install --upgrade pip
pip install sqlcipher3-wheels

docker-compose.yaml:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:0.8.8
    ports:
      - "3000:8080"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - open-webui:/app/backend/data
      - ./custom-start.sh:/custom-start.sh:ro
    environment:
      - WEBUI_SECRET_KEY=mysecretkey
      - DATABASE_TYPE=sqlite+sqlcipher
      - DATABASE_PASSWORD=randompassword
      - GLOBAL_LOG_LEVEL=DEBUG
    command: >
      bash -c "
        echo 'Running custom startup commands...';
        /custom-start.sh || echo 'Custom script failed';
        echo 'Starting original Open WebUI...';
        exec /app/backend/start.sh
      "
    healthcheck:
      test: ["NONE"]
volumes:
  open-webui:
    external: true

Run the following in the command prompt with Docker v4.63.0:

docker volume create open-webui
docker compose -f docker-compose.yaml up -d

Logs & Screenshots

Complete logs:
logs.txt

I could access the sign up page:
Image

App crashes after sign up admin account:
Image

Docker log screenshot:
Image

Docker inspect screenshot:
Image

Additional Information

No response

Originally created by @filbertlai on GitHub (Mar 5, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22258 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### 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 - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### 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: ``` apt-get update apt install -y libsqlcipher-dev pip install --upgrade pip pip install sqlcipher3-wheels ``` docker-compose.yaml: ``` services: open-webui: image: ghcr.io/open-webui/open-webui:0.8.8 ports: - "3000:8080" extra_hosts: - "host.docker.internal:host-gateway" volumes: - open-webui:/app/backend/data - ./custom-start.sh:/custom-start.sh:ro environment: - WEBUI_SECRET_KEY=mysecretkey - DATABASE_TYPE=sqlite+sqlcipher - DATABASE_PASSWORD=randompassword - GLOBAL_LOG_LEVEL=DEBUG command: > bash -c " echo 'Running custom startup commands...'; /custom-start.sh || echo 'Custom script failed'; echo 'Starting original Open WebUI...'; exec /app/backend/start.sh " healthcheck: test: ["NONE"] volumes: open-webui: external: true ``` Run the following in the command prompt with Docker v4.63.0: ``` docker volume create open-webui docker compose -f docker-compose.yaml up -d ``` ### Logs & Screenshots Complete logs: [logs.txt](https://github.com/user-attachments/files/25763621/logs.txt) I could access the sign up page: <img width="1907" height="887" alt="Image" src="https://github.com/user-attachments/assets/ecf8c59b-2315-4ac4-9d6a-76298c494a15" /> App crashes after sign up admin account: <img width="1898" height="903" alt="Image" src="https://github.com/user-attachments/assets/481b56b2-b582-459b-81da-baa2d5c3e498" /> Docker log screenshot: <img width="1634" height="913" alt="Image" src="https://github.com/user-attachments/assets/1e7e1a4c-e090-42c7-992e-2b084841d6b8" /> Docker inspect screenshot: <img width="1644" height="907" alt="Image" src="https://github.com/user-attachments/assets/721d5f28-4124-4188-894f-e50fc5764bff" /> ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-25 09:26:39 -05:00
Author
Owner

@Classic298 commented on GitHub (Mar 5, 2026):

Root Cause

Exit code 139 (segfault) occurs because the code tries to open your existing unencrypted webui.db with 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:

docker compose down
docker run --rm -v open-webui:/data alpine mv /data/webui.db /data/webui.db.backup
docker compose up -d

Or migrate manually using sqlcipher_export() before enabling encryption.

<!-- gh-comment-id:4003901143 --> @Classic298 commented on GitHub (Mar 5, 2026): ## Root Cause Exit code 139 (segfault) occurs because the code tries to open your **existing unencrypted** `webui.db` with 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:** ```bash docker compose down docker run --rm -v open-webui:/data alpine mv /data/webui.db /data/webui.db.backup docker compose up -d ``` **Or migrate manually** using `sqlcipher_export()` before enabling encryption.
Author
Owner
<!-- gh-comment-id:4003912114 --> @Classic298 commented on GitHub (Mar 5, 2026): <img width="724" height="247" alt="Image" src="https://github.com/user-attachments/assets/d9beb720-524c-43ef-8563-c3478d62a07c" /> https://docs.openwebui.com/reference/env-configuration#encrypted-sqlite-with-sqlcipher
Author
Owner

@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.

<!-- gh-comment-id:4004209682 --> @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.
Author
Owner

@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?

<!-- gh-comment-id:4004239168 --> @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?
Author
Owner

@filbertlai commented on GitHub (Mar 5, 2026):

@Classic298
I have just tried your proposed solution and didn't work either.

<!-- gh-comment-id:4004265245 --> @filbertlai commented on GitHub (Mar 5, 2026): @Classic298 I have just tried your proposed solution and didn't work either.
Author
Owner

@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.
Image

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.

<!-- gh-comment-id:4004329327 --> @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. <img width="1649" height="969" alt="Image" src="https://github.com/user-attachments/assets/e3725d8e-4aa4-4a9c-926a-572fc8a6cfb5" /> 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.
Author
Owner

@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.

<!-- gh-comment-id:4004678308 --> @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.
Author
Owner

@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:

apt-get update
apt install -y libsqlcipher-dev
pip install --upgrade pip
pip install sqlcipher3-wheels

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 SQLCipher

I 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.

<!-- gh-comment-id:4004778086 --> @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: ``` apt-get update apt install -y libsqlcipher-dev pip install --upgrade pip pip install sqlcipher3-wheels ``` 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 SQLCipher` I 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.
Author
Owner

@Classic298 commented on GitHub (Mar 5, 2026):

@filbertlai just a QQ - does your password have any special characters in it? the database password?

<!-- gh-comment-id:4004795710 --> @Classic298 commented on GitHub (Mar 5, 2026): @filbertlai just a QQ - does your password have any special characters in it? the database password?
Author
Owner

@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.

<!-- gh-comment-id:4004819307 --> @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.
Author
Owner

@Classic298 commented on GitHub (Mar 5, 2026):

Understood, thanks. Will investigate later. Reopening for now

<!-- gh-comment-id:4005046693 --> @Classic298 commented on GitHub (Mar 5, 2026): Understood, thanks. Will investigate later. Reopening for now
Author
Owner

@Classic298 commented on GitHub (Mar 5, 2026):

@filbertlai two things

  1. its not good to install pip dependencies during runtine or on startup, best to create a custom Dockerfile and install the dependencies there

  2. can you try with DATABASE_POOL_SIZE=0 being set?

<!-- gh-comment-id:4005201591 --> @Classic298 commented on GitHub (Mar 5, 2026): @filbertlai two things 1) its not good to install pip dependencies during runtine or on startup, best to create a custom Dockerfile and install the dependencies there 2) can you try with DATABASE_POOL_SIZE=0 being set?
Author
Owner

@Classic298 commented on GitHub (Mar 5, 2026):

https://github.com/open-webui/open-webui/pull/22273

<!-- gh-comment-id:4006870138 --> @Classic298 commented on GitHub (Mar 5, 2026): https://github.com/open-webui/open-webui/pull/22273
Author
Owner

@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.

<!-- gh-comment-id:4009467132 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:4009559061 --> @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.
Author
Owner

@Classic298 commented on GitHub (Mar 6, 2026):

Amazing

<!-- gh-comment-id:4010227987 --> @Classic298 commented on GitHub (Mar 6, 2026): Amazing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35206