{"record":{"id":"d546c66d75d657ba","repo":"anomalyco/sst","slug":"failed-to-write-filtered-requirements-file-w","errorCode":null,"errorMessage":"failed to write filtered requirements file: %w","messagePattern":"failed to write filtered requirements file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":1045,"sourceCode":"\t\t}\n\n\t\tif strings.HasPrefix(line, \"-e \") {\n\t\t\teditablePath := strings.TrimSpace(strings.TrimPrefix(line, \"-e \"))\n\n\t\t\tif strings.HasPrefix(editablePath, \"./\") || strings.HasPrefix(editablePath, \"../\") ||\n\t\t\t\tstrings.HasPrefix(editablePath, \"/\") && !strings.Contains(editablePath, \"://\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// NON-editable local paths and boto3/botocore are handled downstream\n\t\tfilteredLines = append(filteredLines, originalLine)\n\t}\n\n\t// Write filtered requirements\n\tfilteredContent := strings.Join(filteredLines, \"\\n\")\n\tif err := os.WriteFile(outputPath, []byte(filteredContent), 0644); err != nil {\n\t\treturn fmt.Errorf(\"failed to write filtered requirements file: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// cleanupInstalledDependencies removes __pycache__, .pyc files, .dist-info, test dirs,\n// and boto3/botocore (Lambda provides them, saves ~22MB) unless user opts in.\nfunc cleanupInstalledDependencies(targetDir string) error {\n\terr := filepath.Walk(targetDir, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn nil // Continue walking despite errors\n\t\t}\n\n\t\tif path == targetDir {\n\t\t\treturn nil\n\t\t}\n\n\t\tif !info.IsDir() {","sourceCodeStart":1027,"sourceCodeEnd":1063,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L1027-L1063","documentation":"After removing editable-install lines, filterEditableInstalls writes the filtered content with os.WriteFile(outputPath, ..., 0644) (build.go:1042). If the write fails — unwritable directory, full disk, path is a directory, or permission denied — this wrapped error is returned and dependency installation aborts before uv runs.","triggerScenarios":"Specifically: os.WriteFile(outputPath) fails while filterEditableInstalls runs from copySyncedDependencies or its anonymous caller — the outputPath directory doesn't exist, is read-only, or disk is exhausted.","commonSituations":"Read-only workspace mounts in CI containers; disk quota exceeded on build runners; outputPath pointing at a path occupied by a directory; SELinux/AppArmor denying writes to the build dir.","solutions":["Check the wrapped inner error for ENOSPC (disk full) / EACCES (permissions) and fix accordingly","Ensure the directory containing outputPath exists and is writable by the build user","Free disk space or raise runner disk quota, then re-run the deploy","Verify container/volume mounts are not read-only (rw flag) and no MAC policy blocks writes"],"exampleFix":"// before: read-only mount in CI\ndocker run -v $PWD:/app:ro sst deploy  # write fails\n\n// after\ndocker run -v $PWD:/app sst deploy","handlingStrategy":"validation","validationCode":"// preflight: writable build dir and adequate disk before deploy\n[ -w .sst ] || { echo \".sst not writable\"; exit 1; }\n[ \"$(df -k . | awk 'NR==2{print $4}')\" -gt 1048576 ] || echo \"<1GB free, may fail\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mount CI workspaces read-write (not :ro) and run the build as a user with write access","Monitor disk quotas on build runners","Ensure the target output directory is created before writes (fresh checkouts)","Verify no SELinux/AppArmor policy denies writes to the project directory"],"tags":["python","requirements","file-write","permissions","build"],"backgroundTag":"file-write-failed","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}