{"record":{"id":"c422bdf605b5cef9","repo":"anomalyco/sst","slug":"uv-pip-install-timed-out-after-15-minutes-check","errorCode":null,"errorMessage":"uv pip install timed out after 15 minutes - check network connectivity and try again","messagePattern":"uv pip install timed out after 15 minutes - check network connectivity and try again","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":971,"sourceCode":"\t\tresultChan <- cmdResult{output, err}\n\t}()\n\n\tvar installOutput []byte\n\tselect {\n\tcase result := <-resultChan:\n\t\tclose(progressDone)\n\t\tinstallOutput = result.output\n\t\terr = result.err\n\tcase <-installCtx.Done():\n\t\tclose(progressDone)\n\t\tif installCmd.Process != nil {\n\t\t\tinstallCmd.Process.Kill()\n\t\t}\n\t\t// Remove partial cache on timeout\n\t\tif cacheKey != \"\" {\n\t\t\tos.RemoveAll(depsCacheDir)\n\t\t}\n\t\treturn fmt.Errorf(\"uv pip install timed out after 15 minutes - check network connectivity and try again\")\n\t}\n\n\tif err != nil {\n\t\tslog.Error(\"uv pip install failed\",\n\t\t\t\"command\", strings.Join(installCmd.Args, \" \"),\n\t\t\t\"error\", err,\n\t\t\t\"output\", string(installOutput),\n\t\t\t\"functionID\", input.FunctionID,\n\t\t\t\"handler\", input.Handler,\n\t\t\t\"workingDir\", installWorkspaceDir,\n\t\t\t\"pyprojectPath\", projectInfo.PyprojectPath)\n\t\tif cacheKey != \"\" {\n\t\t\tos.RemoveAll(depsCacheDir)\n\t\t}\n\t\treturn fmt.Errorf(\"failed to run uv pip install: %v\\n%s\\n\\nFunction: %s\\nHandler: %s\\nWorking directory: %s\\nPyproject path: %s\",\n\t\t\terr, string(installOutput), input.FunctionID, input.Handler, installWorkspaceDir, projectInfo.PyprojectPath)\n\t}\n","sourceCodeStart":953,"sourceCodeEnd":989,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L953-L989","documentation":"During Lambda Python builds, SST runs `uv pip install` with a hard 15-minute context deadline (build.go:921). If the install does not finish within that window, the process is killed, any partial dependency cache is deleted (os.RemoveAll(depsCacheDir)), and this error is returned from copySyncedDependencies. It means dependency resolution/download was too slow or hung, most often due to network problems, a slow package index, or an extremely large dependency set.","triggerScenarios":"Specifically: uv pip install started by copySyncedDependencies (via installDependenciesForLambda) does not complete before the 15-minute context.WithTimeout fires; the select falls into the installCtx.Done() branch, kills installCmd.Process, purges the partial depsCacheDir, and returns this error.","commonSituations":"Corporate proxy/firewall silently dropping connections to PyPI; using a slow internal index or no index mirror; huge wheels (torch, tensorflow, cuda packages) exceeding the budget; uv hanging waiting on an auth prompt for a private index; IPv6 issues in containers.","solutions":["Verify network connectivity to your package index from the build machine (curl -I https://pypi.org/simple/); fix proxy/VPN/DNS if unreachable","Configure a fast mirror or internal index (UV_INDEX_URL / --index-url in pyproject.toml or requirements.txt)","Trim or split heavyweight dependencies (e.g. CPU-only torch wheels) to reduce download time","Increase availability by ensuring private-index credentials are available non-interactively (UV_INDEX env vars or netrc) so uv does not hang on a prompt","Retry the deploy — the partial cache was already removed, so a rerun starts clean"],"exampleFix":"// before: uv resolves slowly over a flaky network\ncmd: sst deploy  # times out after 15m\n\n// after: pin a fast mirror before deploying\nexport UV_DEFAULT_INDEX=\"https://pypi.org/simple\"\nexport UV_HTTP_TIMEOUT=120\ncmd: sst deploy","handlingStrategy":"retry","validationCode":"// before deploying, verify index reachability\ncurl -fsSI --max-time 10 https://pypi.org/simple/ >/dev/null && echo \"index reachable\" || echo \"network problem\"\n// and confirm uv is installed and fast:\nuv --version && time uv pip compile pyproject.toml -o /dev/null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set UV_HTTP_TIMEOUT and a fast index mirror before deploys","Avoid heavyweight wheels (torch/cuda) in Lambda functions; vendor slim alternatives","Ensure private index credentials are in env/netrc so uv never blocks on a prompt","Watch for the 30-second 'uv pip install still running' warnings in logs to catch hangs early"],"tags":["timeout","network","python","uv","build"],"backgroundTag":"pip-install-timeout","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}