{"record":{"id":"f03c2d07ae8861e1","repo":"Netflix/chaosmonkey","slug":"unknown-grouping-s","errorCode":null,"errorMessage":"Unknown grouping: %s","messagePattern":"Unknown grouping: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/fromjson.go","lineNumber":142,"sourceCode":"\n\tif *cm.Enabled && (*cm.MeanTimeBetweenKillsInWorkDays <= 0) {\n\t\treturn nil, fmt.Errorf(\"invalid attributes.chaosMonkey.meanTimeBetweenKillsInWorkDays: %d\", cm.MeanTimeBetweenKillsInWorkDays)\n\t}\n\n\tgrouping := chaosmonkey.Cluster\n\n\tswitch cm.Grouping {\n\tcase \"app\":\n\t\tgrouping = chaosmonkey.App\n\tcase \"stack\":\n\t\tgrouping = chaosmonkey.Stack\n\tcase \"cluster\":\n\t\tgrouping = chaosmonkey.Cluster\n\tdefault:\n\t\t// If not enabled, the user may not have specified a grouping at all,\n\t\t// in which case we stick with the default\n\t\tif *cm.Enabled {\n\t\t\treturn nil, errors.Errorf(\"Unknown grouping: %s\", cm.Grouping)\n\t\t}\n\t}\n\n\tvar meanTime int\n\tvar minTime int\n\n\tif cm.MeanTimeBetweenKillsInWorkDays != nil {\n\t\tmeanTime = *cm.MeanTimeBetweenKillsInWorkDays\n\t}\n\n\tif cm.MinTimeBetweenKillsInWorkDays != nil {\n\t\tminTime = *cm.MinTimeBetweenKillsInWorkDays\n\t}\n\n\t// Exceptions must have a non-blank region field\n\tfor _, exception := range cm.Exceptions {\n\t\tif exception.Account == \"\" {\n\t\t\treturn nil, errors.New(\"missing account field in exception\")","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/fromjson.go#L124-L160","documentation":"spinnaker.FromJSON parses a Spinnaker JSON app representation into a chaosmonkey.AppConfig. When the app is enabled (\"enabled\": true), the \"grouping\" field must be one of \"app\", \"stack\", or \"cluster\"; any other value (including an empty string) causes this error. If the app is disabled, an unspecified/invalid grouping is tolerated and the default (cluster) is used.","triggerScenarios":"Calling FromJSON on JSON where attributes.chaosMonkey.enabled is true and attributes.chaosMonkey.grouping is absent, empty, misspelled (e.g. \"clusters\", \"App\" with capital), or otherwise not one of app|stack|cluster.","commonSituations":"Hand-edited Spinnaker app attribute JSON omitting \"grouping\" while enabling Chaos Monkey; case-sensitivity mistakes; UI/API versions that dropped or renamed the grouping field; typos in per-app overrides.","solutions":["Set \"grouping\" in attributes.chaosMonkey to one of \"app\", \"stack\", or \"cluster\" (values are lowercase and case-sensitive)","If the app should not have Chaos Monkey enabled, set \"enabled\": false — then grouping may be omitted","Check the JSON for typos/extra whitespace in the grouping value","If grouping is intentionally absent, upgrade the source system or default it before calling FromJSON"],"exampleFix":"// before\n{\n  \"chaosMonkey\": {\n    \"enabled\": true,\n    \"grouping\": \"clusters\"\n  }\n}\n// after\n{\n  \"chaosMonkey\": {\n    \"enabled\": true,\n    \"grouping\": \"cluster\"\n  }\n}","handlingStrategy":"validation","validationCode":"func validateGrouping(cmCfg map[string]interface{}) error {\n\tenabled, _ := cmCfg[\"enabled\"].(bool)\n\tif !enabled {\n\t\treturn nil\n\t}\n\tg, ok := cmCfg[\"grouping\"].(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"grouping is required when chaosMonkey is enabled\")\n\t}\n\tswitch g {\n\tcase \"app\", \"stack\", \"cluster\":\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid grouping %q: must be app, stack, or cluster\", g)\n\t}\n}","typeGuard":"func isKnownGrouping(s string) bool {\n\tswitch s {\n\tcase \"app\", \"stack\", \"cluster\":\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Always include \"grouping\" in chaosMonkey attributes whenever \"enabled\" is true","Use a schema/JSON validation (e.g. jsonschema) on app attributes before handing them to FromJSON","Remember values are case-sensitive lowercase: app|stack|cluster","Store canonical Chaos Monkey config templates rather than hand-editing JSON"],"tags":["go","config-parsing","validation","spinnaker"],"backgroundTag":"invalid-config-value","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}