Skip to content

[Bug]: Docker build fails at runtime with "No module named pip" due to non-portable venv #12651

@yesidc

Description

@yesidc

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

#4471

RAGFlow image version

v0.23.1

Other environment information

Actual behavior

The Docker container fails to start during the execution of entrypoint.sh. The logs show a fatal Python error: /ragflow/.venv/bin/python3: No module named pip.

This error is triggered within the ensure_docling function in entrypoint.sh when it attempts to run the command:

uv pip install ... "docling${DOCLING_PIN}"

The container starts successfully if this block is bypassed by setting the environment variable USE_DOCLING=false

Root Cause Analysis

The core issue stems from the combination of two factors in the Dockerfile:

  1. Migration to uv sync: The builder stage now uses uv sync to install Python dependencies. By design, uv sync creates a minimal, production-focused environment and does not install pip or other package management tools by default.

  2. Non-Portable Virtual Environment: The production stage copies the entire virtual environment from the builder stage.

Therefore, any command executed at runtime in the final container that attempts to use pip (including the uv pip install wrapper) will fail because the module is not present in the environment. This issue was likely introduced after migrating from poetry (which included pip in its environments) to uv sync.

Expected behavior

It should be able to install python dependencies from entrypoint.sh

Steps to reproduce

set `USE_DOCLING=true`

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working, pull request that fix bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions