FailTrace – Reproduce a failed GitHub Actions run locally from its URL
github.comHow is this different from githubs own "EXPLAIN" button ?
We had act for this for years already
Reproducing that runner's environment locally sounds like a huge pain. Do you spin docker container to do that? Does it repeat apt-get steps on a CI action? How do you do that if you want it to have some confidence of it working?
Yes, it's Docker, and I don't try to rebuild GitHub's full runner image, that's tens of GB of preinstalled tools. It builds a much smaller environment from what the job needed:
Base image: the Ubuntu version the runner used (from the log), plus the common packages scripts expect (git, curl, make, jq, python3, sudo...). If the job declares a container, it uses that image exactly. This image is built once and cached by a hash of its contents.
Toolchains: setup-go/node/python aren't run. The log shows the exact version the runner used (e.g. /opt/hostedtoolcache/go/1.22.7/x64), and FailTrace installs that build from the same manifests those actions download from, at the same path.
Your apt-get steps: yes, those are ordinary run, steps, so they replay in order like everything else, with the same shell, env and working directory. Steps run as root and sudo is installed, so "sudo apt-get install ..." works.
On confidence scale rather than assume the environment is right, it checks the result. After the failing step runs, it compares it with CI's: the same failing tests, the same error message, or just the same exit code. That gives "reproduced", "different failure", or "diverged" when an earlier step broke locally, which usually means an environment gap. Every result also lists the known differences(root vs the runner user, a plain Ubuntu image, missing secrets, emulated amd64), so you can judge how much to trust it.
You can also run "failtrace plan <url>" first to see exactly what it would build and run without running anything.
Why are nearly all of OPs comments marked flagged/dead?
If it reliably parses the logs it would be worthwhile to save tokens.
I can see this being very useful when plugged into the AI development loop
Awesome; now doing the same, but for GitLab.