badges/shields · error · NotFound
job not found
Error message
job not found
What it means
After extracting jobs, transform() looks up the requested job with jobs.find(j => j.name === jobName); if no job matches it throws NotFound with prettyMessage 'job not found'. The build exists and has jobs, but none carries the exact name given in the badge URL.
Solutions
- Copy the job name exactly as shown on the AppVeyor build page, preserving case and spaces.
- URL-encode spaces and special characters in the job parameter of the badge URL.
- Update the badge if the job was renamed in appveyor.yml.
- Confirm the job exists for the requested branch/configuration.
Example fix
// before /badge/appveyor/build/owner/repo/Build%20Job?branch=master // job named 'build job' -> job not found // after (exact case-sensitive name, encoded) /badge/appveyor/build/owner/repo/build%20job?branch=master
Defensive patterns
Strategy: validation
Validate before calling
const jobs = data?.build?.jobs || []
if (!jobs.some(j => j.name === jobName)) throw new Error(`job "${jobName}" not in [${jobs.map(j => j.name)}]`) Type guard
function jobExists(jobs, jobName) { return Array.isArray(jobs) && jobs.some(j => j.name === jobName) } Try / catch
try {
const { status } = await transform(jobName, data)
} catch (err) {
if (err.name === 'NotFound') return renderNotFoundBadge()
throw err
} Prevention
- Copy the job name exactly (match is case-sensitive).
- URL-encode spaces and special characters in job names.
- Update badge URLs when jobs are renamed in appveyor.yml.
- Confirm the job exists for the requested branch/configuration.
When it happens
Trigger: jobs.find(j => j.name === jobName) returns undefined — the job parameter in the badge URL does not case-sensitively match any job name in the AppVeyor build configuration.
Common situations: Job renamed in appveyor.yml after the badge URL was created, case mismatch (match is case-sensitive), URL-encoding/space issues in the job name (e.g. 'Test%20x86'), targeting a job that only exists on other branches/configurations.
Related errors
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/53be010442af6412.
Report an issue: GitHub.
Appendix: source
Thrown at services/appveyor/appveyor-job-build.service.js:51
}
transform({ data, jobName }) {
if (!('build' in data)) {
// this project exists but no builds have been run on it yet
return { status: 'no builds found' }
}
const {
build: { jobs },
} = data
if (!jobs) {
throw new NotFound({ prettyMessage: 'no jobs found' })
}
const job = jobs.find(j => j.name === jobName)
if (!job) {
throw new NotFound({ prettyMessage: 'job not found' })
}
return { status: job.status }
}
async handle({ user, repo, job, branch }) {
const data = await this.fetch({ user, repo, branch })
const { status } = this.transform({ data, jobName: job })
return renderBuildStatusBadge({ status })
}
}
View on GitHub (pinned to 766fd8bc89)