{"record":{"id":"daf0111e3ae2e213","repo":"Mintplex-Labs/anything-llm","slug":"e-message-daf011","errorCode":null,"errorMessage":"${e.message}","messagePattern":"\\$\\{e\\.message\\}","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/utils/googleAgentSkillEndpoints.js","lineNumber":36,"sourceCode":"        const config = await GmailBridge.getConfig();\n\n        const hasDeploymentId = !!config.deploymentId;\n        const hasApiKey = !!config.apiKey;\n        const isConfigured = hasDeploymentId && hasApiKey;\n\n        const safeConfig = {\n          deploymentId: config.deploymentId || \"\",\n          apiKey: hasApiKey ? \"********\" : \"\",\n        };\n\n        return response.status(200).json({\n          success: true,\n          isConfigured,\n          config: safeConfig,\n        });\n      } catch (e) {\n        console.error(\"Gmail status error:\", e);\n        response.status(500).json({ success: false, error: e.message });\n      }\n    }\n  );\n\n  app.get(\n    \"/admin/agent-skills/google-calendar/status\",\n    [validatedRequest, isSingleUserMode],\n    async (_request, response) => {\n      try {\n        const config = await GoogleCalendarBridge.getConfig();\n\n        const hasDeploymentId = !!config.deploymentId;\n        const hasApiKey = !!config.apiKey;\n        const isConfigured = hasDeploymentId && hasApiKey;\n\n        const safeConfig = {\n          deploymentId: config.deploymentId || \"\",\n          apiKey: hasApiKey ? \"********\" : \"\",","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/utils/googleAgentSkillEndpoints.js#L18-L54","documentation":"The 500 reply from GET /admin/agent-skills/gmail/status when anything throws inside the handler. The try block calls GoogleAgentSkill/GmailBridge config loading (a system_settings database read) and builds a redacted config; any exception - failed DB read, malformed stored JSON for the gmail_agent_config setting, or an unexpected shape - is logged as 'Gmail status error:' and returned as e.message.","triggerScenarios":"GET /admin/agent-skills/gmail/status while the system settings row is unreadable: database locked/offline, a corrupted or hand-edited gmail_agent_config value whose JSON parse throws, or a partially migrated schema.","commonSituations":"Status probe fired right at server boot before the DB is ready; settings row written by an older version with a different shape; storage permission issues after moving the data directory.","solutions":["Check server logs for the 'Gmail status error:' line to see the underlying e.message (DB error vs JSON parse error).","If the stored gmail config is corrupted, clear/re-save the Gmail agent skill settings from the admin UI to rewrite a clean row.","Verify the database/storage mount is healthy and not locked by another process, then reload the status endpoint."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function gmailStatus(api) {\n  try {\n    const res = await fetch(`${api}/admin/agent-skills/gmail/status`);\n    if (res.status === 500) {\n      const { error } = await res.json();\n      console.error(\"Gmail status backend fault:\", error); // check server log for 'Gmail status error:'\n      return null;\n    }\n    return await res.json();\n  } catch { return null; }\n}","preventionTips":["Poll status only after the server reports ready, not during boot.","Never hand-edit the gmail_agent_config settings row; use the admin UI.","Re-saving the Gmail skill config is the quickest way to rewrite a corrupt row."],"tags":["gmail","agent-skills","status","database"],"backgroundTag":"config-load-failure","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}