{"record":{"id":"473636c1b7301bed","repo":"amir20/dozzle","slug":"notifications-are-not-configured-on-this-host","errorCode":null,"errorMessage":"notifications are not configured on this host","messagePattern":"notifications are not configured on this host","errorType":"error_code","errorClass":"errNotificationsNotConfigured","httpStatus":null,"severity":"info","filePath":"internal/cloud/tools_notifications.go","lineNumber":19,"sourceCode":"package cloud\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/amir20/dozzle/internal/notification\"\n\tpb \"github.com/amir20/dozzle/proto/cloud\"\n)\n\n// cloudDispatcherID is the reserved ID for the Dozzle Cloud dispatcher. All\n// alerts created via cloud tools route here so the user receives them through\n// their configured cloud channels (Telegram, Discord, etc.).\nconst cloudDispatcherID = 0\n\n// errNotificationsNotConfigured is returned when notification tools are\n// invoked in a mode without a notification manager (e.g. k8s).\nvar errNotificationsNotConfigured = errors.New(\"notifications are not configured on this host\")\n\nfunc executeListNotifications(deps ToolDeps) (*pb.CallToolResponse, error) {\n\tif deps.NotificationService == nil {\n\t\treturn nil, errNotificationsNotConfigured\n\t}\n\n\tsubs := deps.NotificationService.Subscriptions()\n\n\tvar sb strings.Builder\n\tfmt.Fprintf(&sb, \"Subscriptions (%d):\\n\", len(subs))\n\tif len(subs) == 0 {\n\t\tsb.WriteString(\"  (none)\\n\")\n\t}\n\tfor _, s := range subs {\n\t\tfmt.Fprintf(&sb, \"  - #%d %q [%s, enabled=%t]\\n\", s.ID, s.Name, subscriptionKind(s), s.Enabled)\n\t\tif s.ContainerExpression != \"\" {\n\t\t\tfmt.Fprintf(&sb, \"      container: %s\\n\", s.ContainerExpression)\n\t\t}","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/cloud/tools_notifications.go#L1-L37","documentation":"errNotificationsNotConfigured in internal/cloud/tools_notifications.go is returned by cloud notification tools (list/create log, metric, event notifications) when deps.NotificationService is nil. This happens in deployment modes without a notification manager, such as k8s or agent mode, so the tool call cannot be serviced.","triggerScenarios":"Cloud sends a ToolRequest for ListNotifications or any Create*Notification tool while the ToolDeps were built without a NotificationService (k8s/agent deployments).","commonSituations":"Cloud assistant attempts to create an alert on a k8s-mode Dozzle instance; agent-only deployment wired to cloud tools; feature rollout where cloud tools exist but notifications aren't wired for that mode.","solutions":["Run notifications-capable server mode, or accept that alert tools are unavailable on this host","Have the cloud tool respond with a descriptive 'unsupported in this deployment mode' result instead of a raw error","Gate notification tools out of AvailableTools() when NotificationService is nil so the assistant never calls them","Verify the ToolDeps wiring actually injects the notification manager in your deployment"],"exampleFix":"// before\nif deps.NotificationService == nil {\n    return nil, errNotificationsNotConfigured\n}\n// after: advertise tools conditionally instead\nfunc AvailableTools(deps ToolDeps) []Tool {\n    if deps.NotificationService == nil { return toolsWithoutNotifications() }\n    return allTools()\n}","handlingStrategy":"validation","validationCode":"// before registering cloud notification tools\nif deps.NotificationService == nil {\n    return []Tool{} // omit notification tools entirely\n}","typeGuard":"if deps.NotificationService == nil {\n    // notifications unavailable in this deployment mode\n}","tryCatchPattern":"resp, err := executeListNotifications(deps)\nif errors.Is(err, errNotificationsNotConfigured) {\n    return toolError(\"notifications are not available in this deployment mode (e.g. k8s)\")\n}","preventionTips":["Only advertise notification tools to Cloud when a NotificationService is wired","Map this error to a descriptive tool response instead of a raw failure","Verify ToolDeps construction includes the manager for server-mode deployments"],"tags":["notifications","cloud-tools","go","unsupported-mode"],"backgroundTag":"feature-not-enabled","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}