{"record":{"id":"4543ad3178159ba8","repo":"prestodb/presto","slug":"arrow-flight-client-error","errorCode":"ARROW_FLIGHT_CLIENT_ERROR","errorMessage":"Error creating flight client: ","messagePattern":"Error creating flight client: ","errorType":"error_code","errorClass":"ArrowException","httpStatus":null,"severity":"error","filePath":"presto-base-arrow-flight/src/main/java/com/facebook/plugin/arrow/BaseArrowFlightClientHandler.java","lineNumber":99,"sourceCode":"                flightClientBuilder.trustedCertificates(trustedCertificate.get()).useTls();\n            }\n            if (config.getFlightClientSSLCertificate() != null && config.getFlightClientSSLKey() != null) {\n                clientCertificate = Optional.of(newInputStream(Paths.get(config.getFlightClientSSLCertificate())));\n                clientKey = Optional.of(newInputStream(Paths.get(config.getFlightClientSSLKey())));\n                flightClientBuilder.clientCertificate(clientCertificate.get(), clientKey.get()).useTls();\n            }\n\n            return flightClientBuilder.build();\n        }\n        catch (Exception e) {\n            if (e.getCause() instanceof InvalidKeyException) {\n                throw new ArrowException(ARROW_FLIGHT_INVALID_KEY_ERROR, \"Error creating flight client, invalid key file: \" + e.getMessage(), e);\n            }\n            else if (e.getCause() instanceof CertificateException) {\n                throw new ArrowException(ARROW_FLIGHT_INVALID_CERT_ERROR, \"Error creating flight client, invalid certificate file: \" + e.getMessage(), e);\n            }\n            else {\n                throw new ArrowException(ARROW_FLIGHT_CLIENT_ERROR, \"Error creating flight client: \" + e.getMessage(), e);\n            }\n        }\n        finally {\n            if (trustedCertificate.isPresent()) {\n                try {\n                    trustedCertificate.get().close();\n                }\n                catch (IOException e) {\n                    logger.error(\"Error closing input stream for server certificate\", e);\n                }\n            }\n            if (clientCertificate.isPresent()) {\n                try {\n                    clientCertificate.get().close();\n                }\n                catch (IOException e) {\n                    logger.error(\"Error closing input stream for client certificate\", e);\n                }","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-base-arrow-flight/src/main/java/com/facebook/plugin/arrow/BaseArrowFlightClientHandler.java#L81-L117","documentation":"The fallback branch of createFlightClient: any exception during FlightClient construction that is neither InvalidKeyException nor CertificateException is wrapped as ArrowException(ARROW_FLIGHT_CLIENT_ERROR) with 'Error creating flight client: <msg>'. This covers transport-level construction failures such as unresolved host, bad target string, or unsupported channel options.","triggerScenarios":"Calling createFlightClient when building the gRPC/Arrow Flight channel fails for reasons other than TLS key/cert parsing: DNS resolution failure, invalid host/port config, missing Location/target scheme, or generic runtime errors in the builder.","commonSituations":"Wrong host/port or DNS name for the Flight server in catalog properties; server host unresolvable from Presto workers; missing 'grpc+tls'/'grpc+tcp' scheme in the location; network policy blocking egress; corrupted auth token configuration.","solutions":["Read the cause message for the transport failure (host, port, scheme).","Fix host/port/scheme in catalog properties and verify DNS from each worker.","Test connectivity: `nc -zv <host> <port>` to the Flight server.","Confirm the required Flight client libraries are on the classpath (no version conflicts).","If it's actually a TLS problem misclassified here, fix key/cert config per the specific errors."],"exampleFix":"# before\narrow.flight.location=server.internal\n# after\narrow.flight.location=grpc+tls://server.internal:32010","handlingStrategy":"try-catch","validationCode":"// Check reachability before creating the client\nString host = config.getHost(); int port = config.getPort();\ntry (java.net.Socket s = new java.net.Socket()) {\n    s.connect(new java.net.InetSocketAddress(host, port), 3000); // throws if unreachable\n}","typeGuard":null,"tryCatchPattern":"try {\n    FlightClient client = handler.createFlightClient();\n} catch (ArrowException e) {\n    if (e.getErrorCode().getCode() == ARROW_FLIGHT_CLIENT_ERROR.getCode()) {\n        // inspect e.getCause(): fix host/port/scheme/DNS and retry\n    }\n    throw e;\n}","preventionTips":["Use fully-qualified hostnames with the correct grpc+tls:// or grpc+tcp:// scheme.","Pre-flight DNS and port checks from every Presto worker.","Pin Arrow Flight/gRPC library versions to avoid classpath conflicts.","Validate location config in a staging catalog before production rollout."],"tags":["presto","arrow-flight","grpc","client","network"],"backgroundTag":"flight-client-creation-failed","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}