amir20/dozzle · info · errNotificationsNotConfigured

notifications are not configured on this host

Error message

notifications are not configured on this host

What it means

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.

Solutions

  1. Run notifications-capable server mode, or accept that alert tools are unavailable on this host
  2. Have the cloud tool respond with a descriptive 'unsupported in this deployment mode' result instead of a raw error
  3. Gate notification tools out of AvailableTools() when NotificationService is nil so the assistant never calls them
  4. Verify the ToolDeps wiring actually injects the notification manager in your deployment

Example fix

// before
if deps.NotificationService == nil {
    return nil, errNotificationsNotConfigured
}
// after: advertise tools conditionally instead
func AvailableTools(deps ToolDeps) []Tool {
    if deps.NotificationService == nil { return toolsWithoutNotifications() }
    return allTools()
}
Defensive patterns

Strategy: validation

Validate before calling

// before registering cloud notification tools
if deps.NotificationService == nil {
    return []Tool{} // omit notification tools entirely
}

Type guard

if deps.NotificationService == nil {
    // notifications unavailable in this deployment mode
}

Try / catch

resp, err := executeListNotifications(deps)
if errors.Is(err, errNotificationsNotConfigured) {
    return toolError("notifications are not available in this deployment mode (e.g. k8s)")
}

Prevention

When it happens

Trigger: Cloud sends a ToolRequest for ListNotifications or any Create*Notification tool while the ToolDeps were built without a NotificationService (k8s/agent deployments).

Common situations: 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.

Related errors


AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07). Data as JSON: /api/errors/473636c1b7301bed. Report an issue: GitHub.

Appendix: source

Thrown at internal/cloud/tools_notifications.go:19

package cloud

import (
	"errors"
	"fmt"
	"strings"

	"github.com/amir20/dozzle/internal/notification"
	pb "github.com/amir20/dozzle/proto/cloud"
)

// cloudDispatcherID is the reserved ID for the Dozzle Cloud dispatcher. All
// alerts created via cloud tools route here so the user receives them through
// their configured cloud channels (Telegram, Discord, etc.).
const cloudDispatcherID = 0

// errNotificationsNotConfigured is returned when notification tools are
// invoked in a mode without a notification manager (e.g. k8s).
var errNotificationsNotConfigured = errors.New("notifications are not configured on this host")

func executeListNotifications(deps ToolDeps) (*pb.CallToolResponse, error) {
	if deps.NotificationService == nil {
		return nil, errNotificationsNotConfigured
	}

	subs := deps.NotificationService.Subscriptions()

	var sb strings.Builder
	fmt.Fprintf(&sb, "Subscriptions (%d):\n", len(subs))
	if len(subs) == 0 {
		sb.WriteString("  (none)\n")
	}
	for _, s := range subs {
		fmt.Fprintf(&sb, "  - #%d %q [%s, enabled=%t]\n", s.ID, s.Name, subscriptionKind(s), s.Enabled)
		if s.ContainerExpression != "" {
			fmt.Fprintf(&sb, "      container: %s\n", s.ContainerExpression)
		}

View on GitHub (pinned to d9463cbe21)