{"record":{"id":"d7d0687a0bf74ead","repo":"prestodb/presto","slug":"failed-to-get-sidecar-node","errorCode":null,"errorMessage":"Failed to get sidecar node","messagePattern":"Failed to get sidecar node","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java","lineNumber":125,"sourceCode":"        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                }\n                else {\n                    try {\n                        Thread.sleep(retryDelayMs);\n                    }\n                    catch (InterruptedException ie) {\n                        Thread.currentThread().interrupt();\n                        throw new RuntimeException(\"Retry fetching sidecar function registry interrupted\", ie);\n                    }\n                }\n            }\n        }\n\n        return HttpUriBuilder\n                .uriBuilderFrom(sidecarNode.getHttpUri())\n                .appendPath(FUNCTION_SIGNATURES_ENDPOINT)\n                .build();\n    }","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java#L107-L143","documentation":"After exhausting maxRetries attempts, getSidecarLocationOnStartup could not obtain a sidecar node from the NodeManager (each attempt failed or returned null). The sidecar is not registered with the cluster, so the tool cannot discover native functions.","triggerScenarios":"Thrown at presto-built-in-worker-function-tools/src/main/java/com/facebook/presto/builtin/tools/NativeSidecarFunctionRegistryTool.java:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the sidecar node is registered with discovery before the worker starts","Increase the retry count or delay configuration for sidecar lookup","Check discovery service health"],"exampleFix":null,"handlingStrategy":"retry","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"}