{"record":{"id":"8d344020de0e646d","repo":"googleapis/mcp-toolbox","slug":"unable-to-execute-query-w-8d3440","errorCode":null,"errorMessage":"unable to execute query: %w","messagePattern":"unable to execute query: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/arcadedb/arcadedb.go","lineNumber":144,"sourceCode":"func (s *Source) RunCypher(ctx context.Context, cypherStr string, params map[string]any, readOnly, dryRun bool) (any, error) {\n\tcf := sourceClassifier.Classify(cypherStr)\n\tif cf.Error != nil {\n\t\treturn nil, cf.Error\n\t}\n\n\tif cf.Type == classifier.WriteQuery && readOnly {\n\t\treturn nil, fmt.Errorf(\"this tool is read-only and cannot execute write queries\")\n\t}\n\n\tif dryRun {\n\t\tcypherStr = \"EXPLAIN \" + cypherStr\n\t}\n\n\tconfig := neo4j.ExecuteQueryWithDatabase(s.ArcadeDBDatabase())\n\tresults, err := neo4j.ExecuteQuery[*neo4j.EagerResult](ctx, s.ArcadeDBDriver(), cypherStr, params,\n\t\tneo4j.EagerResultTransformer, config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to execute query: %w\", err)\n\t}\n\n\tif dryRun {\n\t\tsummary := results.Summary\n\t\tplan := summary.Plan()\n\t\tif plan == nil {\n\t\t\treturn nil, fmt.Errorf(\"dry-run produced no execution plan\")\n\t\t}\n\n\t\tnode, incomplete, operatorCount := buildPlanNode(plan)\n\t\tif operatorCount == 0 {\n\t\t\treturn nil, fmt.Errorf(\"dry-run produced an empty execution plan\")\n\t\t}\n\n\t\texecPlan := map[string]any{\n\t\t\t\"queryType\":     cf.Type.String(),\n\t\t\t\"statementType\": summary.QueryType(),\n\t\t}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/arcadedb/arcadedb.go#L126-L162","documentation":"This wraps a failure from neo4j.ExecuteQuery, the Bolt call that runs the Cypher statement on ArcadeDB. Because the driver already passed VerifyConnectivity, this error surfaces at query time: the session/query itself failed — network drop, authentication, Cypher syntax error, missing database, or timeout. The wrapped cause contains the server or transport message.","triggerScenarios":"Calling RunCypher when the ArcadeDB server rejects or fails the query: invalid Cypher syntax, referencing a non-existent database name, connection dropped mid-query, credentials revoked, or server-side error during execution.","commonSituations":"Typo'd Cypher syntax; querying a database name that doesn't exist in ArcadeDB; server restarted or network flake during the call; parameter type mismatches; ArcadeDB version lacking support for certain Cypher features.","solutions":["Read the wrapped cause after 'unable to execute query:' — it names the server/transport failure.","Validate the Cypher statement directly against ArcadeDB (e.g. via the web console) to isolate syntax issues.","Confirm the configured database name exists on the server.","Check server logs and connectivity if the cause is a transport/timeout error, then retry."],"exampleFix":"// before: invalid Cypher\nMATCH (n:Person RETURN n\n// after\nMATCH (n:Person) RETURN n","handlingStrategy":"try-catch","validationCode":"if strings.Count(cypher, \"(\") != strings.Count(cypher, \")\") {\n    return errors.New(\"unbalanced parentheses in Cypher query\")\n}","typeGuard":null,"tryCatchPattern":"results, err := neo4j.ExecuteQuery[*neo4j.EagerResult](ctx, driver, cypher, params, transformer, cfg)\nif err != nil {\n    var neo4jErr *neo4j.Neo4jError\n    if errors.As(err, &neo4jErr) && neo4jErr.Classification() == \"TransientError\" {\n        return retry(ctx, cypher) // retry transient failures\n    }\n    return fmt.Errorf(\"query failed: %w\", err)\n}","preventionTips":["Validate Cypher syntax against the server console before automation.","Confirm the configured database name exists on the ArcadeDB server.","Add retry-with-backoff for transient/transport errors only.","Pin compatible driver and ArcadeDB versions to avoid protocol mismatches."],"tags":["arcadedb","cypher","query-execution","network"],"backgroundTag":"query-execution-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"}