[PR #18977] [CLOSED] fix: resolve Firecrawl import error and Socket.IO CORS warning #63898

Closed
opened 2026-05-06 09:03:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18977
Author: @Limbicnation
Created: 11/6/2025
Status: Closed

Base: devHead: fix/firecrawl-import-and-socketio-cors


📝 Commits (2)

  • e85c7f7 Merge pull request #18402 from open-webui/dev
  • 5387b6d fix: resolve Firecrawl import error and Socket.IO CORS warning

📊 Changes

3 files changed (+10 additions, -7 deletions)

View changed files

📝 backend/open_webui/retrieval/web/firecrawl.py (+2 -2)
📝 backend/open_webui/retrieval/web/utils.py (+3 -3)
📝 backend/open_webui/socket/main.py (+5 -2)

📄 Description

Description

Fixes #18973

This PR resolves two critical bugs preventing Open WebUI from starting:

  1. Firecrawl Import Error: Updates imports to use FirecrawlApp instead of Firecrawl
  2. Socket.IO CORS Warning: Properly handles wildcard CORS origins for Socket.IO

Changes Made

Firecrawl Import Fix

  • Updated import from Firecrawl to FirecrawlApp in backend/open_webui/retrieval/web/utils.py
  • Updated import from Firecrawl to FirecrawlApp in backend/open_webui/retrieval/web/firecrawl.py
  • Updated all class instantiations to use FirecrawlApp

Root Cause: The firecrawl package (v1.12.0+) changed its exported class from Firecrawl to FirecrawlApp, causing ImportError on startup.

Socket.IO CORS Fix

  • Modified backend/open_webui/socket/main.py to properly handle wildcard CORS origins
  • Added SOCKETIO_CORS_ORIGINS variable to convert ["*"] to "*" for Socket.IO compatibility

Root Cause: Socket.IO requires wildcard CORS as string "*", not list ["*"], causing origin validation warnings.

Pull Request Checklist

  • Target branch: Targets the dev branch
  • Description: Concise description provided above
  • Changelog: Added below following Keep a Changelog format
  • Documentation: No documentation changes needed (bug fix only)
  • Dependencies: No new dependencies
  • Testing: Manually tested - application starts without errors, Socket.IO connects successfully
  • Agentic AI Code: Code reviewed and manually tested by human contributor
  • Code review: Self-reviewed for code quality and standards compliance
  • Title Prefix: Using fix: prefix

Changelog Entry

Description

Fixed critical ImportError preventing application startup and resolved Socket.IO CORS origin validation warnings.

Added

  • SOCKETIO_CORS_ORIGINS variable in backend/open_webui/socket/main.py for proper CORS handling

Changed

  • Updated firecrawl imports from Firecrawl to FirecrawlApp in all affected files
  • Modified Socket.IO server configuration to use string wildcard for CORS

Fixed

  • Fixed ImportError: cannot import name 'Firecrawl' from 'firecrawl' (Issue #18973)
  • Fixed Socket.IO CORS warning: "is not an accepted origin" when using default CORS configuration
  • Fixed compatibility with firecrawl package v1.12.0+

Additional Information

  • Tested with firecrawl v1.12.0
  • Both fixes are backwards compatible
  • No breaking changes to existing functionality

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/18977 **Author:** [@Limbicnation](https://github.com/Limbicnation) **Created:** 11/6/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/firecrawl-import-and-socketio-cors` --- ### 📝 Commits (2) - [`e85c7f7`](https://github.com/open-webui/open-webui/commit/e85c7f79310f351672fe967a102396b6f3f5e88b) Merge pull request #18402 from open-webui/dev - [`5387b6d`](https://github.com/open-webui/open-webui/commit/5387b6d8b8c44cfedc6037457f3f0eb4ea125efa) fix: resolve Firecrawl import error and Socket.IO CORS warning ### 📊 Changes **3 files changed** (+10 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/web/firecrawl.py` (+2 -2) 📝 `backend/open_webui/retrieval/web/utils.py` (+3 -3) 📝 `backend/open_webui/socket/main.py` (+5 -2) </details> ### 📄 Description ## Description Fixes #18973 This PR resolves two critical bugs preventing Open WebUI from starting: 1. **Firecrawl Import Error**: Updates imports to use `FirecrawlApp` instead of `Firecrawl` 2. **Socket.IO CORS Warning**: Properly handles wildcard CORS origins for Socket.IO ## Changes Made ### Firecrawl Import Fix - Updated import from `Firecrawl` to `FirecrawlApp` in `backend/open_webui/retrieval/web/utils.py` - Updated import from `Firecrawl` to `FirecrawlApp` in `backend/open_webui/retrieval/web/firecrawl.py` - Updated all class instantiations to use `FirecrawlApp` **Root Cause**: The firecrawl package (v1.12.0+) changed its exported class from `Firecrawl` to `FirecrawlApp`, causing ImportError on startup. ### Socket.IO CORS Fix - Modified `backend/open_webui/socket/main.py` to properly handle wildcard CORS origins - Added `SOCKETIO_CORS_ORIGINS` variable to convert `["*"]` to `"*"` for Socket.IO compatibility **Root Cause**: Socket.IO requires wildcard CORS as string `"*"`, not list `["*"]`, causing origin validation warnings. # Pull Request Checklist - [x] **Target branch:** Targets the `dev` branch - [x] **Description:** Concise description provided above - [x] **Changelog:** Added below following Keep a Changelog format - [ ] **Documentation:** No documentation changes needed (bug fix only) - [ ] **Dependencies:** No new dependencies - [x] **Testing:** Manually tested - application starts without errors, Socket.IO connects successfully - [x] **Agentic AI Code:** Code reviewed and manually tested by human contributor - [x] **Code review:** Self-reviewed for code quality and standards compliance - [x] **Title Prefix:** Using `fix:` prefix # Changelog Entry ### Description Fixed critical ImportError preventing application startup and resolved Socket.IO CORS origin validation warnings. ### Added - `SOCKETIO_CORS_ORIGINS` variable in `backend/open_webui/socket/main.py` for proper CORS handling ### Changed - Updated firecrawl imports from `Firecrawl` to `FirecrawlApp` in all affected files - Modified Socket.IO server configuration to use string wildcard for CORS ### Fixed - Fixed ImportError: `cannot import name 'Firecrawl' from 'firecrawl'` (Issue #18973) - Fixed Socket.IO CORS warning: "is not an accepted origin" when using default CORS configuration - Fixed compatibility with firecrawl package v1.12.0+ ### Additional Information - Tested with firecrawl v1.12.0 - Both fixes are backwards compatible - No breaking changes to existing functionality ### Contributor License Agreement 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>
GiteaMirror added the pull-request label 2026-05-06 09:03:41 -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#63898