badges/shields · warning · NotFound
unknown build state
Error message
unknown build state
What it means
The Copr service maps the latest build's `state` through stateStatusMap; if the state string is not in the map, NotFound with 'unknown build state' is thrown. This guards against Copr introducing new or unexpected build states the badge does not recognize.
Source
Thrown at services/copr/copr.service.js:104
options: {
searchParams: {
ownername: owner,
projectname: project,
packagename: packageName,
with_latest_build: 'True',
},
},
httpErrors: {
404: 'project or package not found',
},
})
}
transform({ builds }) {
const { state } = builds.latest
const status = stateStatusMap[state]
if (!status) {
throw new NotFound({ prettyMessage: 'unknown build state' })
}
return { status }
}
async handle(
{ owner, project, package: packageName },
{ baseUrl = 'https://copr.fedorainfracloud.org' },
) {
const json = await this.fetch({
baseUrl,
owner,
project,
package: packageName,
})
const { status } = this.transform(json)
return this.constructor.render({ status })
}
}View on GitHub (pinned to 766fd8bc89)
Solutions
- Check the latest build's state for this project in the Copr web UI and see which value it reports
- Retry later — the build may transition to a standard state (succeeded/failed/canceled)
- Update the service's stateStatusMap to include the new Copr state if you run a fork
- Open an issue with the badge service so the new state value can be mapped
Defensive patterns
Strategy: fallback
Validate before calling
const KNOWN_STATES = ['succeeded','failed','canceled','starting','importing','running','waiting'];
if (latestBuild && !KNOWN_STATES.includes(latestBuild.state)) console.warn(`unrecognized Copr state: ${latestBuild.state}`); Type guard
function hasKnownState(build, map) { return build?.state != null && map[build.state] != null; } Try / catch
try {
const badge = await fetchBadge(`/copr/build/${owner}/${project}/${pkg}`);
} catch (e) {
if (e.status === 404 && e.message.includes('unknown build state')) console.warn('Copr reports a state the badge does not map — check upstream');
else throw e;
} Prevention
- Check the build state in the Copr web UI when the badge errors
- Retry while a build is in a transient state
- Track Copr releases for new state values
- Report unmapped states to the badge service maintainers
When it happens
Trigger: transform({ builds }) reads builds.latest.state and the value is absent from stateStatusMap — e.g. a newly added Copr build state, a null/undefined state, or an unexpected API payload.
Common situations: Copr API adding a new state value after a platform update, projects whose latest build is in a transient/unusual state, or malformed API responses where builds.latest is null.
Related errors
- unparseable json response
- unparseable jsonl response
- unparseable intermediate json response
- ${prettyErrorMessage}
- not found
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/c13d190560f5ec86.
Report an issue: GitHub.