{"record":{"id":"62072554128c9df0","repo":"projectdiscovery/nuclei","slug":"keys-must-be-string-or-interface-got-string","errorCode":null,"errorMessage":"keys must be []string or []interface{}, got string","messagePattern":"keys must be \\[\\]string or \\[\\]interface(.+?), got string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/redis/redis.go","lineNumber":221,"sourceCode":"\t}\n\n\t// Convert interface{} to []string for keys (handle backwards compatibility)\n\tkeysSlice := []string{}\n\tif keys != nil {\n\t\tswitch v := keys.(type) {\n\t\tcase []string:\n\t\t\tkeysSlice = v\n\t\tcase []interface{}:\n\t\t\tkeysSlice = make([]string, 0, len(v))\n\t\t\tfor _, item := range v {\n\t\t\t\tkeysSlice = append(keysSlice, fmt.Sprintf(\"%v\", item))\n\t\t\t}\n\t\tcase string:\n\t\t\t// the goja runtime zero-fills omitted trailing JS arguments with\n\t\t\t// the previous parameter's type, so a 4-arg call (old signature)\n\t\t\t// delivers \"\" here: treat it as no keys (backwards compat)\n\t\t\tif v != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"keys must be []string or []interface{}, got string\")\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"keys must be []string or []interface{}, got %T\", keys)\n\t\t}\n\t}\n\n\t// Convert interface{} args to []interface{} for Eval (handle backwards\n\t// compatibility). Non-string items (numbers, booleans from JavaScript)\n\t// are stringified rather than dropped: Redis ARGV values are always\n\t// bulk strings on the Lua side, so \"123\"/\"true\" match JS expectations.\n\targsInterface := []interface{}{}\n\tif args != nil {\n\t\tswitch v := args.(type) {\n\t\tcase []string:\n\t\t\targsInterface = make([]interface{}, len(v))\n\t\t\tfor i, arg := range v {\n\t\t\t\targsInterface[i] = arg\n\t\t\t}","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/redis/redis.go#L203-L239","documentation":"Error \"keys must be []string or []interface{}, got string\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/js/libs/redis/redis.go:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}