Common CI failure patterns and how to diagnose them from the logs.
# With gh gh run view <RUN_ID> --log-failed # With curl — download and extract curl -sL -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/$GH_OWNER/$GH_REPO/actions/runs/<RUN_ID>/logs \ -o ~/.hermes/cache/scratch/ci-logs.zip && unzip -o ~/.hermes/cache/scratch/ci-logs.zip -d ~/.hermes/cache/scratch/ci-logs
Signatures in logs:
FAILED tests/test_foo.py::test_bar - AssertionError E assert 42 == 43 ERROR tests/test_foo.py - ModuleNotFoundError
Diagnosis:
read_file to read the failing testModuleNotFoundError — usually a missing dependency in CICommon fixes:
Signatures in logs:
src/auth.py:45:1: E302 expected 2 blank lines, got 1 src/models.py:12:80: E501 line too long (95 > 88 characters) error: would reformat src/utils.py
Diagnosis:
Common fixes:
black ., isort ., ruff check --fix .patch, make sure to match existing indentation styleSignatures in logs:
src/api.py:23: error: Argument 1 to "process" has incompatible type "str"; expected "int" src/models.py:45: error: Missing return statement
Diagnosis:
Common fixes:
# type: ignore comment as last resort (with explanation)Signatures in logs:
ModuleNotFoundError: No module named 'some_package' ERROR: Could not find a version that satisfies the requirement foo==1.2.3 npm ERR! Could not resolve dependency
Diagnosis:
Common fixes:
pip freeze, npm install)Signatures in logs:
fatal: could not read Username for 'https://github.com': No such device or address Error: Resource not accessible by integration 403 Forbidden
Diagnosis:
GITHUB_TOKEN or custom secrets)Common fixes:
permissions: block to workflow YAMLgh secret list or check repo settingsSignatures in logs:
Error: The operation was canceled. The job running on runner ... has exceeded the maximum execution time
Diagnosis:
Common fixes:
timeout-minutes: 10Signatures in logs:
docker: Error response from daemon failed to solve: ... not found COPY failed: file not found in build context
Diagnosis:
Common fixes:
.dockerignore exclusion or remove from itCI Failed ├── Test failure │ ├── Assertion mismatch → update test or fix logic │ └── Import/module error → add dependency ├── Lint failure → run formatter, fix style ├── Type error → fix types ├── Build failure │ ├── Missing dep → add to requirements │ └── Version conflict → update pins ├── Permission error → update workflow permissions (needs user) └── Timeout → investigate perf (may need user input)
git add <fixed_files> && git commit -m "fix: resolve CI failure" && git push # Then monitor gh pr checks --watch 2>/dev/null || \ echo "Poll with: curl -s -H 'Authorization: token ...' https://api.github.com/repos/.../commits/$(git rev-parse HEAD)/status"