Skip to content

Fix: Docker build failure due to pip hash mismatch in backend-builder stage #286

@mohammedimohamed

Description

@mohammedimohamed

Description

When attempting to build the Docker image using docker-compose up, the build fails during Stage 2: Build Python dependencies. The error occurs when installing Qwen3-TTS from the GitHub repository, specifically triggering a THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE error.

This is likely due to an outdated pip version in the python:3.11-slim base image or a change in the remote dependency tree that mismatches the cached metadata.

Error Logs

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE.
unknown package:
    Expected sha256 4376c11ad263152bd50ea295c05370360776f8c3427b30991df774f9fb26c450
    Got          d24e803cc9e9167b30c6ebb6c5a8a71f064262ddb19cb3c44b2b631756d367c4
...
ERROR: process "/bin/sh -c pip install --no-cache-dir --prefix=/install git+https://github.com/QwenLM/Qwen3-TTS.git" did not complete successfully: exit code: 1

Proposed Fix

To resolve this, we should upgrade pip to the latest version before installing requirements and ensure the installation is performed without conflicting cache.

Modify lines 35–37 in the Dockerfile as follows:

# Upgrade pip to handle modern package hashing correctly
RUN pip install --no-cache-dir --upgrade pip

COPY backend/requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt

# Install Qwen3-TTS with a clean cache
RUN pip install --no-cache-dir --prefix=/install \
    git+https://github.com/QwenLM/Qwen3-TTS.git

Steps to reproduce

  1. Clone the repository.
  2. Run docker-compose build.
  3. The build will fail at the backend-builder stage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions