prestodb/presto · critical · PrestoException

NO_CPP_SIDECARS

NO_CPP_SIDECARS

Error message

Expected exactly one coordinator sidecar, but found none

What it means

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.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/connector/ConnectorAwareNodeManager.java:71

    @Override
    public Set<Node> getWorkerNodes()
    {
        return ImmutableSet.copyOf(nodeManager.getActiveConnectorNodes(connectorId));
    }

    @Override
    public Node getCurrentNode()
    {
        return nodeManager.getCurrentNode();
    }

    @Override
    public Node getSidecarNode()
    {
        Set<InternalNode> coordinatorSidecars = nodeManager.getCoordinatorSidecars();
        if (coordinatorSidecars.isEmpty()) {
            throw new PrestoException(NO_CPP_SIDECARS, "Expected exactly one coordinator sidecar, but found none");
        }
        return coordinatorSidecars.stream()
                .skip(new Random().nextInt(coordinatorSidecars.size()))
                .findFirst()
                .get();
    }

    @Override
    public String getEnvironment()
    {
        return environment;
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the coordinator C++ sidecar process is running and registered with the discovery server.
  2. Check discovery/node-manager configuration (node.environment, discovery.uri) so the sidecar joins the same cluster as the coordinator.
  3. Confirm the connector in use actually requires sidecars; if not, avoid invoking the code path or disable the native path.
  4. Add retry/startup-gating so queries wait until the coordinator sidecar is registered.

Example fix

// before (assumes sidecar exists)
Node node = nodeManager.getSidecarNode();
// after
Set<InternalNode> sidecars = ...getCoordinatorSidecars();
if (sidecars.isEmpty()) {
    log.warn("No coordinator sidecar registered; falling back to JVM execution");
    return jvmFallback();
}
Defensive patterns

Strategy: fallback

Validate before calling

boolean sidecarReady = /* discovery query */ !nodeManager.getCoordinatorSidecars().isEmpty();
if (!sidecarReady) throw new IllegalStateException("No coordinator sidecar registered; check native worker deployment");

Try / catch

try { node = connectorAwareNodeManager.getSidecarNode(); }
catch (PrestoException e) { if ("NO_CPP_SIDECARS".equals(e.getErrorCode().getName())) { node = fallbackJvmNode(); } else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/79007c2d512b6ed5. Report an issue: GitHub.