{"record":{"id":"ae43cd2e369f4e33","repo":"prestodb/presto","slug":"invalid-arguments","errorCode":"INVALID_ARGUMENTS","errorMessage":"Failed to get functions from sidecar.","messagePattern":"Failed to get functions from sidecar\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java","lineNumber":108,"sourceCode":"    }\n\n    private synchronized UdfFunctionSignatureMap getCachedSignatureMap()\n    {\n        if (cachedSignatureMap == null) {\n            cachedSignatureMap = getNativeFunctionSignatureMap();\n        }\n        return cachedSignatureMap;\n    }\n\n    private UdfFunctionSignatureMap getNativeFunctionSignatureMap()\n    {\n        try {\n            Request request = Request.Builder.prepareGet().setUri(getSidecarLocationOnStartup(nodeManager, maxRetries, retryDelayMs)).build();\n            Map<String, List<JsonBasedUdfFunctionMetadata>> nativeFunctionSignatureMap = httpClient.execute(request, JsonResponseHandler.createJsonResponseHandler(nativeFunctionSignatureMapJsonCodec));\n            return new UdfFunctionSignatureMap(ImmutableMap.copyOf(nativeFunctionSignatureMap));\n        }\n        catch (Exception e) {\n            throw new PrestoException(StandardErrorCode.INVALID_ARGUMENTS, \"Failed to get functions from sidecar.\", e);\n        }\n    }\n\n    public static URI getSidecarLocationOnStartup(NodeManager nodeManager, int maxRetries, long retryDelayMs)\n    {\n        Node sidecarNode = null;\n        for (int attempt = 1; attempt <= maxRetries; attempt++) {\n            try {\n                sidecarNode = nodeManager.getSidecarNode();\n                if (sidecarNode != null) {\n                    break;\n                }\n            }\n            catch (Exception e) {\n                log.error(\"Error getting sidecar node (attempt \" + attempt + \"): \" + e.getMessage());\n                if (attempt == maxRetries) {\n                    throw new RuntimeException(\"Failed to get sidecar node\", e);\n                }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java#L90-L126","documentation":"Wrap-around in getNativeFunctionSignatureMap: the HTTP GET to the native sidecar's function registry endpoint failed (connection error, non-OK response, or bad JSON). The sidecar worker is unreachable or misbehaving, so native UDF signatures cannot be loaded.","triggerScenarios":"Thrown at presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the sidecar process is running and reachable from the worker","Check the sidecar URI and network/DNS configuration","Restart the worker to clear the null cached signature map and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}