{"record":{"id":"089710c6fd0e4ddc","repo":"kubernetes/kops","slug":"expected-slice-at-q-got-t","errorCode":null,"errorMessage":"expected slice at %q, got %T","messagePattern":"expected slice at %q, got %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/sqs.go","lineNumber":159,"sourceCode":"\t\tTags:                   intersectSQSTags(tags.Tags, q.Tags),\n\t}\n\n\t// Avoid flapping\n\tq.ARN = actual.ARN\n\n\treturn actual, nil\n}\n\ntype JSONObject map[string]any\n\nfunc (j *JSONObject) Slice(key string) ([]any, bool, error) {\n\tv, found := (*j)[key]\n\tif !found {\n\t\treturn nil, false, nil\n\t}\n\ts, ok := v.([]any)\n\tif !ok {\n\t\treturn nil, false, fmt.Errorf(\"expected slice at %q, got %T\", key, v)\n\t}\n\treturn s, true, nil\n}\n\nfunc (j *JSONObject) Object(key string) (JSONObject, bool, error) {\n\tv, found := (*j)[key]\n\tif !found {\n\t\treturn nil, false, nil\n\t}\n\tm, ok := v.(JSONObject)\n\tif !ok {\n\t\treturn nil, false, fmt.Errorf(\"expected object at %q, got %T\", key, v)\n\t}\n\treturn m, true, nil\n}\n\n// normalizePolicy sorts the Service principals in the policy, so that we can compare policies more easily.\nfunc normalizePolicy(policy map[string]interface{}) error {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/sqs.go#L141-L177","documentation":"JSONObject.Slice found the key present in the SQS policy document but holding a non-array value; during policy normalization kOps expected a JSON array at that position (e.g. Statement/Action) and got another type.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/sqs.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the policy document so the referenced key is a JSON array (e.g. \"Action\": [ ... ])","Ensure Statement blocks follow the expected IAM policy structure"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}