[GH-ISSUE #39] SQLite threading error in daemon mode with multiple sources #23

Open
opened 2026-10-18 21:13:34 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Lyhtande on GitHub (Jun 8, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/39

Bug Description

When running the oikb daemon with multiple Google Drive sources configured, 4 out of 5 sources fail with a SQLite threading error. Only the first source that completes successfully works; all others fail.

Error Message

SQLite objects created in a thread can only be used in that same thread. 
The object was created in thread id 139887652107968 and this is thread id 139887643715264.

Environment

  • oikb version: 0.3.5 (Docker image built from ghcr.io/open-webui/oikb:latest + pip install oikb[gdrive])
  • Open WebUI: 0.9.x
  • Connector: Google Drive (gdrive:)
  • Number of sources: 5
  • Platform: Ubuntu 22.04, Docker

Configuration (.oikb.yaml)

defaults:
  interval: 1h
  concurrency: 1
  filter:
    max-size: 50mb

sources:
  - name: source-1
    source: gdrive:REDACTED_FOLDER_ID_1
    kb-id: REDACTED_KB_ID_1

  - name: source-2
    source: gdrive:REDACTED_FOLDER_ID_2
    kb-id: REDACTED_KB_ID_2

  - name: source-3
    source: gdrive:REDACTED_FOLDER_ID_3
    kb-id: REDACTED_KB_ID_3

  - name: source-4
    source: gdrive:REDACTED_FOLDER_ID_4
    kb-id: REDACTED_KB_ID_4

  - name: source-5
    source: gdrive:REDACTED_FOLDER_ID_5
    kb-id: REDACTED_KB_ID_5

Health Endpoint Output

{
  "gdrive:REDACTED_1": {"name": "source-1", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."},
  "gdrive:REDACTED_2": {"name": "source-2", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."},
  "gdrive:REDACTED_3": {"name": "source-3", "status": "success", ...},
  "gdrive:REDACTED_4": {"name": "source-4", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."},
  "gdrive:REDACTED_5": {"name": "source-5", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."}
}

Expected Behavior

All 5 sources should sync successfully. Setting concurrency: 1 does not resolve the issue — the daemon appears to run source-level scheduling in parallel threads regardless of the concurrency setting, and the SQLite connection is not thread-safe across them.

Workaround

None found so far. Reducing concurrency to 1 has no effect on this error.

Originally created by @Lyhtande on GitHub (Jun 8, 2026). Original GitHub issue: https://github.com/open-webui/oikb/issues/39 ## Bug Description When running the oikb daemon with multiple Google Drive sources configured, 4 out of 5 sources fail with a SQLite threading error. Only the first source that completes successfully works; all others fail. ## Error Message ``` SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139887652107968 and this is thread id 139887643715264. ``` ## Environment - oikb version: 0.3.5 (Docker image built from `ghcr.io/open-webui/oikb:latest` + `pip install oikb[gdrive]`) - Open WebUI: 0.9.x - Connector: Google Drive (`gdrive:`) - Number of sources: 5 - Platform: Ubuntu 22.04, Docker ## Configuration (.oikb.yaml) ```yaml defaults: interval: 1h concurrency: 1 filter: max-size: 50mb sources: - name: source-1 source: gdrive:REDACTED_FOLDER_ID_1 kb-id: REDACTED_KB_ID_1 - name: source-2 source: gdrive:REDACTED_FOLDER_ID_2 kb-id: REDACTED_KB_ID_2 - name: source-3 source: gdrive:REDACTED_FOLDER_ID_3 kb-id: REDACTED_KB_ID_3 - name: source-4 source: gdrive:REDACTED_FOLDER_ID_4 kb-id: REDACTED_KB_ID_4 - name: source-5 source: gdrive:REDACTED_FOLDER_ID_5 kb-id: REDACTED_KB_ID_5 ``` ## Health Endpoint Output ```json { "gdrive:REDACTED_1": {"name": "source-1", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."}, "gdrive:REDACTED_2": {"name": "source-2", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."}, "gdrive:REDACTED_3": {"name": "source-3", "status": "success", ...}, "gdrive:REDACTED_4": {"name": "source-4", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."}, "gdrive:REDACTED_5": {"name": "source-5", "status": "error", "error": "SQLite objects created in a thread can only be used in that same thread..."} } ``` ## Expected Behavior All 5 sources should sync successfully. Setting `concurrency: 1` does not resolve the issue — the daemon appears to run source-level scheduling in parallel threads regardless of the concurrency setting, and the SQLite connection is not thread-safe across them. ## Workaround None found so far. Reducing `concurrency` to 1 has no effect on this error.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#23
No description provided.