Script Failure
Cheat sheet · https://pcornel.dk/topic.php?topic=6046
Answer
Script Failure isolates interpreter, parsing, control-flow, dependency, command-execution and exit-status failures in a specific script invocation without assuming the last printed error is the root cause.
Remember
- Non-zero exit ≠ no target-side changes occurred.
- Last stack-frame message ≠ earliest causal failure.
- Script runs interactively ≠ automation invocation has identical environment.
- Exit code 0 ≠ desired state verified.
First checks
bash -x script.sh / Set-PSDebug -Trace 1 / python3 -m pdb— trace- Exit code and stderr — error
- Environment differences (PATH, user, cwd) — context
Commands
python -c "import ast,pathlib; ast.parse(pathlib.Path('<script.py>').read_text())"- Read-only/validation observation for Python parser result for the selected source file without executing application lo…
Verify in this order
script → error → trace → fix
Where it usually breaks
A script error proves only the observed invocation failed at or after a recorded boundary; it does not prove earlier operations were rolled back or that later targets were untouched.
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
Script Failure troubleshooting proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Symptom / scope | Time window, immutable source/run identity, effective inputs and exact targets are explicit | Floating source, changed inputs or ambiguous targets destroy reproducibility |
| First failed boundary | Transport/auth/dependency/render/operation evidence identifies the earliest divergence | Investigation starts at the final error and skips earlier unproven boundaries |
| Effective outcome | Controller result is paired with target read-back and workload/service acceptance | Green execution state or changed symptom substitutes for effective-state verification |
| Recovery / closure | Minimal change restores the original test and regression/partial-state checks are clean | Broad retry or unrelated edits make the incident non-reproducible and hide residual state |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6046