Reading Red Builds
By Syncfusion®, Inc. · Last updated
Read a failed run in five steps and fix the failures you meet at work: wrong tool version, a missing setting, a missing install, a time limit and a lint rule. Tell flaky tests from broken ones.
What you will learn
- Read a failed log in five steps
- Tell code problems from pipeline problems
- Fix version, setting, install and time limit failures
- Tell flaky tests from broken tests
Reading Red Builds
A red build is not a disaster. It is a message.
In this lesson you learn to read that message fast:
- find the first real error.
- tell code problems from pipeline problems.
- fix five failures you will meet at work.
- tell a flaky test from a broken one.
Simple lesson: most red builds can be fixed in minutes, once you know where to look.
A Real-World Example
Think about a doctor with a patient who has a fever.
- The fever is the sign. It is not the cause.
- The doctor asks questions and checks one thing at a time.
- The doctor treats the cause, not just the fever.
Now map it:
- Fever = the red ✗ and "exit code 1".
- Questions and checks = reading the log from the top.
- The cause = the first real error line.
Simple lesson: "exit code 1" is the fever. Look for the cause above it.
How to Read a Log
Follow these five steps every time:
- Open the red step. Ignore the green ones.
- Find the
$line. That is the command that ran. - Read down from there to the first line that says error, fail, not found or not set.
- Ask: does it name a file and line? A setting? A tool?
- Decide: is this a code problem or a pipeline problem?
| The error names… | It is usually… | Fix it in… |
|---|---|---|
| A file and line in your code | A code problem | Your code |
| A test that expected X but got Y | A code problem | Your code or the test |
| A tool "not found" | A pipeline problem | The pipeline file |
| A setting "not set" | A pipeline problem | The pipeline file |
| "canceled" or "exceeded time" | A time limit | The pipeline file |
On GitHub and Azure, use the search box inside the log. Search for "error" or "fail". It jumps straight to the right lines.
Simple lesson: red step, then $ line, then first error. Every time.
Five Failures You Will Meet
Each lab below starts red. Read the log first. Then fix the file.
1. Wrong Tool Version
- Your code uses something new.
- The runner set up an older Node or .NET.
- The log says a function "is not a function", or the SDK "does not support" your target.
2. A Missing Setting
- Some code reads a setting, like the address of an API.
- On your laptop it is in a local file.
- That file is not in Git, so the runner does not have it.
| Platform | Give one job a setting |
|---|---|
| GitHub Actions | env: under the job |
| Azure Pipelines | variables: under the job |
3. Tool Not Found
- The command needs packages, like vitest or the restored .NET project.
- The install step is missing, so they are not there.
4. Cancelled for Time
- Jobs have a time limit. GitHub's default is 360 minutes.
- Teams often set a small limit, so a stuck job does not waste money.
- If the limit is too small, a healthy job is stopped.
5. A Style Rule Broke
- A lint tool checks style rules.
- Its error names the file, the line and the rule.
Real tools vs this lab: real logs are longer and have timestamps on every line. The order is the same: the command, its output, then the error line. In this lab, the logs are shorter so you can practise the reading.
Simple lesson: versions, settings, installs, time limits and style rules cause most red builds you will see.
Flaky or Broken?
Broken test = fails every time, for the same reason.
Flaky test = sometimes passes, sometimes fails, with the same code.
Signs of a flaky test:
- It fails 1 run in 10.
- The error changes each time, often about time or order.
- It passes alone, but fails with other tests.
What to do:
- Broken: fix the code or the test. Do not re-run.
- Flaky: re-run once to unblock, then fix the test soon.
- Never hide a flaky test by switching off failures.
Pressing "Re-run" on a real failure is how real bugs get merged. Read the log before you re-run. If it fails the same way twice, it is not flaky.
The Flaky Tests lesson in the Testing & Verification course shows how to make them reliable.
Simple lesson: same error every time = broken. Different result each time = flaky.
- Make a new branch in your starter repo.
- Break the build: add
const x: number = "five";to a source file (React), orint x = "five";(.NET). - Push and open the failed run.
What you should see: a red typecheck or build step. Find the cause line, not the last line. Then undo the change.
Quick Check
Cheat Sheet
| Error text | Cause | Fix |
|---|---|---|
is not a function, NETSDK1045 | Tool version too old | Set node-version 22 or dotnet-version 10.0.x |
API_URL is not set | Missing setting | env: (GitHub) or variables: (Azure) |
vitest: not found, NETSDK1004 | No install step | Add npm ci or dotnet restore |
exceeded the maximum execution time | Time limit too small | Raise timeout-minutes or timeoutInMinutes |
no-unused-vars, WHITESPACE | Style rule | Fix the named line, or run the formatter |
GitHub Actions:
jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
API_URL: https://shop-web-staging.azurewebsites.net/api
Azure Pipelines:
jobs:
- job: build_and_test
timeoutInMinutes: 15
variables:
API_URL: https://shop-web-staging.azurewebsites.net/api
Common mistakes
| Mistake | Wrong idea | Correct idea | What goes wrong |
|---|---|---|---|
| Reading only the last line | "exit code 1" is the cause | The first error is the cause | You fix the wrong thing |
| Re-running every red build | It will pass next time | Read first, re-run only flaky ones | Real bugs get merged |
| Fixing code for a setup error | All errors are code errors | Tool, setting and time errors live in the file | Hours lost in the wrong place |
| Hiding a flaky test | Off is better than red | Fix or mark it, with a ticket | Real failures hide behind it |
| Tiny time limits | Smaller is safer | Set it above your normal run time | Healthy jobs get cancelled |
What to Remember
- Red step,
$line, first error. - Names a file and line? Code. Names a tool, setting or time? Pipeline.
- Most red builds: version, setting, install, time limit, style.
- Same failure twice = broken. Read before you re-run.
Exercises
Next: Quality Gates on Pull Requests