{"record":{"id":"189ada76079bc6c1","repo":"chenglou/pretext","slug":"symbol-batch-failed","errorCode":null,"errorMessage":"symbol batch failed","messagePattern":"symbol batch failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/symbol-check.ts","lineNumber":151,"sourceCode":"    serverProcess = pageServer.process\n    const requestId = `${browser}-${Date.now()}-${Math.random().toString(36).slice(2)}`\n    const reportServer = await startPostedReportServer<ProbeBatchReport>(requestId)\n\n    try {\n      const url =\n        `${pageServer.baseUrl}/probe?batch=symbol-runs` +\n        `&requestId=${encodeURIComponent(requestId)}` +\n        `&reportEndpoint=${encodeURIComponent(reportServer.endpoint)}`\n      const batchReport = await loadPostedReport(\n        session,\n        url,\n        () => reportServer.waitForReport(null),\n        requestId,\n        reportBrowser,\n        timeoutMs,\n      )\n      if (batchReport.status === 'error') {\n        throw new Error(batchReport.message ?? 'symbol batch failed')\n      }\n\n      const batchResults = batchReport.results ?? []\n      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))\n      for (const testCase of SYMBOL_ORACLE_CASES) {\n        if (!caseRunsInBrowser(testCase, browser)) continue\n        const report = reportsByLabel.get(testCase.label)\n        if (report === undefined) {\n          throw new Error(`Missing symbol result for ${testCase.label}`)\n        }\n        printCaseResult(browser, testCase, report)\n        if (!reportIsExact(report)) ok = false\n      }\n    } finally {\n      reportServer.close()\n    }\n  } finally {\n    session?.close()","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/chenglou/pretext/blob/ac49b09b7d83ede19581fa94a8b892b07d309baf/scripts/symbol-check.ts#L133-L169","documentation":"Fallback message used when the /probe?batch=symbol-runs page posts {status:'error'} with a nullish message. The page's runProbeBatch (pages/probe.ts:886-891) wraps execution and posts an error with a message on any top-level throw; this string is the last-resort default when that message is missing. It indicates the batch never produced results, distinct from error 80's 'Missing symbol result' (ready status, partial results).","triggerScenarios":"Page-side getProbeBatchSpec(batch) threw 'Unknown probe batch' (a stale bundle could cause this for symbol-runs); runProbeBatch threw outside the per-case try/catch with a nullish error.message; transport desync posted an error object without a message field.","commonSituations":"Stale pages/probe.ts bundle served by an old page server; HMR half-applied; a code path that constructs {status:'error'} without a message.","solutions":["Restart the page server so pages/probe.ts matches the checked-in source.","Inspect batchReport in the checker (temporary console.log(JSON.stringify(batchReport))) to recover the real page-side error.","Re-run; the single-owner lock and side-channel POST can transiently error.","If the recovered message is 'Unknown probe batch symbol-runs', the served bundle predates the symbol-runs batch name."],"exampleFix":"// before\nif (batchReport.status === 'error') {\n  throw new Error(batchReport.message ?? 'symbol batch failed')\n}\n\n// after (surface the raw payload while debugging)\nif (batchReport.status === 'error') {\n  console.error('symbol batch error payload:', JSON.stringify(batchReport))\n  throw new Error(batchReport.message ?? `symbol batch failed (raw: ${JSON.stringify(batchReport)})`)\n}","handlingStrategy":"try-catch","validationCode":"if (batchReport.status !== 'ready' && !batchReport.message) {\n  console.error('symbol-check: batch errored with no message; likely a stale pages/probe.ts bundle. Raw:', JSON.stringify(batchReport))\n}","typeGuard":null,"tryCatchPattern":"try {\n  const batchReport = await loadPostedReport(session, url, () => reportServer.waitForReport(null), requestId, reportBrowser, timeoutMs)\n  if (batchReport.status === 'error') {\n    throw new Error(batchReport.message ?? `symbol batch failed (raw: ${JSON.stringify(batchReport)})`)\n  }\n} catch (e) {\n  console.error('symbol-check batch transport error:', e)\n  // Restart the page server / re-run. Do not silently mark the run green.\n  throw e\n}","preventionTips":["Keep the page server in sync with pages/probe.ts; a stale bundle is the most common cause of an error with no message.","Always include a message when constructing {status:'error'} reports on the page side so the fallback string never fires.","Treat a nullish-message batch error as a stale-bundle signal first; re-run before debugging the engine."],"tags":["browser-automation","ci","oracle","test-infra"],"backgroundTag":null,"analyzedSha":"ac49b09b7d83ede19581fa94a8b892b07d309baf","analyzedAt":"2026-08-12T17:03:16.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}