{"record":{"id":"675207fa5546cc6c","repo":"googleapis/mcp-toolbox","slug":"failed-to-count-label-q-w","errorCode":null,"errorMessage":"failed to count label %q: %w","messagePattern":"failed to count label %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/falkordb/falkordbschema/falkordbschema.go","lineNumber":295,"sourceCode":"\n\treturn schema, nil\n}\n\n// extractNodeLabels lists the node labels and derives each label's count and\n// property shapes from a sample of nodes.\nfunc (t Tool) extractNodeLabels(ctx context.Context, source compatibleSource) ([]types.NodeLabel, error) {\n\tlabelsResult, err := runReadQuery(ctx, source, \"CALL db.labels()\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list labels: %w\", err)\n\t}\n\n\tvar nodeLabels []types.NodeLabel\n\tfor _, label := range helpers.FirstColumnStrings(labelsResult) {\n\t\tescaped := escapeIdentifier(label)\n\n\t\tcountResult, err := runReadQuery(ctx, source, fmt.Sprintf(\"MATCH (n:`%s`) RETURN count(n) AS count\", escaped))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to count label %q: %w\", label, err)\n\t\t}\n\n\t\tsampleResult, err := runReadQuery(ctx, source, fmt.Sprintf(\"MATCH (n:`%s`) RETURN n LIMIT %d\", escaped, t.Cfg.SampleSize))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to sample label %q: %w\", label, err)\n\t\t}\n\t\taccumulator := make(map[string]map[string]bool)\n\t\tfor _, row := range helpers.Rows(sampleResult) {\n\t\t\tnode, ok := row[\"n\"].(map[string]any)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif properties, ok := node[\"properties\"].(map[string]any); ok {\n\t\t\t\thelpers.MergeProperties(accumulator, properties)\n\t\t\t}\n\t\t}\n\n\t\tnodeLabels = append(nodeLabels, types.NodeLabel{","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/falkordb/falkordbschema/falkordbschema.go#L277-L313","documentation":"Wrap inside extractNodeLabels: the per-label count query ('MATCH (n:`<label>`) RETURN count(n)') failed for the named label, typically because the label disappeared between listing and counting or contains characters that break the backtick quoting.","triggerScenarios":"Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the schema extraction if the graph is being mutated concurrently","Check the label for unusual characters and rename it if it cannot be safely quoted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}