oven-sh/bun · warning · Error
Missing sentry_id
Error message
Missing sentry_id
What it means
The script extracts the Sentry event id from a hidden marker comment '<!-- sentry_id: ... -->' embedded in the issue body by the crash-report flow. This instance throws when indexOf cannot find the opening marker or its closing ' -->', meaning the issue body simply does not contain a Sentry event reference.
Source
Thrown at scripts/associate-issue-with-sentry.ts:11
const body = process.env.GITHUB_ISSUE_BODY;
const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN;
if (!body || !SENTRY_AUTH_TOKEN) {
throw new Error("Missing environment variables");
}
const id = body.indexOf("<!-- sentry_id: ");
const endIdLine = body.indexOf(" -->", id + 1);
if (!(id > -1 && endIdLine > -1)) {
throw new Error("Missing sentry_id");
}
const sentryId = body.slice(id + "<!-- sentry_id: ".length, endIdLine).trim();
if (!sentryId) {
throw new Error("Missing sentry_id");
}
const response = await fetch(`https://sentry.io/api/0/organizations/4507155222364160/eventids/${sentryId}/`, {
headers: {
Authorization: `Bearer ${SENTRY_AUTH_TOKEN}`,
},
});
if (!response.ok) {
throw new Error(`Failed to fetch Sentry event: ${response.statusText}`);
}
const json = await response.json();
const groupId = json?.groupId;
if (!groupId) {
throw new Error("Missing groupId");View on GitHub (pinned to 8c5296ac45)
Solutions
- Gate the workflow step on issues that actually carry the marker (contains(github.event.issue.body, '<!-- sentry_id:'))
- Change the script to exit 0 with a log line when the marker is absent, since issues without crash data are expected
- If the issue genuinely has a Sentry event, re-add the marker comment with the event id
Example fix
// before
if (!(id > -1 && endIdLine > -1)) {
throw new Error('Missing sentry_id');
}
// after
if (!(id > -1 && endIdLine > -1)) {
console.log('No sentry_id marker; nothing to associate');
process.exit(0);
} Defensive patterns
Strategy: validation
Validate before calling
const body = process.env.GITHUB_ISSUE_BODY ?? '';
const hasMarker = body.indexOf('<!-- sentry_id: ') > -1 && body.indexOf(' -->', body.indexOf('<!-- sentry_id: ') + 1) > -1;
if (!hasMarker) {
console.log('no sentry_id marker; skipping association');
process.exit(0);
} Prevention
- Gate the workflow step with if: contains(github.event.issue.body, '<!-- sentry_id:')
- Treat marker-less issues as a normal case (skip), not an exceptional one
When it happens
Trigger: The action ran on a manually-filed issue that never used the crash-report template; the marker was edited out of the body by a user; the body was truncated before the marker position.
Common situations: Workflow triggers on all new issues (on: issues) instead of only crash-report issues; users edit the template and delete the HTML comment; third-party automation files issues without the marker.
Related errors
- Missing environment variables
- GITHUB_ISSUE_NUMBER must be set
- GITHUB_ISSUE_BODY must be set
- picsum ${p.id}: ${res.status}
- ${runtime} client exited ${code}${code === null ? " (timed o
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/6e64f3126a8e30d3.
Report an issue: GitHub.