badges/shields · error · NotFound

no jobs found

Error message

no jobs found

What it means

The AppVeyor job build service's transform() destructures data.build.jobs and throws NotFound with prettyMessage 'no jobs found' when jobs is missing or falsy. It guards against AppVeyor responses whose build object contains no jobs array, so the badge can render a clear 'not found' style message instead of crashing.

Source

Thrown at services/appveyor/appveyor-job-build.service.js:45

          { name: 'repo', example: 'voicetranscoder' },
          { name: 'job', example: 'Windows' },
          { name: 'branch', example: 'master' },
        ),
      },
    },
  }

  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)

Solutions

  1. Confirm the build ID/build version exists on the AppVeyor project page and has completed jobs.
  2. Wait until the build has at least one job before requesting the badge.
  3. Verify the account/project/branch in the badge URL.
  4. Check the raw AppVeyor API response (curl) to confirm build.jobs presence.

Example fix

// before
{ build: {} } -> NotFound: no jobs found
// after (correct buildVersion with jobs)
{ build: { jobs: [{ name: "Build", status: "success" }] } } -> badge renders
Defensive patterns

Strategy: type-guard

Validate before calling

const hasJobs = data => Array.isArray(data?.build?.jobs) && data.build.jobs.length > 0
if (!hasJobs(apiResponse)) throw new Error('build has no jobs yet')

Type guard

function buildHasJobs(data) { return !!data && typeof data === 'object' && Array.isArray(data.build?.jobs) && data.build.jobs.length > 0 }

Try / catch

try {
  const { status } = await transform(jobName, data)
} catch (err) {
  if (err.name === 'NotFound') return renderNotFoundBadge()
  throw err
}

Prevention

When it happens

Trigger: AppVeyor API returns 200 with a build payload lacking a jobs array — e.g. build still queued/starting, buildId exists but has no recorded jobs, or an unexpected payload shape for the branch/account.

Common situations: Querying a build ID that was just created and has no jobs yet, AppVeyor API returning a minimal error-shaped payload with 200, self-hosted AppVeyor with different response shape, deleted builds.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/1c22bb160bf328c0. Report an issue: GitHub.