{"record":{"id":"2d59075823bd037d","repo":"Netflix/chaosmonkey","slug":"s-unexpected-type-t","errorCode":null,"errorMessage":"%s: unexpected type %T","messagePattern":"(.+?): unexpected type %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/monkey.go","lineNumber":326,"sourceCode":"}\n\n// ErrorCounter returns the names of the backend implementions for\n// error counters. Intended for monitoring/alerting.\nfunc (m *Monkey) ErrorCounter() string {\n\treturn m.v.GetString(param.ErrorCounter)\n}\n\nfunc (m *Monkey) getStringSlice(key string) ([]string, error) {\n\t// This could be encoded natively as a list of strings, or as a string that\n\t// represents a list of strings, so we need to handle both cases\n\tt := m.v.Get(key)\n\tif t == nil {\n\t\treturn nil, fmt.Errorf(\"%s not specified\", param.Accounts)\n\t}\n\n\tswitch t := t.(type) {\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: unexpected type %T\", param.Accounts, t)\n\tcase []string: // When set explicitly in code\n\t\treturn t, nil\n\tcase []interface{}: // When reading from config file\n\t\treturn toStrings(t)\n\tcase string: // When reading from prana, which uses string encoding\n\t\t// Convert to list of strings\n\t\tvar result []string\n\t\terr := json.Unmarshal([]byte(t), &result)\n\t\treturn result, err\n\t}\n}\n\n// SpinnakerEndpoint returns the spinnaker endpoint\nfunc (m *Monkey) SpinnakerEndpoint() string {\n\treturn m.v.GetString(param.SpinnakerEndpoint)\n}\n\n// SpinnakerCertificate retunrs a path to a .p12 file that contains a TLS cert","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/config/monkey.go#L308-L344","documentation":"Type guard in config.Monkey.getStringSlice: the config value for the key is neither a []interface{} nor a string, so the switch falls to default. Typical culprits are TOML integers/booleans/tables where a list or comma-separated string was expected.","triggerScenarios":"Thrown at config/monkey.go:326 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the config file so the key holds a TOML array of strings or a single comma-separated string","Use the %T in the message to identify the actual type stored and correct the encoding"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}