{"record":{"id":"35142f729aa16a31","repo":"anomalyco/sst","slug":"failed-to-process-archive-s-w","errorCode":null,"errorMessage":"failed to process archive %s: %w","messagePattern":"failed to process archive (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":302,"sourceCode":"\tfor _, pattern := range patterns {\n\t\tfiles, err = filepath.Glob(pattern)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to find package archive: %w\", err)\n\t\t}\n\t\tif len(files) > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif len(files) == 0 {\n\t\treturn fmt.Errorf(\"no package archive found for %s (tried patterns: %s-*.whl, %s-*.tar.gz, %s-*.whl, %s-*.tar.gz)\",\n\t\t\tpkg.Name, normalizedName, normalizedName, pkg.Name, pkg.Name)\n\t}\n\n\t// Process each archive file\n\tfor _, archiveFile := range files {\n\t\tif err := processPackageArchive(archiveFile, outputDir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to process archive %s: %w\", archiveFile, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// processPackageArchive extracts and cleans up a single package archive\nfunc processPackageArchive(archiveFile, outputDir string) error {\n\tif strings.HasSuffix(archiveFile, \".whl\") {\n\t\tif err := extractZip(archiveFile, outputDir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to extract wheel: %w\", err)\n\t\t}\n\n\t\tos.Remove(archiveFile)\n\n\t\treturn nil\n\t}\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L284-L320","documentation":"One matched archive file could not be extracted/cleaned by `processPackageArchive`. The original error from the zip/tar extraction, renaming, or move step is wrapped here along with the archive path.","triggerScenarios":"`extractAndProcessPackageArchive` iterates over files found by glob and calls `processPackageArchive`; extraction fails due to a corrupt/partial download, a truncated wheel, or a filesystem permission problem in outputDir.","commonSituations":"Interrupted pip download leaving a partial .whl; disk full during extraction; outputDir under a path with restrictive permissions or read-only mount; malicious/corrupted wheel file rejected by the zip reader.","solutions":["Delete the build output directory and rebuild so pip re-downloads a fresh archive","Check available disk space and that outputDir is writable","Inspect the specific archive path in the error message — try `unzip -t` or `tar -tzf` on it to confirm corruption","Re-run `sst deploy`; transient network issues during pip download are a common cause"],"exampleFix":"// before: stale partial build artifacts\nsst deploy\n// after: clean rebuild\nrm -rf .sst/build && sst deploy","handlingStrategy":"try-catch","validationCode":"import { statSync } from \"fs\";\nfor (const f of archives) {\n  const s = statSync(f);\n  if (s.size === 0) throw new Error(`Archive ${f} is empty — rebuild`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await buildPackage(...);\n} catch (e) {\n  if (String(e).includes(\"failed to process archive\")) {\n    console.error(\"Corrupt or unreadable archive — clean .sst/build and redeploy:\", e);\n  }\n  throw e;\n}","preventionTips":["Clean the build output directory on interrupted builds","Monitor free disk space in CI runners","Use a reliable network/proxy configuration for pip","Treat repeated extraction failures as corrupted downloads and force re-download"],"tags":["python","archive","extraction","corrupt-file"],"backgroundTag":"archive-extraction-failed","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}