{"record":{"id":"83597e15f726856d","repo":"weaviate/weaviate","slug":"invalid-args-given-for-q-reindex-task","errorCode":null,"errorMessage":"invalid args given for %q reindex task","messagePattern":"invalid args given for %q reindex task","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/migrator.go","lineNumber":1090,"sourceCode":"\terrs := errorcompounder.New()\n\terrs.Add(m.doInvertedReindex(ctx, taskNamesWithArgs))\n\terrs.Add(m.doInvertedIndexMissingTextFilterable(ctx, taskNamesWithArgs))\n\treturn errs.ToError()\n}\n\nfunc (m *Migrator) doInvertedReindex(ctx context.Context, taskNamesWithArgs map[string]any) error {\n\ttasks := map[string]ShardInvertedReindexTask{}\n\tfor name, args := range taskNamesWithArgs {\n\t\tswitch name {\n\t\tcase \"ShardInvertedReindexTaskSetToRoaringSet\":\n\t\t\ttasks[name] = &ShardInvertedReindexTaskSetToRoaringSet{}\n\t\tcase \"ShardInvertedReindexTask_SpecifiedIndex\":\n\t\t\tif args == nil {\n\t\t\t\treturn fmt.Errorf(\"no args given for %q reindex task\", name)\n\t\t\t}\n\t\t\targsMap, ok := args.(map[string][]string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"invalid args given for %q reindex task\", name)\n\t\t\t}\n\t\t\tclassNamesWithPropertyNames := map[string]map[string]struct{}{}\n\t\t\tfor class, props := range argsMap {\n\t\t\t\tclassNamesWithPropertyNames[class] = map[string]struct{}{}\n\t\t\t\tfor _, prop := range props {\n\t\t\t\t\tclassNamesWithPropertyNames[class][prop] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttasks[name] = &ShardInvertedReindexTask_SpecifiedIndex{\n\t\t\t\tclassNamesWithPropertyNames: classNamesWithPropertyNames,\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(tasks) == 0 {\n\t\treturn nil\n\t}\n","sourceCodeStart":1072,"sourceCodeEnd":1108,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/migrator.go#L1072-L1108","documentation":"doInvertedReindex expects the args for 'ShardInvertedReindexTask_SpecifiedIndex' to be of type map[string][]string (class name -> property names). If args is non-nil but of any other type, the type assertion fails and this error is returned. It is a defensive type check on reindex task input.","triggerScenarios":"Calling InvertedReindex with args for the specified-index task typed as something other than map[string][]string — e.g. map[string]string, []string, or a struct.","commonSituations":"Refactored internal tooling passing the wrong shape; JSON-decoded args decoded into a generic map[string]interface{} and passed through unchanged; mixing up this task's arg format with another task's.","solutions":["Change the args value to map[string][]string where the key is the class name and the slice lists property names to reindex.","If the value came from JSON decoding, convert it: iterate map[string]interface{} and assert each value to []interface{} before building the required map.","Re-run InvertedReindex with the correctly typed args."],"exampleFix":"// before\nargs := map[string]string{\"Article\": \"description\"}\n// after\nargs := map[string][]string{\"Article\": {\"description\"}}","handlingStrategy":"type-guard","validationCode":"args, ok := rawArgs.(map[string][]string)\nif !ok {\n    return fmt.Errorf(\"specified-index args must be map[string][]string, got %T\", rawArgs)\n}","typeGuard":"func asClassPropsArgs(v interface{}) (map[string][]string, bool) {\n    m, ok := v.(map[string][]string)\n    return m, ok\n}","tryCatchPattern":null,"preventionTips":["Keep args in their typed form (map[string][]string) end-to-end; avoid decoding into interface{} and passing through.","Add a unit test asserting the arg type expected by doInvertedReindex.","Document the arg schema next to the task-name constants."],"tags":["reindex","inverted-index","type-mismatch"],"backgroundTag":"invalid-argument-value","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}