Netflix/chaosmonkey · error
'attributes.chaosMonkey' field missing
Error message
'attributes.chaosMonkey' field missing
What it means
fromJSON requires attributes.chaosMonkey to be present inside the Spinnaker payload. When the 'attributes' object exists but its chaosMonkey member is nil, there is no chaos monkey configuration embedded for this application, so fromJSON cannot build an AppConfig and returns this error.
Source
Thrown at spinnaker/fromjson.go:106
// "region": "*",
// "detail": "*"
// }
// ]
// }
func fromJSON(js []byte) (*chaosmonkey.AppConfig, error) {
parsed := new(parsedJSON)
err := json.Unmarshal(js, parsed)
if err != nil {
return nil, errors.Wrap(err, "json unmarshal failed")
}
if parsed.Attributes == nil {
return nil, errors.New("'attributes' field missing")
}
if parsed.Attributes.ChaosMonkey == nil {
return nil, errors.New("'attributes.chaosMonkey' field missing")
}
cm := parsed.Attributes.ChaosMonkey
if cm.Enabled == nil {
return nil, errors.New("'attributes.chaosMonkey.enabled' field missing")
}
// Check if mean time between kills is missing.
// If not enabled, it's ok if it's missing
if *cm.Enabled && cm.MeanTimeBetweenKillsInWorkDays == nil {
return nil, errors.New("attributes.chaosMonkey.meanTimeBetweenKillsInWorkDays missing")
}
if *cm.Enabled && cm.MinTimeBetweenKillsInWorkDays == nil {
return nil, errors.New("attributes.chaosMonkey.minTimeBetweenKillsInWorkDays missing")
}
View on GitHub (pinned to eaa28fb761)
Solutions
- Enroll the application in chaos monkey so attributes.chaosMonkey is written to Spinnaker
- Treat this error as 'app not enrolled' and skip the app rather than failing
- Double-check the application name passed to Get matches the enrolled app
Example fix
// before
appConfig, err := sp.Get(appName)
if err != nil { return err }
// after
appConfig, err := sp.Get(appName)
if errors.Is(err, errNoChaosMonkeyField) || err != nil && strings.Contains(err.Error(), "attributes.chaosMonkey") {
return nil // app not enrolled; skip
} Defensive patterns
Strategy: validation
Validate before calling
var probe struct {
Attributes *struct {
ChaosMonkey *json.RawMessage `json:"chaosMonkey"`
} `json:"attributes"`
}
if err := json.Unmarshal(body, &probe); err != nil { return err }
if probe.Attributes == nil || probe.Attributes.ChaosMonkey == nil {
return errNotEnrolled // skip app
} Type guard
func isChaosMonkeyConfigured(body []byte) bool {
var p struct {
Attributes struct {
ChaosMonkey *map[string]any `json:"chaosMonkey"`
} `json:"attributes"`
}
return json.Unmarshal(body, &p) == nil && p.Attributes.ChaosMonkey != nil
} Try / catch
cfg, err := sp.Get(app)
if err != nil {
if strings.Contains(err.Error(), "attributes.chaosMonkey' field missing") {
return nil // app not enrolled in chaos monkey; skip
}
return err
} Prevention
- Maintain a list of enrolled apps and only query those
- Treat this error as 'not enrolled' rather than a hard failure in batch jobs
- Audit app attributes after Spinnaker upgrades or migrations
When it happens
Trigger: Calling spinnaker.Get for an application whose Spinnaker attributes contain no chaosMonkey sub-object (chaos monkey never enabled/configured for that app in Spinnaker).
Common situations: Querying a newly created application that was never enrolled in chaos monkey; the chaosMonkey metadata was deleted from the app's Spinnaker attributes; fetching the wrong application name.
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
- 'attributes' field missing
- 'attributes.chaosMonkey.enabled' field missing
- attributes.chaosMonkey.meanTimeBetweenKillsInWorkDays missin
- attributes.chaosMonkey.minTimeBetweenKillsInWorkDays missing
- missing account field in exception
AI-assisted analysis of Netflix/chaosmonkey@eaa28fb761 (2026-09-03).
Data as JSON: /api/errors/4294d7ea5da65e98.
Report an issue: GitHub.