{"record":{"id":"947e7c420ce431d4","repo":"anomalyco/sst","slug":"uv-build-failed-w","errorCode":null,"errorMessage":"uv build failed: %w","messagePattern":"uv build failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":1480,"sourceCode":"\n\tif cmd.OutputDir != \"\" {\n\t\targs = append(args, \"--out-dir=\"+cmd.OutputDir)\n\t}\n\n\targs = append(args, \"--no-sources\")\n\n\tworkingDir := cmd.PackageDir\n\tif workingDir == \"\" {\n\t\tworkingDir = \".\"\n\t}\n\n\tresult, err := runUvCommand(ctx, \"uv\", args, workingDir)\n\tif err != nil {\n\t\tslog.Error(\"UV build command failed\",\n\t\t\t\"package\", cmd.PackageName,\n\t\t\t\"command\", \"uv \"+strings.Join(args, \" \"),\n\t\t\t\"error\", err)\n\t\treturn fmt.Errorf(\"uv build failed: %w\", err)\n\t}\n\n\tif !result.Success {\n\t\treturn fmt.Errorf(\"uv build failed (exit code %d): %s\", result.ExitCode, result.Stderr)\n\t}\n\n\treturn nil\n}\n\n// runUvExport executes a UV export command\nfunc runUvExport(ctx context.Context, cmd *uvExportCommand) error {\n\targs := []string{\"export\"}\n\n\tif cmd.AllPackages {\n\t\targs = append(args, \"--all-packages\")\n\t} else if cmd.PackageName != \"\" {\n\t\targs = append(args, \"--package=\"+cmd.PackageName)\n\t}","sourceCodeStart":1462,"sourceCodeEnd":1498,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L1462-L1498","documentation":"runUvBuild shells out to the `uv` tool (uv build command, via runUvCommand) to build a workspace package defined in pyproject.toml. If the uv process itself fails to start or errors out (not a non-zero exit code, which produces the exit-code variant), this error wraps the exec error. The package cannot be built, so the function's dependencies cannot be assembled.","triggerScenarios":"buildPackage invokes runUvBuild for a workspace package and runUvCommand returns an error — typically the `uv` binary is not installed or not on PATH, the working directory is missing, or spawning the process failed (exec.ErrNotFound / permission denied).","commonSituations":"CI image or dev machine without uv installed; uv not on PATH for the build process (nvm/asdf version manager shims); wrong PATH in container; uv binary present but not executable.","solutions":["Install uv (curl -LsSf https://astral.sh/uv/install.sh | sh) and confirm `uv --version` works in the same shell/toolchain used to run the build","Verify the working directory for the build exists (the package dir with pyproject.toml) and contains a valid [build-system] section","Check that the uv binary is executable and on PATH for the process running the deploy/CI step","Read the wrapped error and slog output — it logs the exact `uv ...` command that failed","Build the package manually with `uv build` in the package directory to reproduce the underlying failure"],"exampleFix":"// before (CI)\n# uv not installed in image\n=> uv build failed: exec: \"uv\": executable file not found in $PATH\n// after (Dockerfile)\nRUN curl -LsSf https://astral.sh/uv/install.sh | sh\nENV PATH=\"/root/.local/bin:${PATH}\"","handlingStrategy":"validation","validationCode":"# before building with SST, verify uv is available\nif ! command -v uv >/dev/null 2>&1; then\n  echo \"uv is required but not installed\"; exit 1\nfi\nuv --version","typeGuard":null,"tryCatchPattern":"if err := buildPackage(ctx, cmd); err != nil {\n    if strings.Contains(err.Error(), `executable file not found in $PATH`) {\n        // uv missing: surface install instructions to the user\n    }\n    return err\n}","preventionTips":["Install uv (curl -LsSf https://astral.sh/uv/install.sh | sh) in every environment that runs sst deploy/dev","Pin uv in CI images and Dockerfiles; export its install dir in PATH","Smoke-test the toolchain with `uv --version` at pipeline start","Keep package build dirs with valid pyproject.toml present in the repo"],"tags":["go","uv","python","toolchain","build"],"backgroundTag":"command-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}