{"record":{"id":"dc58988739ed1eb3","repo":"anomalyco/sst","slug":"failed-to-start-worker-process-v","errorCode":null,"errorMessage":"failed to start worker process: %v","messagePattern":"failed to start worker process: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/python.go","lineNumber":210,"sourceCode":"\t\tenv = append(env, \"PYTHONPATH=\"+pythonPath)\n\n\t\tresourceEncPath := filepath.Join(input.Build.Out, \"resource.enc\")\n\t\tenv = append(env, \"SST_KEY_FILE=\"+resourceEncPath)\n\t}\n\n\tcmd.Env = env\n\tcmd.Dir = workingDir\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stdout pipe: %v\", err)\n\t}\n\tstderr, err := cmd.StderrPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stderr pipe: %v\", err)\n\t}\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start worker process: %v\", err)\n\t}\n\n\treturn &worker{\n\t\tstdout,\n\t\tstderr,\n\t\tcmd,\n\t}, nil\n\n}\n\nfunc (r *PythonRuntime) ShouldRebuild(functionID string, file string) bool {\n\t// Skip paths inside build artifacts, caches, or virtual envs to avoid feedback loops\n\tnormalized := filepath.ToSlash(file)\n\tfor _, dir := range []string{\".sst\", \".venv\", \"venv\", \"__pycache__\", \".git\", \"node_modules\", \".pytest_cache\", \".mypy_cache\", \".tox\"} {\n\t\tif strings.Contains(normalized, dir+\"/\") {\n\t\t\treturn false\n\t\t}\n\t}","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/python.go#L192-L228","documentation":"Raised in PythonRuntime.Run (pkg/runtime/python/python.go:210) when cmd.Start() fails to launch `uv run lambdaric_python_bridge.py <handler>`. This is the most common of the three worker-spawn errors: the `uv` binary is missing, the bridge script does not exist, the working directory is invalid, or the executable is not found. The dev server cannot start the Python Lambda worker at all.","triggerScenarios":"`uv` not installed or not on PATH; lambdaBridgePath missing (platform dist/python-runtime/index.py absent or copy failed silently); workingDir (artifact dir or project root) deleted; env malformed; handler file path invalid causing uv to exit immediately (uv run errors surface here as start failures only if exec itself fails — usually missing binary).","commonSituations":"Fresh machine without uv (macOS/Linux: `curl -LsSf https://astral.sh/uv/install.sh | sh` not run); PATH differing inside the sst dev process vs shell; project root renamed while dev session running; Windows without WSL where uv resolution differs.","solutions":["Install uv and verify it is resolvable: `which uv` from the same shell/user that runs sst dev; if missing run `curl -LsSf https://astral.sh/uv/install.sh | sh`","Confirm the platform bridge exists: check .sst/platform/dist/python-runtime/index.py; re-run `bun run build:platform` or reinstall the platform files if absent","Verify the artifact/working directory exists and the handler resolves; redeploy or restart `sst dev` to resync artifacts","Check the wrapped error text: 'executable file not found in $PATH' means fix PATH; 'no such file or directory' naming the bridge means fix bridge copy"],"exampleFix":"// before (shell where sst runs lacks uv)\n$ sst dev  -> failed to start worker process: exec: \"uv\": executable file not found in $PATH\n// after\n$ curl -LsSf https://astral.sh/uv/install.sh | sh\n$ which uv && sst dev","handlingStrategy":"try-catch","validationCode":"// preflight before sst dev\nif _, err := exec.LookPath(\"uv\"); err != nil {\n    panic(\"uv not installed: curl -LsSf https://astral.sh/uv/install.sh | sh\")\n}\nif _, err := os.Stat(filepath.Join(platformDir, \"dist/python-runtime/index.py\")); err != nil {\n    panic(\"platform python bridge missing: rebuild platform\")\n}","typeGuard":null,"tryCatchPattern":"w, err := rt.Run(ctx, input)\nif err != nil {\n    var ee *exec.Error\n    if errors.As(err, &ee) || strings.Contains(err.Error(), \"executable file not found\") {\n        // install/repair uv and retry once\n        installUv(); return rt.Run(ctx, input)\n    }\n    return err\n}","preventionTips":["Install uv as a project bootstrap step (postinstall/bootstrap script) and verify `which uv`","Keep PATH identical for the process launching sst dev (CI env, IDE terminals)","Rebuild/sync the platform dir after upgrading SST so dist/python-runtime/index.py exists","Avoid renaming/deleting the project root or artifact dirs while a dev session is live"],"tags":["process","spawn","uv","python","dev-server"],"backgroundTag":"executable-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}