SigNoz/signoz · error · errors SigNozError

CodeInvalidInput

CodeInvalidInput

Error message

google chat webhook_url is required

What it means

Thrown during YAML unmarshalling of a Google Chat receiver config when no webhook_url is set. The alertmanager config loader validates that a Google Chat receiver has a webhook URL before accepting the configuration, since it is required to deliver alerts. It surfaces from UnmarshalYAML, which runs whenever receivers are parsed or defaulted.

Source

Thrown at pkg/types/alertmanagertypes/googlechat.go:41

	NotifierConfig: config.NotifierConfig{
		VSendResolved: false,
	},
	Title: `[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }}`,
	Text: `{{ range .Alerts -}}
**Alert:** {{ .Labels.alertname }}{{ if .Labels.severity }} ({{ .Labels.severity }}){{ end }}{{ if .Annotations.summary }}
**Summary:** {{ .Annotations.summary }}{{ end }}{{ if .Annotations.description }}
**Description:** {{ .Annotations.description }}{{ end }}
{{ end }}`,
}

func (c *GoogleChatReceiverConfig) UnmarshalYAML(unmarshal func(any) error) error {
	*c = DefaultGoogleChatReceiverConfig
	type plain GoogleChatReceiverConfig
	if err := unmarshal((*plain)(c)); err != nil {
		return err
	}
	if c.WebhookURL == nil {
		return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "google chat webhook_url is required")
	}
	u, err := url.Parse(c.WebhookURL.String())
	if err != nil {
		return errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, "invalid google chat webhook_url: %v", err)
	}
	if u.Scheme != "https" {
		return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "google chat webhook_url must use https")
	}
	if strings.ToLower(u.Hostname()) != "chat.googleapis.com" {
		return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "google chat webhook_url must use chat.googleapis.com")
	}
	return nil
}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Add webhook_url: <https://chat.googleapis.com/...> to the googlechat receiver config
  2. If using env substitution, verify the referenced env var is set and non-empty in the deployment
  3. Check the receiver is indented under the correct receiver name so the field is actually parsed

Example fix

// before
receivers:
  - name: team-chat
    googlechat: {}
// after
receivers:
  - name: team-chat
    googlechat:
      webhook_url: https://chat.googleapis.com/chat/v1/spaces/XXX/messages?key=YYY
Defensive patterns

Strategy: validation

Validate before calling

func validateGoogleChat(cfg map[string]any) error {
  gc, ok := cfg["googlechat"].(map[string]any)
  if !ok { return nil }
  url, _ := gc["webhook_url"].(string)
  if strings.TrimSpace(url) == "" { return fmt.Errorf("googlechat webhook_url is required") }
  return nil
}

Try / catch

err := receiver.UnmarshalYAML(...)
if err != nil && strings.Contains(err.Error(), "webhook_url is required") {
  // flag missing credential in config UI / reject with actionable message
}

Prevention

When it happens

Trigger: Defining a receiver of type googlechat in alertmanager config YAML without a webhook_url field; calling newReceiver, Resolved, defaultedBaseReceiver, NewRouteFromRouteConfig, or NewRouteFromReceiver with such a config.

Common situations: Copy-pasting a receiver template and forgetting the URL, using env-substitution like ${GOOGLE_CHAT_WEBHOOK_URL} when the env var is empty, or trimming the field during config refactoring.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/583351a25430d8da. Report an issue: GitHub.