koala73/worldmonitor · error · Error

Sentry returned no resolved issues for ${org}/${project}. A

Error message

Sentry returned no resolved issues for ${org}/${project}. A project with history always has some, so this is a misread rather than a clean board: check SENTRY_ORG and SENTRY_PROJECT, and that the token can see this project. Reporting it clean would be the silent pass this audit exists to prevent.

What it means

assertLiveBoardIsNotEmpty guards against a false 'clean' audit result. A Sentry project with history always has at least some resolved issues, so an empty result means the query misread — wrong org/project env vars or a token that cannot see the project — not that nothing violates the pins. Reporting that as clean would be exactly the silent pass this audit exists to prevent, so it throws.

Solutions

  1. Verify SENTRY_ORG and SENTRY_PROJECT match the real Sentry slugs (check the project URL in the Sentry UI).
  2. Confirm the auth token has read access to the target project; generate a fresh token if scopes changed.
  3. Query the Sentry API manually (curl with the same token and slug) to check whether resolved issues actually exist.
  4. If the project is genuinely new with no resolved issues, audit a project with history rather than bypassing the assertion.

Example fix

// before
const issues = await fetchResolvedIssues(token, org, project);
// after
const issues = await fetchResolvedIssues(token, org, project);
assertLiveBoardIsNotEmpty(issues, org, project); // throws with remediation hints if empty
Defensive patterns

Strategy: validation

Validate before calling

if (!Array.isArray(issues) || issues.length === 0) {
  throw new Error(`No resolved issues for ${org}/${project}; verify SENTRY_ORG, SENTRY_PROJECT, and token scope.`);
}

Type guard

const hasResolvedIssues = (v) => Array.isArray(v) && v.length > 0;

Try / catch

try {
  assertLiveBoardIsNotEmpty(issues, org, project);
} catch (err) {
  console.error(err.message); // includes org/project and remediation hints
  process.exitCode = 1;
}

Prevention

When it happens

Trigger: Calling assertLiveBoardIsNotEmpty with an empty array (or a non-array such as null/undefined) of issues for a given org/project — i.e. the Sentry query succeeded but returned zero rows, or returned nothing at all.

Common situations: SENTRY_ORG or SENTRY_PROJECT is mistyped so the query matches an empty or different project; the auth token lacks scope for the intended project and the API returns an empty list instead of an error; env vars point at a different Sentry instance than intended.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of koala73/worldmonitor@7d06c8633d (2026-09-15). Data as JSON: /api/errors/b11eaf67d05d6f9e. Report an issue: GitHub.

Appendix: source

Thrown at scripts/audit-sentry-resolve-pins.mjs:182

  return lines.join('\n');
}

export function formatRepairRecipe() {
  return [
    'Only repair a confirmed incompatible pin; preserve valid automatic resolutions.',
    'Check deployed release identity and recurrence evidence before changing status.',
    '  1. PUT status=unresolved on the issue.',
    '  2. GET the issue and confirm status is unresolved.',
    '  3. PUT status=resolved with no statusDetails.',
    '  4. GET the issue and confirm statusDetails has no release or commit pin keys.',
    'Step 1 is not optional. A resolved-to-resolved write silently no-ops and',
    'leaves the pin in place while reporting success.',
  ].join('\n');
}

export function assertLiveBoardIsNotEmpty(issues, org, project) {
  if (Array.isArray(issues) && issues.length > 0) return;
  throw new Error(
    `Sentry returned no resolved issues for ${org}/${project}. A project with history always `
      + 'has some, so this is a misread rather than a clean board: check SENTRY_ORG and '
      + 'SENTRY_PROJECT, and that the token can see this project. Reporting it clean would be '
      + 'the silent pass this audit exists to prevent.',
  );
}

export function parseArguments(argv) {
  const { values } = parseNodeArgs({
    args: argv,
    options: {
      input: { type: 'string' },
    },
    allowPositionals: false,
    strict: true,
  });
  return values;
}

View on GitHub (pinned to 7d06c8633d)