googleapis/mcp-toolbox · error

failed to count relationships: %w

Error message

failed to count relationships: %w

What it means

Task-failure wrap inside the concurrent schema extraction: the 'counts' task's relationship count query ('MATCH ()-[r]->() RETURN count(r)') failed, aborting the whole schema extraction.

Source

Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:216

				mu.Lock()
				defer mu.Unlock()
				schema.Relationships = relationships
				for _, relationship := range relationships {
					schema.Statistics.RelationshipsByType[relationship.Type] = relationship.Count
				}
				return nil
			},
		},
		{
			name: "counts",
			fn: func() error {
				nodeResult, err := runReadQuery(ctx, source, "MATCH (n) RETURN count(n) AS count")
				if err != nil {
					return fmt.Errorf("failed to count nodes: %w", err)
				}
				edgeResult, err := runReadQuery(ctx, source, "MATCH ()-[r]->() RETURN count(r) AS count")
				if err != nil {
					return fmt.Errorf("failed to count relationships: %w", err)
				}
				mu.Lock()
				defer mu.Unlock()
				schema.GraphInfo.NodeCount = helpers.FirstRowInt64(nodeResult)
				schema.GraphInfo.EdgeCount = helpers.FirstRowInt64(edgeResult)
				schema.Statistics.TotalNodes = schema.GraphInfo.NodeCount
				schema.Statistics.TotalRelationships = schema.GraphInfo.EdgeCount
				return nil
			},
		},
		{
			name: "indexes",
			fn: func() error {
				result, err := runReadQuery(ctx, source, "CALL db.indexes()")
				if err != nil {
					return fmt.Errorf("failed to list indexes: %w", err)
				}
				mu.Lock()

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Inspect the wrapped error for the underlying FalkorDB failure
  2. Check graph reachability and server health
  3. Retry the schema extraction once the server is healthy
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:216 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/f1ee45eb73324ce8. Report an issue: GitHub.