{"record":{"id":"79007c2d512b6ed5","repo":"prestodb/presto","slug":"no-cpp-sidecars","errorCode":"NO_CPP_SIDECARS","errorMessage":"Expected exactly one coordinator sidecar, but found none","messagePattern":"Expected exactly one coordinator sidecar, but found none","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-main-base/src/main/java/com/facebook/presto/connector/ConnectorAwareNodeManager.java","lineNumber":71,"sourceCode":"\n    @Override\n    public Set<Node> getWorkerNodes()\n    {\n        return ImmutableSet.copyOf(nodeManager.getActiveConnectorNodes(connectorId));\n    }\n\n    @Override\n    public Node getCurrentNode()\n    {\n        return nodeManager.getCurrentNode();\n    }\n\n    @Override\n    public Node getSidecarNode()\n    {\n        Set<InternalNode> coordinatorSidecars = nodeManager.getCoordinatorSidecars();\n        if (coordinatorSidecars.isEmpty()) {\n            throw new PrestoException(NO_CPP_SIDECARS, \"Expected exactly one coordinator sidecar, but found none\");\n        }\n        return coordinatorSidecars.stream()\n                .skip(new Random().nextInt(coordinatorSidecars.size()))\n                .findFirst()\n                .get();\n    }\n\n    @Override\n    public String getEnvironment()\n    {\n        return environment;\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":85,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/connector/ConnectorAwareNodeManager.java#L53-L85","documentation":"ConnectorAwareNodeManager.getSidecarNode expects exactly one coordinator 'sidecar' node (a C++-native sidecar process attached to the coordinator) registered in the node manager. When the set of coordinator sidecars is empty it throws PrestoException with NO_CPP_SIDECARS, because a random sidecar node is required for connector operations routed to native workers. It reflects a deployment/topology problem, not bad user input.","triggerScenarios":"A connector session or plan that needs a C++ sidecar node calls getSidecarNode() while the coordinator has no registered sidecars (nodeManager.getCoordinatorSidecars() returns empty), e.g. native worker discovery not yet completed or sidecar registration disabled.","commonSituations":"Clusters launched without the C++ native sidecar process; misconfigured node registration/discovery so sidecars never join; querying a sidecar-required connector on a JVM-only coordinator; transient timing where queries start before the sidecar registers.","solutions":["Verify the coordinator C++ sidecar process is running and registered with the discovery server.","Check discovery/node-manager configuration (node.environment, discovery.uri) so the sidecar joins the same cluster as the coordinator.","Confirm the connector in use actually requires sidecars; if not, avoid invoking the code path or disable the native path.","Add retry/startup-gating so queries wait until the coordinator sidecar is registered."],"exampleFix":"// before (assumes sidecar exists)\nNode node = nodeManager.getSidecarNode();\n// after\nSet<InternalNode> sidecars = ...getCoordinatorSidecars();\nif (sidecars.isEmpty()) {\n    log.warn(\"No coordinator sidecar registered; falling back to JVM execution\");\n    return jvmFallback();\n}","handlingStrategy":"fallback","validationCode":"boolean sidecarReady = /* discovery query */ !nodeManager.getCoordinatorSidecars().isEmpty();\nif (!sidecarReady) throw new IllegalStateException(\"No coordinator sidecar registered; check native worker deployment\");","typeGuard":null,"tryCatchPattern":"try { node = connectorAwareNodeManager.getSidecarNode(); }\ncatch (PrestoException e) { if (\"NO_CPP_SIDECARS\".equals(e.getErrorCode().getName())) { node = fallbackJvmNode(); } else throw e; }","preventionTips":["Ensure the C++ sidecar process ships and starts with the coordinator","Gate query intake on node discovery having registered the sidecar","Monitor coordinator sidecar registration with a health check","Match node.environment and discovery.uri across coordinator and sidecar"],"tags":["deployment","native-worker","topology"],"backgroundTag":"missing-sidecar-node","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"}