{"record":{"id":"907d02e98251b2a6","repo":"prestodb/presto","slug":"invalid-arguments-907d02","errorCode":"INVALID_ARGUMENTS","errorMessage":"Failed to get catalog-scoped functions from sidecar for catalog '%s'","messagePattern":"Failed to get catalog-scoped functions from sidecar for catalog '(.+?)'","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/functionNamespace/NativeFunctionDefinitionProvider.java","lineNumber":83,"sourceCode":"    public UdfFunctionSignatureMap getUdfDefinition(NodeManager nodeManager)\n    {\n        try {\n            // Base endpoint: /v1/functions\n            URI baseUri = getSidecarLocationOnStartup(\n                    nodeManager, config.getSidecarNumRetries(), config.getSidecarRetryDelay().toMillis());\n            // Catalog-filtered endpoint: /v1/functions/{catalog}\n            URI catalogUri = HttpUriBuilder.uriBuilderFrom(baseUri).appendPath(catalogName).build();\n            Request catalogRequest = prepareGet().setUri(catalogUri).build();\n            Map<String, List<JsonBasedUdfFunctionMetadata>> nativeFunctionSignatureMap =\n                    httpClient.execute(catalogRequest, createJsonResponseHandler(nativeFunctionSignatureMapJsonCodec));\n            if (nativeFunctionSignatureMap == null) {\n                return new UdfFunctionSignatureMap(ImmutableMap.of());\n            }\n            return new UdfFunctionSignatureMap(ImmutableMap.copyOf(nativeFunctionSignatureMap));\n        }\n        catch (Exception e) {\n            // Do not fall back to unfiltered endpoint to avoid cross-catalog leakage.\n            throw new PrestoException(INVALID_ARGUMENTS, String.format(\"Failed to get catalog-scoped functions from sidecar for catalog '%s'\", catalogName), e);\n        }\n    }\n\n    @VisibleForTesting\n    public HttpClient getHttpClient()\n    {\n        return httpClient;\n    }\n}\n","sourceCodeStart":65,"sourceCodeEnd":93,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/functionNamespace/NativeFunctionDefinitionProvider.java#L65-L93","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the sidecar service is running and reachable (check sidecar.uri config, DNS, port).","Inspect the cause exception in the stack trace to identify the underlying HTTP/parse failure.","Confirm the catalog name exists and matches the catalog registered with the sidecar.","Check sidecar server logs for errors on the catalog-scoped functions endpoint.","Retry after confirming sidecar health; if persistent, redeploy/upgrade the sidecar to a compatible version."],"exampleFix":"// before: sidecar.url pointing at wrong port\nsidecar.uri=http://sidecar:7777\n// after\nsidecar.uri=http://native-sidecar.default.svc.cluster.local:8080","handlingStrategy":"fallback","validationCode":"// check sidecar reachability before calling\nHttpResponse health = httpClient.execute(new Request.Builder().setUri(sidecarUri + \"/health\").build());\nif (health.getStatusCode() != 200) { fallbackToLocalFunctionMetadata(); }","typeGuard":null,"tryCatchPattern":"try { udfMap = provider.getUdfDefinition(catalogName); }\ncatch (PrestoException e) { log.warn(e.getCause(), \"Sidecar UDF lookup failed for %s\", catalogName); throw e; }","preventionTips":["Monitor sidecar health endpoints and alert on downtime","Pin sidecar URI via service discovery, not hardcoded host:port","Keep sidecar and plugin versions compatible","Log the cause chain when this error occurs to speed diagnosis"],"tags":["sidecar","http","function-namespace","presto"],"backgroundTag":"sidecar-request-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"}