amir20/dozzle · error

is required

Error message

%s is required

What it means

requireNonEmpty iterates the given field map and returns '<name> is required' for the first empty value. The notification-creation tools use it to enforce that mandatory fields (name, container_id, destination id, etc.) are present before building a Subscription.

Solutions

  1. Supply every required field with a non-empty value
  2. Check the error message; it names exactly which field was empty
  3. Create the destination first and pass its real id instead of an empty placeholder

Example fix

// before
createLogNotification({name: "", container_id: "abc", pattern: "ERROR"})
// after
createLogNotification({name: "error-alert", container_id: "abc", pattern: "ERROR"})
Defensive patterns

Strategy: validation

Validate before calling

const REQUIRED = ['name','container_id']; const missing = REQUIRED.filter(k => !args[k]); if (missing.length) throw new Error(`${missing.join(',')} is required before calling the notification tool`);

Type guard

null

Prevention

When it happens

Trigger: Calling executeCreateLogNotification / executeCreateMetricNotification / executeCreateEventNotification with an empty or missing field such as name, container_id, pattern, metric, threshold, or destination_id.

Common situations: LLM tool calls omitting optional-seeming fields that are actually required; empty strings from unset form inputs; scripts interpolating empty env vars into arguments.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at internal/cloud/tools_notifications.go:169

		"name":                 args.Name,
		"container_expression": args.ContainerExpression,
		"event_expression":     args.EventExpression,
	}); err != nil {
		return nil, err
	}

	return addSubscriptionResponse(deps.NotificationService, &notification.Subscription{
		Name:                args.Name,
		DispatcherID:        cloudDispatcherID,
		ContainerExpression: args.ContainerExpression,
		EventExpression:     args.EventExpression,
	})
}

func requireNonEmpty(fields map[string]string) error {
	for name, v := range fields {
		if v == "" {
			return fmt.Errorf("%s is required", name)
		}
	}
	return nil
}

func notificationResponse(message string) *pb.CallToolResponse {
	return &pb.CallToolResponse{
		Success: true,
		Result: &pb.CallToolResponse_Notification{Notification: &pb.NotificationResult{
			Success: true,
			Message: message,
		}},
	}
}

func addSubscriptionResponse(svc NotificationService, sub *notification.Subscription) (*pb.CallToolResponse, error) {
	if err := svc.AddSubscription(sub); err != nil {
		return nil, fmt.Errorf("creating subscription: %w", err)

View on GitHub (pinned to d9463cbe21)