{"record":{"id":"36534039cdba4bfe","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-relationship-types-w","errorCode":null,"errorMessage":"failed to list relationship types: %w","messagePattern":"failed to list relationship types: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/falkordb/falkordbschema/falkordbschema.go","lineNumber":329,"sourceCode":"\t\t}\n\n\t\tnodeLabels = append(nodeLabels, types.NodeLabel{\n\t\t\tName:       label,\n\t\t\tCount:      helpers.FirstRowInt64(countResult),\n\t\t\tProperties: helpers.CollectProperties(accumulator),\n\t\t})\n\t}\n\thelpers.SortNodeLabels(nodeLabels)\n\treturn nodeLabels, nil\n}\n\n// extractRelationships lists the relationship types and derives each type's\n// count, most common connectivity pattern, and property shapes from a sample\n// of relationships.\nfunc (t Tool) extractRelationships(ctx context.Context, source compatibleSource) ([]types.Relationship, error) {\n\ttypesResult, err := runReadQuery(ctx, source, \"CALL db.relationshipTypes()\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list relationship types: %w\", err)\n\t}\n\n\tvar relationships []types.Relationship\n\tfor _, relType := range helpers.FirstColumnStrings(typesResult) {\n\t\tescaped := escapeIdentifier(relType)\n\n\t\tcountResult, err := runReadQuery(ctx, source, fmt.Sprintf(\"MATCH ()-[r:`%s`]->() RETURN count(r) AS count\", escaped))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to count relationship type %q: %w\", relType, err)\n\t\t}\n\n\t\tsampleResult, err := runReadQuery(ctx, source, fmt.Sprintf(\n\t\t\t\"MATCH (a)-[r:`%s`]->(b) RETURN labels(a) AS startLabels, labels(b) AS endLabels, r LIMIT %d\", escaped, t.Cfg.SampleSize))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to sample relationship type %q: %w\", relType, err)\n\t\t}\n\n\t\taccumulator := make(map[string]map[string]bool)","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/falkordb/falkordbschema/falkordbschema.go#L311-L347","documentation":"This error wraps any failure from the Cypher read query 'CALL db.relationshipTypes()' while the falkordbschema tool builds its relationship inventory via extractRelationships. It is thrown when the FalkorDB/graph server cannot execute the procedure call (connection failure, auth failure, or query error). The wrapped cause (%w) carries the underlying driver error.","triggerScenarios":"extractRelationships calls runReadQuery with 'CALL db.relationshipTypes()' and the query returns an error: server unreachable, connection refused, bad credentials, database unavailable, or the procedure is unsupported by the graph backend.","commonSituations":"FalkorDB container not running or wrong host/port in the source config; Redis/FalkorDB module not loaded; auth credentials wrong; invoking the falkordb-schema tool against a database that lacks the db.relationshipTypes procedure (older module version).","solutions":["Verify the FalkorDB source is reachable: check host, port, and credentials in the source config and test with a simple query.","Ensure the FalkorDB/RedisGraph module version supports the db.relationshipTypes procedure; upgrade the server if not.","Inspect the wrapped cause in the error message (%w) to identify the driver-level failure (network vs auth vs query).","Retry after restoring the server; if transient network issues, re-run the schema tool."],"exampleFix":"// before: schema tool fails at startup\nsource: my-graph\n// after: corrected source config\nsource:\n  kind: falkordb\n  address: localhost:6379\n  # ensure server is running: docker run -p 6379:6379 falkordb/falkordb","handlingStrategy":"validation","validationCode":"// Before invoking the schema tool, verify the graph is reachable and supports the procedure\nconn, err := client.Dial(ctx) // or run a smoke query\nif err != nil { return fmt.Errorf(\"FalkorDB unavailable: %w\", err) }\nres, err := conn.Query(\"RETURN 1\")\nif err != nil { return fmt.Errorf(\"smoke query failed: %w\", err) }","typeGuard":"func isGraphProcUnavailable(err error) bool {\n    return err != nil && strings.Contains(strings.ToLower(err.Error()), \"unknown procedure\")\n}","tryCatchPattern":"rels, err := tool.ExtractRelationships(ctx, src)\nif err != nil {\n    var qErr *driverErr\n    if errors.As(err, &qErr) && isGraphProcUnavailable(qErr) {\n        // upgrade FalkorDB module or use fallback schema discovery\n    }\n    return err\n}","preventionTips":["Health-check the FalkorDB endpoint before running schema extraction.","Pin a module version that supports db.relationshipTypes.","Keep connection credentials in env, validated at startup.","Add timeouts to read queries."],"tags":["falkordb","graph","query-failure","network"],"backgroundTag":"graph-procedure-call-failed","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"}