{"record":{"id":"122e1282e4938829","repo":"anomalyco/sst","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":1550,"sourceCode":"\tif cmd.PackageName != \"\" {\n\t\terrorMsg += fmt.Sprintf(\" (exporting package: %s)\", cmd.PackageName)\n\t}\n\tif cmd.OutputFile != \"\" {\n\t\terrorMsg += fmt.Sprintf(\" to file: %s\", cmd.OutputFile)\n\t}\n\terrorMsg += fmt.Sprintf(\" in workspace: %s\", cmd.WorkspaceDir)\n\n\tif result.Stderr != \"\" {\n\t\terrorMsg += fmt.Sprintf(\"\\nError output: %s\", result.Stderr)\n\t}\n\n\tif strings.Contains(result.Stderr, \"package\") && strings.Contains(result.Stderr, \"not found\") {\n\t\terrorMsg += \"\\nSuggestion: Check if the package name is correct and exists in the workspace\"\n\t} else if strings.Contains(result.Stderr, \"lock\") {\n\t\terrorMsg += \"\\nSuggestion: Run 'uv sync' first to ensure dependencies are resolved\"\n\t}\n\n\treturn fmt.Errorf(\"%s\", errorMsg)\n}\n\n// runUvCommand executes a command with timeout and progress logging\nfunc runUvCommand(ctx context.Context, command string, args []string, workingDir string) (*commandResult, error) {\n\tstartTime := time.Now()\n\n\tcmdCtx, cancel := context.WithTimeout(ctx, uvCommandTimeout)\n\tdefer cancel()\n\n\tcmd := process.CommandContext(cmdCtx, command, args...)\n\tif workingDir != \"\" {\n\t\tcmd.Dir = workingDir\n\t}\n\tcmd.Env = os.Environ()\n\n\tdone := make(chan bool)\n\tgo func() {\n\t\tticker := time.NewTicker(30 * time.Second)","sourceCodeStart":1532,"sourceCodeEnd":1568,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L1532-L1568","documentation":"detailedExportError wraps a failed `uv export`/`uv lock` invocation run during the Python build (via runUvExport) with the raw stderr plus, when the stderr matches known patterns, a heuristic suggestion. The `%s` formatting simply re-wraps the accumulated message as a single error. It exists because uv failures during dependency export are the most common cause of Python build breakage and the raw uv output alone is often cryptic.","triggerScenarios":"A `uv export` (or related uv command) exits non-zero: the package referenced in pyproject.toml/requirements is misspelled or absent from the workspace/index, or the uv.lock file is missing/stale so the export cannot resolve locked dependencies.","commonSituations":"Adding a new internal workspace member without running `uv sync` to regenerate uv.lock; typos in a package name; a workspace source path pointing to a package that no longer exists; running builds in CI on a fresh checkout where uv.lock was never committed.","solutions":["Run `uv sync` (or `uv lock`) in the project root to regenerate/refresh uv.lock, then redeploy.","Check stderr in the wrapped message: if it mentions 'package ... not found', verify the package name in pyproject.toml [tool.uv.sources] / dependencies and confirm the workspace member path exists.","Commit uv.lock to version control so CI builds see resolved dependencies.","Run the same uv command manually in the project directory to see the full error output."],"exampleFix":"// before (missing lock file)\n// sst deploy -> failed: uv export: lock file not found\n\n// after (shell, in the function's project dir)\n// uv sync && sst deploy","handlingStrategy":"try-catch","validationCode":"// shell, before deploy\ncd <project-root> && test -f uv.lock || (echo 'uv.lock missing; run uv sync' && uv sync)","typeGuard":null,"tryCatchPattern":"// wrap deploy and inspect suggestion\ncatch (e) {\n  if (String(e).includes(\"Suggestion: Run 'uv sync'\")) await $`uv sync`;\n  else if (String(e).includes(\"package\") && String(e).includes(\"not found\")) fixPackageNameInPyproject();\n  throw e;\n}","preventionTips":["Always run `uv sync` after editing pyproject.toml dependencies.","Commit uv.lock so CI never exports from an unresolved state.","Keep [tool.uv.sources] paths pointing at existing workspace member directories."],"tags":["python","uv","dependency-resolution","build"],"backgroundTag":"uv-dependency-export-failed","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}