{"record":{"id":"82cf26f1027e7806","repo":"thedotmack/claude-mem","slug":"onboarding-explainer-not-available","errorCode":null,"errorMessage":"Onboarding explainer not available","messagePattern":"Onboarding explainer not available","errorType":"http","errorClass":null,"httpStatus":404,"severity":"info","filePath":"src/services/worker/http/routes/SearchRoutes.ts","lineNumber":442,"sourceCode":"    }\n\n    res.json({ context: lines.join('\\n'), count: observations.length });\n  });\n\n  private queryWithPlatformSource(req: Request): Record<string, any> {\n    const platformSource = this.getOptionalPlatformSourceFromRequest(req);\n    if (!platformSource) {\n      return req.query as Record<string, any>;\n    }\n    return {\n      ...(req.query as Record<string, any>),\n      platformSource,\n    };\n  }\n\n  private handleOnboardingExplainer = this.wrapHandler((_req: Request, res: Response): void => {\n    if (cachedOnboardingExplainer === null) {\n      res.status(404).json({ error: 'Onboarding explainer not available' });\n      return;\n    }\n    res.setHeader('Content-Type', 'text/markdown; charset=utf-8');\n    res.send(cachedOnboardingExplainer);\n  });\n\n  private handleGetTimelineByQuery = this.wrapHandler(async (req: Request, res: Response): Promise<void> => {\n    const result = await this.searchManager.getTimelineByQuery(this.queryWithPlatformSource(req));\n    res.json(result);\n  });\n}\n","sourceCodeStart":424,"sourceCodeEnd":454,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/worker/http/routes/SearchRoutes.ts#L424-L454","documentation":"handleOnboardingExplainer serves a cached onboarding markdown document. If the module-level cache cachedOnboardingExplainer is still null (the explainer content was never loaded/generated), the endpoint replies 404 'Onboarding explainer not available' instead of serving the markdown.","triggerScenarios":"GET the onboarding explainer route before the explainer content has been loaded/cached in the worker process, or when explainer generation failed or is unavailable in this build/environment.","commonSituations":"Requesting the explainer immediately after worker startup before initialization populates the cache; a build or install where the onboarding markdown asset is missing; explainer generation failed silently at startup.","solutions":["Retry the request after the worker finishes initializing (the cache is populated at startup)","Check worker startup logs for explainer generation/loading failures","Verify the onboarding markdown asset exists in the installation; reinstall/repair if missing","Fall back to the shipped docs (docs.claude-mem.ai) if the endpoint remains 404"],"exampleFix":"// before\nconst res = await fetch('http://localhost:37777/api/onboarding-explainer'); // 404 right after start\n// after\nawait waitForWorkerReady(); // poll a health endpoint first\nconst res = await fetch('http://localhost:37777/api/onboarding-explainer');","handlingStrategy":"retry","validationCode":"const res = await fetch('http://localhost:37777/api/onboarding-explainer');\nif (res.status === 404) console.warn('Explainer not cached yet; retry after worker init');","typeGuard":null,"tryCatchPattern":"async function getExplainer(retries = 5) {\n  for (let i = 0; i < retries; i++) {\n    const res = await fetch('http://localhost:37777/api/onboarding-explainer');\n    if (res.ok) return res.text();\n    if (res.status === 404) await new Promise(r => setTimeout(r, 1000 * (i + 1)));\n    else res.body?.cancel();\n  }\n  return null; // fall back to bundled docs\n}","preventionTips":["Wait for a readiness/health signal before requesting startup-cached content","Cache the explainer response client-side after first successful fetch","Ship a bundled fallback copy of the onboarding doc","Check worker logs for explainer generation failures after repeated 404s"],"tags":["http","not-found","cache"],"backgroundTag":"resource-not-found","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}