{"record":{"id":"583351a25430d8da","repo":"SigNoz/signoz","slug":"codeinvalidinput-583351","errorCode":"CodeInvalidInput","errorMessage":"google chat webhook_url is required","messagePattern":"google chat webhook_url is required","errorType":"validation","errorClass":"errors SigNozError","httpStatus":400,"severity":"error","filePath":"pkg/types/alertmanagertypes/googlechat.go","lineNumber":41,"sourceCode":"\tNotifierConfig: config.NotifierConfig{\n\t\tVSendResolved: false,\n\t},\n\tTitle: `[{{ .Status | toUpper }}{{ if eq .Status \"firing\" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }}`,\n\tText: `{{ range .Alerts -}}\n**Alert:** {{ .Labels.alertname }}{{ if .Labels.severity }} ({{ .Labels.severity }}){{ end }}{{ if .Annotations.summary }}\n**Summary:** {{ .Annotations.summary }}{{ end }}{{ if .Annotations.description }}\n**Description:** {{ .Annotations.description }}{{ end }}\n{{ end }}`,\n}\n\nfunc (c *GoogleChatReceiverConfig) UnmarshalYAML(unmarshal func(any) error) error {\n\t*c = DefaultGoogleChatReceiverConfig\n\ttype plain GoogleChatReceiverConfig\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\tif c.WebhookURL == nil {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"google chat webhook_url is required\")\n\t}\n\tu, err := url.Parse(c.WebhookURL.String())\n\tif err != nil {\n\t\treturn errors.Newf(errors.TypeInvalidInput, errors.CodeInvalidInput, \"invalid google chat webhook_url: %v\", err)\n\t}\n\tif u.Scheme != \"https\" {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"google chat webhook_url must use https\")\n\t}\n\tif strings.ToLower(u.Hostname()) != \"chat.googleapis.com\" {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"google chat webhook_url must use chat.googleapis.com\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":23,"sourceCodeEnd":55,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/types/alertmanagertypes/googlechat.go#L23-L55","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add webhook_url: <https://chat.googleapis.com/...> to the googlechat receiver config","If using env substitution, verify the referenced env var is set and non-empty in the deployment","Check the receiver is indented under the correct receiver name so the field is actually parsed"],"exampleFix":"// before\nreceivers:\n  - name: team-chat\n    googlechat: {}\n// after\nreceivers:\n  - name: team-chat\n    googlechat:\n      webhook_url: https://chat.googleapis.com/chat/v1/spaces/XXX/messages?key=YYY","handlingStrategy":"validation","validationCode":"func validateGoogleChat(cfg map[string]any) error {\n  gc, ok := cfg[\"googlechat\"].(map[string]any)\n  if !ok { return nil }\n  url, _ := gc[\"webhook_url\"].(string)\n  if strings.TrimSpace(url) == \"\" { return fmt.Errorf(\"googlechat webhook_url is required\") }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"err := receiver.UnmarshalYAML(...)\nif err != nil && strings.Contains(err.Error(), \"webhook_url is required\") {\n  // flag missing credential in config UI / reject with actionable message\n}","preventionTips":["Lint alertmanager YAML for googlechat receivers missing webhook_url before deploy","Inject webhook URLs via env/secret and fail CI when the env var is unset"],"tags":["alertmanager","google-chat","webhook","config-validation","yaml"],"backgroundTag":"missing-required-config-field","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}