{"record":{"id":"97bcc60e71157bb9","repo":"bytedance/deer-flow","slug":"result-message","errorCode":null,"errorMessage":"result.message","messagePattern":"result\\.message","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"frontend/src/app/(auth)/layout.tsx","lineNumber":51,"sourceCode":"    case \"unauthenticated\":\n      content = <AuthProvider initialUser={null}>{children}</AuthProvider>;\n      break;\n    case \"gateway_unavailable\":\n      // Auth pages have no banner of their own, so render one here. The\n      // fallback's AuthProvider replaces the bare-HTML branch that\n      // previously locked users out without any logout/retry capability.\n      content = (\n        <GatewayOfflineFallback renderBanner>\n          <div className=\"flex h-screen flex-col items-center justify-center gap-4\">\n            <p className=\"text-muted-foreground\">\n              Service temporarily unavailable.\n            </p>\n          </div>\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":33,"sourceCodeEnd":58,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/app/(auth)/layout.tsx#L33-L58","documentation":"The (auth) route group layout fetches a bootstrap/config result before render and switches on its status. For status 'config_error' it deliberately throws result.message — rendering is abandoned because the gateway reported a broken configuration (e.g. malformed config.yaml), and showing auth UI against a misconfigured backend would be misleading.","triggerScenarios":"The bootstrap endpoint signals config_error: repo-root config.yaml missing required keys or failing schema validation, invalid nested sections (e.g. bad model or channel config), or example values left unexpanded after copying config.example.yaml.","commonSituations":"Fresh clone where `make config` was skipped or the copied config.yaml still contains placeholder values; an edit to config.yaml introducing a syntax/schema error; gateway restarted with an unreadable config file.","solutions":["Run `make doctor` from the repo root — it reports configuration and requirement problems directly.","Open the gateway logs/terminal: the thrown message is the gateway's own config validation text naming the offending key.","Re-copy config.example.yaml to config.yaml and reapply only the settings you need, validating after each change.","Restart the gateway after fixing config so the bootstrap endpoint returns a healthy status."],"exampleFix":"# before: placeholder left in config.yaml\nbasic:\n  model: YOUR_MODEL_HERE\n\n# after: valid value\nbasic:\n  model: deepseek-chat","handlingStrategy":"validation","validationCode":"// In a wrapper around the bootstrap fetch:\n// const result = await fetchBootstrap();\n// if (result.status === 'config_error') render a friendly setup screen with result.message instead of letting the layout throw.","typeGuard":"function isConfigError(r: { status: string; message?: string }): boolean {\n  return r.status === \"config_error\" && typeof r.message === \"string\";\n}","tryCatchPattern":"// Prefer replacing the throw with a boundary:\n// <ErrorBoundary fallback={<SetupHelpScreen message={result.message} />}> ... layout ... </ErrorBoundary>","preventionTips":["Run `make doctor` after any config.yaml change and before starting the stack.","Validate config.yaml against the schema in CI or a pre-commit hook.","Have the gateway emit the exact offending key in result.message so users can fix it without log spelunking."],"tags":["config","bootstrap","gateway","render-crash","frontend"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}