badges/shields · error · NotFound
no builds found
Error message
no builds found
What it means
The Buildbot service inspects the builds array from the Buildbot API. If the array is empty, transform throws NotFound 'no builds found' because there is no build to derive status from. If a build exists but is not complete, it renders 'building' instead; the error is reserved for the zero-builds case.
Source
Thrown at services/buildbot/buildbot.service.js:96
return renderBuildStatusBadge({ status })
}
async fetch({ baseUrl, builder }) {
return this._requestJson({
schema,
url: `${baseUrl}/api/v2/builders/${encodeURIComponent(builder)}/builds`,
options: {
searchParams: { limit: '1', order: '-number' },
},
httpErrors: {
404: 'builder not found',
},
})
}
transform({ builds }) {
if (builds.length === 0) {
throw new NotFound({ prettyMessage: 'no builds found' })
}
const { complete, results } = builds[0]
if (!complete) {
return { status: 'building' }
}
return { status: resultMap[results] ?? 'unknown' }
}
async handle({ builder }, { baseUrl }) {
const json = await this.fetch({ baseUrl, builder })
const { status } = this.transform({ builds: json.builds })
return this.constructor.render({ status })
}
}
View on GitHub (pinned to 766fd8bc89)
Solutions
- Verify the builder name in the badge URL against the Buildbot waterfall view.
- Trigger at least one build on the builder/branch being queried.
- Remove or broaden query filters (branch, property) that exclude all builds.
- Update badges after Buildbot builder renames or instance migrations.
Example fix
// before /badge/buildbot/instance/old-builder // after /badge/buildbot/instance/renamed-builder
Defensive patterns
Strategy: validation
Validate before calling
const res = await fetch(`${buildbotUrl}/api/v2/builders/${builder}/builds`)
const data = await res.json()
if (!data.builds?.length) throw new Error(`No builds for builder '${builder}'`) Try / catch
try {
return await buildbotBadge(params)
} catch (e) {
if (e instanceof NotFound) return renderBadge('no builds')
throw e
} Prevention
- Verify builder names against the Buildbot waterfall before embedding them in badges
- Trigger at least one build on new builders before publishing their status badge
- Update badge URLs after builder renames or Buildbot migrations
When it happens
Trigger: Requesting a Buildbot badge where the builds API returns an empty builds array for the given builder — a nonexistent builder name, a builder that has never run, or filtered queries (e.g. by branch) matching nothing.
Common situations: Typo in the builder name in the badge URL; new builder created but never triggered; querying a branch with no builds; Buildbot instance migrated and builders renamed; private instances with restricted API access returning empty lists.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- no jobs found
- job not found
- build pipeline not found
- ${recordType.toLowerCase()} not found
- build pipeline not found
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/450ea7353996f366.
Report an issue: GitHub.