{"record":{"id":"53be010442af6412","repo":"badges/shields","slug":"job-not-found","errorCode":null,"errorMessage":"job not found","messagePattern":"job not found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/appveyor/appveyor-job-build.service.js","lineNumber":51,"sourceCode":"  }\n\n  transform({ data, jobName }) {\n    if (!('build' in data)) {\n      // this project exists but no builds have been run on it yet\n      return { status: 'no builds found' }\n    }\n\n    const {\n      build: { jobs },\n    } = data\n    if (!jobs) {\n      throw new NotFound({ prettyMessage: 'no jobs found' })\n    }\n\n    const job = jobs.find(j => j.name === jobName)\n\n    if (!job) {\n      throw new NotFound({ prettyMessage: 'job not found' })\n    }\n\n    return { status: job.status }\n  }\n\n  async handle({ user, repo, job, branch }) {\n    const data = await this.fetch({ user, repo, branch })\n    const { status } = this.transform({ data, jobName: job })\n    return renderBuildStatusBadge({ status })\n  }\n}\n","sourceCodeStart":33,"sourceCodeEnd":63,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/appveyor/appveyor-job-build.service.js#L33-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n/badge/appveyor/build/owner/repo/Build%20Job?branch=master  // job named 'build job' -> job not found\n// after (exact case-sensitive name, encoded)\n/badge/appveyor/build/owner/repo/build%20job?branch=master","handlingStrategy":"validation","validationCode":"const jobs = data?.build?.jobs || []\nif (!jobs.some(j => j.name === jobName)) throw new Error(`job \"${jobName}\" not in [${jobs.map(j => j.name)}]`)","typeGuard":"function jobExists(jobs, jobName) { return Array.isArray(jobs) && jobs.some(j => j.name === jobName) }","tryCatchPattern":"try {\n  const { status } = await transform(jobName, data)\n} catch (err) {\n  if (err.name === 'NotFound') return renderNotFoundBadge()\n  throw err\n}","preventionTips":["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."],"tags":["not-found","appveyor","ci","configuration"],"backgroundTag":"upstream-resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}