In oauth.py, a bare except: clause was used which catches all exceptions including SystemExit and KeyboardInterrupt. This prevents clean process shutdown and makes debugging harder.
Fixed
Replaced bare except: with except Exception: so that SystemExit, KeyboardInterrupt, and other BaseException subclasses are no longer silently caught.
Additional Information
Tested by reviewing the code path and verifying the fix addresses the issue
Self-reviewed the code changes
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 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/22420
**Author:** [@gambletan](https://github.com/gambletan)
**Created:** 3/8/2026
**Status:** ✅ Merged
**Merged:** 3/8/2026
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/bare-except-oauth`
---
### 📝 Commits (2)
- [`cae0603`](https://github.com/open-webui/open-webui/commit/cae0603daceed8f2ca8dbad96bd9a3257453adf9) fix: replace bare except with except Exception in main.py
- [`a65d5a2`](https://github.com/open-webui/open-webui/commit/a65d5a2f6a755a285b448045995ac4f0f6fce8ab) fix: replace bare except with Exception in oauth.py
### 📊 Changes
**2 files changed** (+3 additions, -3 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/main.py` (+2 -2)
📝 `backend/open_webui/utils/oauth.py` (+1 -1)
</details>
### 📄 Description
### Description
- In `oauth.py`, a bare `except:` clause was used which catches all exceptions including `SystemExit` and `KeyboardInterrupt`. This prevents clean process shutdown and makes debugging harder.
### Fixed
- Replaced bare `except:` with `except Exception:` so that `SystemExit`, `KeyboardInterrupt`, and other `BaseException` subclasses are no longer silently caught.
### Additional Information
- Tested by reviewing the code path and verifying the fix addresses the issue
- Self-reviewed the code changes
### Contributor License Agreement
- [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22420
Author: @gambletan
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @tjbck
Base:
dev← Head:fix/bare-except-oauth📝 Commits (2)
cae0603fix: replace bare except with except Exception in main.pya65d5a2fix: replace bare except with Exception in oauth.py📊 Changes
2 files changed (+3 additions, -3 deletions)
View changed files
📝
backend/open_webui/main.py(+2 -2)📝
backend/open_webui/utils/oauth.py(+1 -1)📄 Description
Description
oauth.py, a bareexcept:clause was used which catches all exceptions includingSystemExitandKeyboardInterrupt. This prevents clean process shutdown and makes debugging harder.Fixed
except:withexcept Exception:so thatSystemExit,KeyboardInterrupt, and otherBaseExceptionsubclasses are no longer silently caught.Additional Information
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.