Spaces:
Running
Running
Hermes Agent commited on
Commit ·
e976b1c
1
Parent(s): f8533a9
fix(open-webui): patch internal db.py to enforce journal_mode=DELETE to prevent SQLite WAL disk I/O error on persistent volume
Browse files- entrypoint.sh +16 -0
entrypoint.sh
CHANGED
|
@@ -498,6 +498,22 @@ for path in ['/root/.open-webui/webui.db', '/root/.open-webui/data/webui.db', '/
|
|
| 498 |
pass
|
| 499 |
" 2>/dev/null || true
|
| 500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
# 5. Start Open WebUI
|
| 502 |
echo "[INIT] Starting Open WebUI on port 8098..."
|
| 503 |
if command -v open-webui >/dev/null 2>&1; then
|
|
|
|
| 498 |
pass
|
| 499 |
" 2>/dev/null || true
|
| 500 |
|
| 501 |
+
# Patch Open WebUI internal db.py to use journal_mode=DELETE to prevent SQLite WAL disk I/O errors
|
| 502 |
+
python3 -c "
|
| 503 |
+
import glob
|
| 504 |
+
for path in glob.glob('/usr/local/lib/python*/dist-packages/open_webui/internal/db.py'):
|
| 505 |
+
try:
|
| 506 |
+
with open(path, 'r', encoding='utf-8') as f:
|
| 507 |
+
code = f.read()
|
| 508 |
+
if 'PRAGMA journal_mode=WAL' in code:
|
| 509 |
+
code = code.replace('PRAGMA journal_mode=WAL', 'PRAGMA journal_mode=DELETE')
|
| 510 |
+
with open(path, 'w', encoding='utf-8') as f:
|
| 511 |
+
f.write(code)
|
| 512 |
+
print('[FIX] Patched Open WebUI journal_mode=DELETE in db.py')
|
| 513 |
+
except Exception as e:
|
| 514 |
+
print('[FIX] Could not patch db.py:', e)
|
| 515 |
+
" 2>/dev/null || true
|
| 516 |
+
|
| 517 |
# 5. Start Open WebUI
|
| 518 |
echo "[INIT] Starting Open WebUI on port 8098..."
|
| 519 |
if command -v open-webui >/dev/null 2>&1; then
|