{"record":{"id":"59424c0d63a41680","repo":"bytedance/deer-flow","slug":"result-message-59424c","errorCode":null,"errorMessage":"result.message","messagePattern":"result\\.message","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"frontend/src/app/workspace/layout.tsx","lineNumber":50,"sourceCode":"      break;\n    case \"needs_setup\":\n      redirect(\"/setup\");\n    case \"system_setup_required\":\n      redirect(\"/setup\");\n    case \"unauthenticated\":\n      redirect(\"/login\");\n    case \"gateway_unavailable\":\n      // GatewayOfflineFallback supplies the AuthProvider; WorkspaceContent\n      // already mounts the banner inside its sidebar layout, so renderBanner\n      // stays false here to avoid double-mounting.\n      content = (\n        <GatewayOfflineFallback>\n          <WorkspaceContent gatewayUnavailable>{children}</WorkspaceContent>\n        </GatewayOfflineFallback>\n      );\n      break;\n    case \"config_error\":\n      throw new Error(result.message);\n    default:\n      assertNever(result);\n  }\n\n  return <I18nProvider initialLocale={locale}>{content}</I18nProvider>;\n}\n","sourceCodeStart":32,"sourceCodeEnd":57,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/app/workspace/layout.tsx#L32-L57","documentation":"This error is thrown by the Next.js workspace server layout when the Gateway's bootstrap/config endpoint returns a 'config_error' status. The layout calls a config-loading routine whose result is a discriminated union; the 'config_error' branch re-throws the backend-supplied message as a render-time exception, which Next.js converts into a 500 error page (or the dev overlay). It means the Gateway booted far enough to answer, but the server-side config payload it returned was invalid.","triggerScenarios":"GET of the workspace bootstrap endpoint returns {status:'config_error', message:...} — typically because config.yaml at the repo root is malformed YAML, references an unknown key/enum, or points at a missing file. Visiting /workspace/* while the Gateway runs with a broken config.yaml produces this throw during server render of frontend/src/app/workspace/layout.tsx.","commonSituations":"Editing config.yaml by hand and leaving a syntax error; copying config.example.yaml incompletely; a schema change after upgrading DeerFlow making old keys invalid; a stray environment variable overriding a config value with a bad type.","solutions":["Run `make doctor` (repo root) — it validates config.yaml and reports the exact offending key/section.","Open config.yaml and compare against config.example.yaml; fix YAML syntax (tabs, quotes, indentation) and invalid enum values.","If unsure, back up config.yaml, re-copy from config.example.yaml, and re-apply your edits incrementally, restarting the Gateway after each change.","Check the Gateway logs for the detailed config-load traceback — the layout only re-throws the summary message."],"exampleFix":"# before (broken config.yaml)\nmodels:\n  basic: { provider: openrouter }\n  basic_model: [ ]   # wrong shape\n\n# after\nmodels:\n  basic:\n    provider: openrouter\n    basic_model: deepseek/deepseek-chat","handlingStrategy":"validation","validationCode":"// Before rendering the workspace, validate config via the Gateway:\nconst res = await fetch(`${backend}/api/config/validate`, { cache: 'no-store' });\nif (!res.ok) {\n  // route to a settings/error page instead of letting the layout throw\n  redirect('/workspace/setup?reason=config_error');\n}","typeGuard":"function isConfigError(\n  result: BootstrapResult,\n): result is { status: 'config_error'; message: string } {\n  return result.status === 'config_error' && typeof result.message === 'string';\n}","tryCatchPattern":"// In an error boundary one level above the layout:\ntry {\n  renderWorkspace();\n} catch (e) {\n  if (e instanceof Error && /config/i.test(e.message)) showConfigHelp(e.message);\n  else throw e;\n}","preventionTips":["Run `make doctor` in CI and before every deploy to catch config errors before the layout renders.","Keep config.yaml under a linting step (yamllint + schema check) when it changes.","Never hand-edit config.yaml on a live box; edit, validate, then restart."],"tags":["config","nextjs","server-render","gateway"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}