mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-18 02:04:06 -05:00
[PR #24721] [CLOSED] fix: avoid unbound variables in backend/start.sh under set -u #115109
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24721
Author: @jmleksan
Created: 5/14/2026
Status: ❌ Closed
Base:
dev← Head:fix/assign-startsh-variables📝 Commits (1)
ee67cc5feat: add environment variable support for web loader, Ollama, and CUDA in start script📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
backend/start.sh(+3 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
dev.CHANGELOG.mdif your process requires it).WEB_LOADER_ENGINE,USE_OLLAMA_DOCKER, andUSE_CUDA_DOCKER.set -u.fix:Changelog Entry
set -u. Optional environment variables (WEB_LOADER_ENGINE,USE_OLLAMA_DOCKER,USE_CUDA_DOCKER) are defaulted before case-insensitive comparisons so the container entrypoint no longer exits withunbound variablewhen those variables are omitted from the environment.Description
backend/start.shusesset -euo pipefail. Underset -u, expanding${VAR,,}still requiresVARto be set. If optional environment variables such asWEB_LOADER_ENGINE,USE_OLLAMA_DOCKER, orUSE_CUDA_DOCKERare not passed into the container (or shell), Bash exits withunbound variablebefore the server starts.This PR defaults those variables before lowercasing / comparing, so missing env vars behave as “disabled” instead of crashing startup.
Changed
backend/start.sh: Optional flags are read safely underset -u(Playwright branch uses a defaulting assignment in theiflist; Ollama/CUDA branches default the variable before${VAR,,}).Fixed
WEB_LOADER_ENGINE: unbound variable(and the same class of error forUSE_OLLAMA_DOCKER/USE_CUDA_DOCKER) when those variables are unset.Additional Information
Root cause:
set -u+${PARAMETER,,}still referencesPARAMETER; it is not equivalent to${PARAMETER:-}.Manual test suggestions
bash backend/start.shin a throwaway env) with noWEB_LOADER_ENGINE— expect no error and no Playwright install branch unlessWEB_LOADER_ENGINE=playwright.USE_OLLAMA_DOCKERandUSE_CUDA_DOCKERunset — expect script to continue to uvicorn unless set totrue.WEB_LOADER_ENGINE=playwrightand noPLAYWRIGHT_WS_URL, confirm Chromium install path still runs when intended.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.