{"record":{"id":"66ab02b3f827f8b7","repo":"weaviate/weaviate","slug":"marshal-collections-count-response-namespace-q","errorCode":null,"errorMessage":"marshal collections count response (namespace=%q): %w","messagePattern":"marshal collections count response \\(namespace=%q\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cluster/schema/manager_query.go","lineNumber":69,"sourceCode":"\t}\n\treturn payload, nil\n}\n\nfunc (sm *SchemaManager) QueryCollectionsCount(req *cmd.QueryRequest) ([]byte, error) {\n\t// Empty SubCommand keeps the historical cluster-global behavior.\n\tnamespace := \"\"\n\tif len(req.SubCommand) > 0 {\n\t\tsubCommand := cmd.QueryCollectionsCountRequest{}\n\t\tif err := json.Unmarshal(req.SubCommand, &subCommand); err != nil {\n\t\t\treturn []byte{}, fmt.Errorf(\"%w: unmarshal collections count request: %w\", ErrBadRequest, err)\n\t\t}\n\t\tnamespace = subCommand.Namespace\n\t}\n\n\tresponse := cmd.QueryCollectionsCountResponse{Count: sm.schema.CollectionsCount(namespace)}\n\tpayload, err := json.Marshal(&response)\n\tif err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"marshal collections count response (namespace=%q): %w\", namespace, err)\n\t}\n\treturn payload, nil\n}\n\nfunc (sm *SchemaManager) QueryTenants(req *cmd.QueryRequest) ([]byte, error) {\n\t// Validate that the subcommand is the correct type\n\tsubCommand := cmd.QueryTenantsRequest{}\n\tif err := json.Unmarshal(req.SubCommand, &subCommand); err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"%w: %w\", ErrBadRequest, err)\n\t}\n\n\t// Read the tenants\n\ttenants, err := sm.schema.getTenants(subCommand.Class, subCommand.Tenants)\n\tif err != nil {\n\t\treturn []byte{}, fmt.Errorf(\"could not get tenants: %w\", err)\n\t}\n\n\t// Build the response, marshal and return","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/cluster/schema/manager_query.go#L51-L87","documentation":"Serialising the collections-count response (which is just an integer count plus namespace context) failed. As with other cluster-query marshal failures this signals corrupted or non-serializable internal state rather than a user payload problem.","triggerScenarios":"Thrown at cluster/schema/manager_query.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as an internal error: capture logs and the namespace in the message","Restart the affected node to rebuild query state if it persists","Report upstream with the namespace value that triggered it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}