{"record":{"id":"b92fb8b13e1d932c","repo":"anomalyco/sst","slug":"failed-to-make-binary-executable-w","errorCode":null,"errorMessage":"failed to make binary executable: %w","messagePattern":"failed to make binary executable: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/rust/rust.go","lineNumber":167,"sourceCode":"\n\tsource, err := os.Open(binary)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open source binary: %w\", err)\n\t}\n\tdefer source.Close()\n\n\tdestination, err := os.Create(out)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create destination file: %w\", err)\n\t}\n\tdefer destination.Close()\n\n\tif _, err := io.Copy(destination, source); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to copy binary: %w\", err)\n\t}\n\n\tif err := os.Chmod(out, 0755); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to make binary executable: %w\", err)\n\t}\n\n\treturn &runtime.BuildOutput{\n\t\tHandler:    \"bootstrap\",\n\t\tSourcemaps: []string{},\n\t\tErrors:     []string{},\n\t\tOut:        root,\n\t}, nil\n}\n\nfunc (r *Runtime) Run(ctx context.Context, input *runtime.RunInput) (runtime.Worker, error) {\n\tcmd := process.Command(\n\t\tfilepath.Join(input.Build.Out, input.Build.Handler),\n\t)\n\tslog.Info(\"running server binary\", \"server\", input.Server)\n\tcmd.Env = input.Env\n\tcmd.Env = append(cmd.Env, \"AWS_LAMBDA_RUNTIME_API=http://\"+input.Server)\n\tcmd.Env = append(cmd.Env, \"AWS_LAMBDA_FUNCTION_MEMORY_SIZE=1024\")","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/rust/rust.go#L149-L185","documentation":"Right after copying the Rust binary, SST runs `os.Chmod(out, 0755)` so the `bootstrap` file is executable as a Lambda handler. This error wraps the chmod failure. Without +x the deployed Lambda cannot start, so SST fails the build early.","triggerScenarios":"`os.Chmod(out, 0755)` returns an error on the copied `bootstrap` file — typically the destination filesystem does not support permission bits (FAT32/exFAT mounts, some network shares, Windows ACL translation) or the file was deleted between copy and chmod.","commonSituations":"Building in a Docker bind mount on Windows or with an exFAT volume; running SST as a non-root user in a directory owned by root; tmpfs with noexec weirdness; NFS exports with `all_squash`.","solutions":["Build inside a filesystem that supports Unix permissions (ext4/WSL2 ext4 instead of a Windows bind mount)","Run the build as the directory owner or with sufficient privileges","Verify the output path exists and is on a writable, POSIX-capable filesystem","Re-run the build after fixing permissions: `chmod -R u+rwX .sst`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const out = path.join(functionOut, \"bootstrap\");\nif (process.platform === \"win32\" && isExFATorBindMount(out)) {\n  console.warn(\"destination FS may not support chmod 0755\");\n}\n// after build, verify:\nconst mode = fs.statSync(out).mode & 0o777;\nif ((mode & 0o111) === 0) throw new Error(\"bootstrap is not executable\");","typeGuard":null,"tryCatchPattern":"try {\n  await run(\"sst\", [\"build\"]);\n} catch (e) {\n  if (/failed to make binary executable/.test(String(e))) {\n    throw new Error(\"Build FS does not support Unix permissions; build inside WSL2/ext4 or a Linux container\", { cause: e });\n  }\n  throw e;\n}","preventionTips":["Build on filesystems that support Unix permission bits (ext4, tmpfs), not FAT32/exFAT","In Docker, avoid Windows bind mounts for build outputs; use named volumes","Run builds as the directory owner rather than root"],"tags":["rust","build","permissions","filesystem"],"backgroundTag":"permission-denied","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}