[PR #5160] [MERGED] fix: avoid overriding DATA_DIR and prevent errors when directories are the same #8429

Closed
opened 2025-11-11 17:56:30 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/5160
Author: @vikrantrathore
Created: 9/5/2024
Status: Merged
Merged: 9/5/2024
Merged by: @tjbck

Base: mainHead: main


📝 Commits (2)

  • 74169b0 fix: avoid overriding DATA_DIR and prevent errors when directories are the same
  • 85fc354 refac

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 backend/open_webui/env.py (+3 -2)

📄 Description

Changelog Entry

  • Fix a bug related to existing DATA_DIR when using PIP_INSTALL as True

Description

Previously, the DATA_DIR environment variable was always overridden by defaulting to OPEN_WEBUI_DIR / "data", which ignored user-defined DATA_DIR values. Additionally, when DATA_DIR and NEW_DATA_DIR were the same, the script attempted to copy files into themselves, leading to errors or redundant operations.

This commit ensures that:

  1. The DATA_DIR environment variable is respected and not overridden.
  2. Copy operations between DATA_DIR and NEW_DATA_DIR are only performed if the directories are different, preventing errors when they point to the same location.

These changes resolve potential file copy errors and preserve user configurations.

Fixed

  • These changes resolve potential file copy errors and preserve user configurations when DATA_DIR is set to already existing data directory of open-webui

🔄 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/5160 **Author:** [@vikrantrathore](https://github.com/vikrantrathore) **Created:** 9/5/2024 **Status:** ✅ Merged **Merged:** 9/5/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`74169b0`](https://github.com/open-webui/open-webui/commit/74169b0320995b9b31cdd610b020e9b645b14c8d) fix: avoid overriding DATA_DIR and prevent errors when directories are the same - [`85fc354`](https://github.com/open-webui/open-webui/commit/85fc35492d88ecb701cd389ddca4cc32fdce84de) refac ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/env.py` (+3 -2) </details> ### 📄 Description # Changelog Entry - Fix a bug related to existing DATA_DIR when using PIP_INSTALL as True ### Description Previously, the `DATA_DIR` environment variable was always overridden by defaulting to `OPEN_WEBUI_DIR / "data"`, which ignored user-defined `DATA_DIR` values. Additionally, when `DATA_DIR` and `NEW_DATA_DIR` were the same, the script attempted to copy files into themselves, leading to errors or redundant operations. This commit ensures that: 1. The `DATA_DIR` environment variable is respected and not overridden. 2. Copy operations between `DATA_DIR` and `NEW_DATA_DIR` are only performed if the directories are different, preventing errors when they point to the same location. These changes resolve potential file copy errors and preserve user configurations. ### Fixed - These changes resolve potential file copy errors and preserve user configurations when DATA_DIR is set to already existing data directory of open-webui --- <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 2025-11-11 17:56:30 -06: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#8429