[PR #2666] [MERGED] feat: External databases: reconnect to postgresql & mysql when connection is broken #59912

Closed
opened 2026-05-06 02:23:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/2666
Author: @PeterBeklemishev
Created: 5/30/2024
Status: Merged
Merged: 6/19/2024
Merged by: @tjbck

Base: devHead: feature-external-db-reconnect


📝 Commits (4)

  • dfbc125 Reconnect to postgresql & mysql external databases when getting disconnected
  • e1fa453 Test reconnection to postgres in gh actions
  • e59e1f5 Fix rebase artifacts
  • ad32a2e Drop mysql restarts

📊 Changes

3 files changed (+76 additions, -2 deletions)

View changed files

📝 .github/workflows/integration-test.yml (+20 -0)
📝 backend/apps/webui/internal/db.py (+7 -2)
backend/apps/webui/internal/wrappers.py (+49 -0)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Label: To cleary categorize this pull request, assign a relevant label to the pull request title, using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Added


Additional Information

Based on https://github.com/open-webui/open-webui/issues/2660

Example exception occuring without added reconnect mixin in case of closed connection
ollama        | [GIN] 2024/05/30 - 12:26:40 | 200 |      66.969µs |      172.28.0.4 | GET      "/api/tags"
open-webui    | INFO:     127.0.0.1:43728 - "GET /health HTTP/1.1" 500 Internal Server Error
open-webui    | ERROR:    Exception in ASGI application
open-webui    |   + Exception Group Traceback (most recent call last):
open-webui    |   |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
open-webui    |   |     yield
open-webui    |   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
open-webui    |   |     async with anyio.create_task_group() as task_group:
open-webui    |   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
open-webui    |   |     raise BaseExceptionGroup(
open-webui    |   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
open-webui    |   +-+---------------- 1 ----------------
open-webui    |     | Traceback (most recent call last):
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
open-webui    |     |     result = await app(  # type: ignore[func-returns-value]
open-webui    |     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
open-webui    |     |     return await self.app(scope, receive, send)
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
open-webui    |     |     await super().__call__(scope, receive, send)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
open-webui    |     |     await self.middleware_stack(scope, receive, send)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
open-webui    |     |     raise exc
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
open-webui    |     |     await self.app(scope, receive, _send)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
open-webui    |     |     with collapse_excgroups():
open-webui    |     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
open-webui    |     |     self.gen.throw(typ, value, traceback)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
open-webui    |     |     raise exc
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
open-webui    |     |     response = await self.dispatch_func(request, call_next)
open-webui    |     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/app/backend/main.py", line 365, in update_embedding_function
open-webui    |     |     response = await call_next(request)
open-webui    |     |                ^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
open-webui    |     |     raise app_exc
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
open-webui    |     |     await self.app(scope, receive_or_disconnect, send_no_error)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
open-webui    |     |     with collapse_excgroups():
open-webui    |     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
open-webui    |     |     self.gen.throw(typ, value, traceback)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
open-webui    |     |     raise exc
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
open-webui    |     |     response = await self.dispatch_func(request, call_next)
open-webui    |     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/app/backend/main.py", line 351, in check_url
open-webui    |     |     await get_all_models()
open-webui    |     |   File "/app/backend/main.py", line 408, in get_all_models
open-webui    |     |     custom_models = Models.get_all_models()
open-webui    |     |                     ^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/app/backend/apps/webui/models/models.py", line 148, in get_all_models
open-webui    |     |     return [ModelModel(**model_to_dict(model)) for model in Model.select()]
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 7260, in __iter__
open-webui    |     |     self.execute()
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2025, in inner
open-webui    |     |     return method(self, database, *args, **kwargs)
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2096, in execute
open-webui    |     |     return self._execute(database)
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2269, in _execute
open-webui    |     |     cursor = database.execute(self)
open-webui    |     |              ^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3319, in execute
open-webui    |     |     return self.execute_sql(sql, params)
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3309, in execute_sql
open-webui    |     |     with __exception_wrapper__:
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3077, in __exit__
open-webui    |     |     reraise(new_type, new_type(exc_value, *exc_args), traceback)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 196, in reraise
open-webui    |     |     raise value.with_traceback(tb)
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3310, in execute_sql
open-webui    |     |     cursor = self.cursor()
open-webui    |     |              ^^^^^^^^^^^^^
open-webui    |     |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3303, in cursor
open-webui    |     |     return self._state.conn.cursor()
open-webui    |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |     | peewee.InterfaceError: connection already closed
open-webui    |     +------------------------------------
open-webui    | 
open-webui    | During handling of the above exception, another exception occurred:
open-webui    | 
open-webui    | Traceback (most recent call last):
open-webui    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
open-webui    |     result = await app(  # type: ignore[func-returns-value]
open-webui    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
open-webui    |     return await self.app(scope, receive, send)
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
open-webui    |     await super().__call__(scope, receive, send)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
open-webui    |     await self.middleware_stack(scope, receive, send)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
open-webui    |     raise exc
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
open-webui    |     await self.app(scope, receive, _send)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
open-webui    |     with collapse_excgroups():
open-webui    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
open-webui    |     self.gen.throw(typ, value, traceback)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
open-webui    |     raise exc
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
open-webui    |     response = await self.dispatch_func(request, call_next)
open-webui    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/app/backend/main.py", line 365, in update_embedding_function
open-webui    |     response = await call_next(request)
open-webui    |                ^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
open-webui    |     raise app_exc
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
open-webui    |     await self.app(scope, receive_or_disconnect, send_no_error)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
open-webui    |     with collapse_excgroups():
open-webui    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
open-webui    |     self.gen.throw(typ, value, traceback)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
open-webui    |     raise exc
open-webui    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
open-webui    |     response = await self.dispatch_func(request, call_next)
open-webui    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/app/backend/main.py", line 351, in check_url
open-webui    |     await get_all_models()
open-webui    |   File "/app/backend/main.py", line 408, in get_all_models
open-webui    |     custom_models = Models.get_all_models()
open-webui    |                     ^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/app/backend/apps/webui/models/models.py", line 148, in get_all_models
open-webui    |     return [ModelModel(**model_to_dict(model)) for model in Model.select()]
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 7260, in __iter__
open-webui    |     self.execute()
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2025, in inner
open-webui    |     return method(self, database, *args, **kwargs)
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2096, in execute
open-webui    |     return self._execute(database)
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2269, in _execute
open-webui    |     cursor = database.execute(self)
open-webui    |              ^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3319, in execute
open-webui    |     return self.execute_sql(sql, params)
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3309, in execute_sql
open-webui    |     with __exception_wrapper__:
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3077, in __exit__
open-webui    |     reraise(new_type, new_type(exc_value, *exc_args), traceback)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 196, in reraise
open-webui    |     raise value.with_traceback(tb)
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3310, in execute_sql
open-webui    |     cursor = self.cursor()
open-webui    |              ^^^^^^^^^^^^^
open-webui    |   File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3303, in cursor
open-webui    |     return self._state.conn.cursor()
open-webui    |            ^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui    | peewee.InterfaceError: connection already closed

Screenshots or Videos

  • none

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/2666 **Author:** [@PeterBeklemishev](https://github.com/PeterBeklemishev) **Created:** 5/30/2024 **Status:** ✅ Merged **Merged:** 6/19/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `feature-external-db-reconnect` --- ### 📝 Commits (4) - [`dfbc125`](https://github.com/open-webui/open-webui/commit/dfbc12594702bf601c4c391cfe080f8e0844d01e) Reconnect to postgresql & mysql external databases when getting disconnected - [`e1fa453`](https://github.com/open-webui/open-webui/commit/e1fa453edae689c5eea6af0b23e3dc1e158b302f) Test reconnection to postgres in gh actions - [`e59e1f5`](https://github.com/open-webui/open-webui/commit/e59e1f5049c1b3d9b5ff7f61d7f6051cd2950b22) Fix rebase artifacts - [`ad32a2e`](https://github.com/open-webui/open-webui/commit/ad32a2ef3cc508d6540b16a762dec31b773818c6) Drop mysql restarts ### 📊 Changes **3 files changed** (+76 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/integration-test.yml` (+20 -0) 📝 `backend/apps/webui/internal/db.py` (+7 -2) ➕ `backend/apps/webui/internal/wrappers.py` (+49 -0) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [ ] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [ ] **Label:** To cleary categorize this pull request, assign a relevant label to the pull request title, using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Added - Auto-reconnection to postgresql/mysql databases, proposed in https://github.com/open-webui/open-webui/issues/2660 --- ### Additional Information Based on https://github.com/open-webui/open-webui/issues/2660 <details> <summary>Example exception occuring without added reconnect mixin in case of closed connection</summary> ``` ollama | [GIN] 2024/05/30 - 12:26:40 | 200 | 66.969µs | 172.28.0.4 | GET "/api/tags" open-webui | INFO: 127.0.0.1:43728 - "GET /health HTTP/1.1" 500 Internal Server Error open-webui | ERROR: Exception in ASGI application open-webui | + Exception Group Traceback (most recent call last): open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups open-webui | | yield open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ open-webui | | async with anyio.create_task_group() as task_group: open-webui | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ open-webui | | raise BaseExceptionGroup( open-webui | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) open-webui | +-+---------------- 1 ---------------- open-webui | | Traceback (most recent call last): open-webui | | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi open-webui | | result = await app( # type: ignore[func-returns-value] open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ open-webui | | return await self.app(scope, receive, send) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ open-webui | | await super().__call__(scope, receive, send) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ open-webui | | await self.middleware_stack(scope, receive, send) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ open-webui | | raise exc open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ open-webui | | await self.app(scope, receive, _send) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ open-webui | | with collapse_excgroups(): open-webui | | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ open-webui | | self.gen.throw(typ, value, traceback) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups open-webui | | raise exc open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ open-webui | | response = await self.dispatch_func(request, call_next) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/app/backend/main.py", line 365, in update_embedding_function open-webui | | response = await call_next(request) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next open-webui | | raise app_exc open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro open-webui | | await self.app(scope, receive_or_disconnect, send_no_error) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ open-webui | | with collapse_excgroups(): open-webui | | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ open-webui | | self.gen.throw(typ, value, traceback) open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups open-webui | | raise exc open-webui | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ open-webui | | response = await self.dispatch_func(request, call_next) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/app/backend/main.py", line 351, in check_url open-webui | | await get_all_models() open-webui | | File "/app/backend/main.py", line 408, in get_all_models open-webui | | custom_models = Models.get_all_models() open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/app/backend/apps/webui/models/models.py", line 148, in get_all_models open-webui | | return [ModelModel(**model_to_dict(model)) for model in Model.select()] open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 7260, in __iter__ open-webui | | self.execute() open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2025, in inner open-webui | | return method(self, database, *args, **kwargs) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2096, in execute open-webui | | return self._execute(database) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2269, in _execute open-webui | | cursor = database.execute(self) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3319, in execute open-webui | | return self.execute_sql(sql, params) open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3309, in execute_sql open-webui | | with __exception_wrapper__: open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3077, in __exit__ open-webui | | reraise(new_type, new_type(exc_value, *exc_args), traceback) open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 196, in reraise open-webui | | raise value.with_traceback(tb) open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3310, in execute_sql open-webui | | cursor = self.cursor() open-webui | | ^^^^^^^^^^^^^ open-webui | | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3303, in cursor open-webui | | return self._state.conn.cursor() open-webui | | ^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | | peewee.InterfaceError: connection already closed open-webui | +------------------------------------ open-webui | open-webui | During handling of the above exception, another exception occurred: open-webui | open-webui | Traceback (most recent call last): open-webui | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi open-webui | result = await app( # type: ignore[func-returns-value] open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ open-webui | return await self.app(scope, receive, send) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ open-webui | await super().__call__(scope, receive, send) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ open-webui | await self.middleware_stack(scope, receive, send) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ open-webui | raise exc open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ open-webui | await self.app(scope, receive, _send) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ open-webui | with collapse_excgroups(): open-webui | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ open-webui | self.gen.throw(typ, value, traceback) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups open-webui | raise exc open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ open-webui | response = await self.dispatch_func(request, call_next) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/main.py", line 365, in update_embedding_function open-webui | response = await call_next(request) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next open-webui | raise app_exc open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro open-webui | await self.app(scope, receive_or_disconnect, send_no_error) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ open-webui | with collapse_excgroups(): open-webui | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ open-webui | self.gen.throw(typ, value, traceback) open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups open-webui | raise exc open-webui | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ open-webui | response = await self.dispatch_func(request, call_next) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/main.py", line 351, in check_url open-webui | await get_all_models() open-webui | File "/app/backend/main.py", line 408, in get_all_models open-webui | custom_models = Models.get_all_models() open-webui | ^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/app/backend/apps/webui/models/models.py", line 148, in get_all_models open-webui | return [ModelModel(**model_to_dict(model)) for model in Model.select()] open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 7260, in __iter__ open-webui | self.execute() open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2025, in inner open-webui | return method(self, database, *args, **kwargs) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2096, in execute open-webui | return self._execute(database) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 2269, in _execute open-webui | cursor = database.execute(self) open-webui | ^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3319, in execute open-webui | return self.execute_sql(sql, params) open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3309, in execute_sql open-webui | with __exception_wrapper__: open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3077, in __exit__ open-webui | reraise(new_type, new_type(exc_value, *exc_args), traceback) open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 196, in reraise open-webui | raise value.with_traceback(tb) open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3310, in execute_sql open-webui | cursor = self.cursor() open-webui | ^^^^^^^^^^^^^ open-webui | File "/usr/local/lib/python3.11/site-packages/peewee.py", line 3303, in cursor open-webui | return self._state.conn.cursor() open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui | peewee.InterfaceError: connection already closed ``` </details> ### Screenshots or Videos - none --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 02:23:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#59912