prestodb/presto · error · PrestoException

INVALID_ARGUMENTS

INVALID_ARGUMENTS

Error message

Failed to get catalog-scoped functions from sidecar for catalog '%s'

What it means

This error is thrown by NativeFunctionDefinitionProvider.getUdfDefinition when any exception occurs while fetching catalog-scoped UDF signatures from the native sidecar HTTP service. It deliberately does not fall back to the unfiltered endpoint, to avoid leaking functions across catalogs. The original exception is attached as the cause.

Source

Thrown at presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/functionNamespace/NativeFunctionDefinitionProvider.java:83

    public UdfFunctionSignatureMap getUdfDefinition(NodeManager nodeManager)
    {
        try {
            // Base endpoint: /v1/functions
            URI baseUri = getSidecarLocationOnStartup(
                    nodeManager, config.getSidecarNumRetries(), config.getSidecarRetryDelay().toMillis());
            // Catalog-filtered endpoint: /v1/functions/{catalog}
            URI catalogUri = HttpUriBuilder.uriBuilderFrom(baseUri).appendPath(catalogName).build();
            Request catalogRequest = prepareGet().setUri(catalogUri).build();
            Map<String, List<JsonBasedUdfFunctionMetadata>> nativeFunctionSignatureMap =
                    httpClient.execute(catalogRequest, createJsonResponseHandler(nativeFunctionSignatureMapJsonCodec));
            if (nativeFunctionSignatureMap == null) {
                return new UdfFunctionSignatureMap(ImmutableMap.of());
            }
            return new UdfFunctionSignatureMap(ImmutableMap.copyOf(nativeFunctionSignatureMap));
        }
        catch (Exception e) {
            // Do not fall back to unfiltered endpoint to avoid cross-catalog leakage.
            throw new PrestoException(INVALID_ARGUMENTS, String.format("Failed to get catalog-scoped functions from sidecar for catalog '%s'", catalogName), e);
        }
    }

    @VisibleForTesting
    public HttpClient getHttpClient()
    {
        return httpClient;
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the sidecar service is running and reachable (check sidecar.uri config, DNS, port).
  2. Inspect the cause exception in the stack trace to identify the underlying HTTP/parse failure.
  3. Confirm the catalog name exists and matches the catalog registered with the sidecar.
  4. Check sidecar server logs for errors on the catalog-scoped functions endpoint.
  5. Retry after confirming sidecar health; if persistent, redeploy/upgrade the sidecar to a compatible version.

Example fix

// before: sidecar.url pointing at wrong port
sidecar.uri=http://sidecar:7777
// after
sidecar.uri=http://native-sidecar.default.svc.cluster.local:8080
Defensive patterns

Strategy: fallback

Validate before calling

// check sidecar reachability before calling
HttpResponse health = httpClient.execute(new Request.Builder().setUri(sidecarUri + "/health").build());
if (health.getStatusCode() != 200) { fallbackToLocalFunctionMetadata(); }

Try / catch

try { udfMap = provider.getUdfDefinition(catalogName); }
catch (PrestoException e) { log.warn(e.getCause(), "Sidecar UDF lookup failed for %s", catalogName); throw e; }

Prevention

When it happens

Trigger: Calling getUdfDefinition(catalogName, ...) when the sidecar HTTP request fails: sidecar unreachable, non-200 response, timeout, malformed response body, or JSON decoding error for that catalog.

Common situations: Sidecar pod down or misconfigured sidecar URI in plugin config; network partition between coordinator and sidecar; sidecar returning 5xx; catalog name with characters the sidecar rejects; sidecar version returning an unexpected response schema.

Related errors


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