{"record":{"id":"fdf4b960a4d3baf8","repo":"unslothai/unsloth","slug":"s3-dataset-loading-requires-boto3-install-it-with-fdf4b9","errorCode":null,"errorMessage":"S3 dataset loading requires boto3. Install it with: pip install boto3","messagePattern":"S3 dataset loading requires boto3\\. Install it with: pip install boto3","errorType":"http","errorClass":"HTTPException","httpStatus":501,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1207,"sourceCode":"                )\n\n        # No in-process ensure_transformers_version(): worker.py activates it before ML imports.\n\n        # A consented latest-transformers install stage-and-swaps .venv_t5_latest mid-spawn.\n        from utils.transformers_latest import is_install_in_progress\n\n        if is_install_in_progress():\n            raise HTTPException(\n                status_code = 409,\n                detail = (\"A transformers installation is in progress. Retry when it completes.\"),\n            )\n\n        # S3 dataset loading needs the optional boto3 dependency. Reject early so credentials are\n        # never accepted and then silently dropped on a host without boto3.\n        if request.s3_config is not None and not request.resume_from_checkpoint:\n            from core.training.s3_dataset import boto3_available\n            if not boto3_available():\n                raise HTTPException(\n                    status_code = 501,\n                    detail = \"S3 dataset loading requires boto3. Install it with: pip install boto3\",\n                )\n\n        if await asyncio.to_thread(backend.is_training_active):\n            existing_job_id: Optional[str] = getattr(backend, \"current_job_id\", \"\")\n            _reject_start_request(\n                backend,\n                reserved_start_request_id,\n                \"Training already active\",\n            )\n            return TrainingJobResponse(\n                job_id = existing_job_id or \"\",\n                status = \"error\",\n                message = (\n                    \"Training is already in progress. \"\n                    \"Stop current training before starting a new one.\"\n                ),","sourceCodeStart":1189,"sourceCodeEnd":1225,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L1189-L1225","documentation":"HTTP 501 (not implemented) raised when the request carries an s3_config (and is not a resume) on a host where the optional boto3 dependency is missing. The check runs before credentials are accepted so they are never silently dropped.","triggerScenarios":"POST /training/start with s3_config set on a host where 'import boto3' fails (core.training.s3_dataset.boto3_available() is False).","commonSituations":"Minimal install of the studio backend without the S3 extras; running in a container that omitted boto3; assuming S3 support is bundled by default.","solutions":["Install boto3 in the backend environment: pip install boto3","Or point the request at a local/HF dataset instead of S3","For deployments, add boto3 to the image/requirements so the 501 cannot recur"],"exampleFix":"# before\nPOST /training/start {\"s3_config\": {...}}  # 501\n\n# after (on the backend host)\n# pip install boto3\nPOST /training/start {\"s3_config\": {...}}","handlingStrategy":"validation","validationCode":"# client cannot check boto3 on the server; guard on request shape instead\nif payload.get(\"s3_config\") is not None and not payload.get(\"resume_from_checkpoint\"):\n    ensure_s3_supported_host()  # ops check: backend host must have boto3 installed","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/training/start\", payload)\nif resp.status_code == 501 and \"boto3\" in resp.text:\n    raise MissingDependency(\"install boto3 on the backend host, then retry\")","preventionTips":["Install boto3 in the backend image/environment up front","Treat 501 as a provisioning error, not a request error: fix the host, keep the payload","Add a smoke test that posts an S3-config request after deployment"],"tags":["training","s3","boto3","missing-dependency","http-501"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}