unslothai/unsloth · warning · HTTPException

A transformers installation is in progress. Retry when it co

Error message

A transformers installation is in progress. Retry when it completes.

What it means

HTTP 409 raised when utils.transformers_latest.is_install_in_progress() reports an active stage-and-swap install of the latest-transformers venv (.venv_t5_latest). Starting training mid-swap could run against a half-replaced environment, so the route refuses until the install completes.

Source

Thrown at studio/backend/routes/training.py:1197

            if (
                other_inference_request_count(current_request_counted = False) > 0
                or _background_video_generation_active()
            ):
                raise HTTPException(
                    status_code = 409,
                    detail = (
                        "Cannot start training over the API while an inference request is in "
                        "progress. Wait for it to finish, or start training from the Unsloth UI."
                    ),
                )

        # No in-process ensure_transformers_version(): worker.py activates it before ML imports.

        # A consented latest-transformers install stage-and-swaps .venv_t5_latest mid-spawn.
        from utils.transformers_latest import is_install_in_progress

        if is_install_in_progress():
            raise HTTPException(
                status_code = 409,
                detail = ("A transformers installation is in progress. Retry when it completes."),
            )

        # S3 dataset loading needs the optional boto3 dependency. Reject early so credentials are
        # never accepted and then silently dropped on a host without boto3.
        if request.s3_config is not None and not request.resume_from_checkpoint:
            from core.training.s3_dataset import boto3_available
            if not boto3_available():
                raise HTTPException(
                    status_code = 501,
                    detail = "S3 dataset loading requires boto3. Install it with: pip install boto3",
                )

        if await asyncio.to_thread(backend.is_training_active):
            existing_job_id: Optional[str] = getattr(backend, "current_job_id", "")
            _reject_start_request(
                backend,

View on GitHub (pinned to 203007d190)

Solutions

  1. Wait for the transformers installation to complete (watch install status in the UI/logs), then retry the training start
  2. If the install appears stuck, inspect the install log/process and resolve it before retrying
  3. Do not run the latest-transformers install concurrently with training starts

Example fix

// before
resp = client.post("/training/start", payload)  # 409 install in progress

// after
# poll until install completes, then retry
while install_status_endpoint().in_progress:
    time.sleep(10)
resp = client.post("/training/start", payload)
Defensive patterns

Strategy: retry

Try / catch

resp = client.post("/training/start", payload)
if resp.status_code == 409 and "transformers installation is in progress" in resp.text:
    wait_for_install_completion()  # poll install status or logs
    resp = client.post("/training/start", payload)

Prevention

When it happens

Trigger: POST /training/start while a consented 'latest transformers' installation is staging or swapping the alternate virtualenv.

Common situations: User clicked install-latest-transformers in the UI and immediately started training; an automated env upgrade racing a scheduled training job.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/9029bae471ba89f5. Report an issue: GitHub.