{"record":{"id":"949f6ebbfdc27cb4","repo":"prestodb/presto","slug":"failed-to-create-controller-auth-provider","errorCode":null,"errorMessage":"Failed to create Controller auth provider","messagePattern":"Failed to create Controller auth provider","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/auth/PinotControllerAuthenticationProvider.java","lineNumber":49,"sourceCode":"\n    @Inject\n    public PinotControllerAuthenticationProvider(PinotConfig pinotConfig)\n    {\n        String type = pinotConfig.getControllerAuthenticationType();\n        switch (type) {\n            case \"NONE\":\n                this.delegate = PinotEmptyAuthenticationProvider.instance();\n                break;\n            case \"PASSWORD\":\n                try {\n                    this.delegate = new PinotPasswordAuthenticationProvider(\n                            pinotConfig.getControllerAuthenticationUser(),\n                            pinotConfig.getControllerAuthenticationPassword(),\n                            PinotSessionProperties.class.getMethod(\"getControllerAuthenticationUser\", ConnectorSession.class),\n                            PinotSessionProperties.class.getMethod(\"getControllerAuthenticationPassword\", ConnectorSession.class));\n                }\n                catch (NoSuchMethodException e) {\n                    throw new RuntimeException(\"Failed to create Controller auth provider\", e);\n                }\n                break;\n            default:\n                throw new RuntimeException(\"Unknown authentication type - \" + type);\n        }\n    }\n\n    private PinotControllerAuthenticationProvider(PinotAuthenticationProvider delegate)\n    {\n        this.delegate = requireNonNull(delegate, \"Delegate controller authentication provider is required\");\n    }\n\n    @Override\n    public Optional<String> getAuthenticationToken()\n    {\n        return delegate.getAuthenticationToken();\n    }\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/auth/PinotControllerAuthenticationProvider.java#L31-L67","documentation":"Mirror of the broker case for the controller: PinotControllerAuthenticationProvider resolves controller session credential getters via reflection and wraps a NoSuchMethodException in a RuntimeException 'Failed to create Controller auth provider'.","triggerScenarios":"Constructing the controller auth provider with controller authentication enabled; PinotSessionProperties.getMethod(\"getControllerAuthenticationUser\"/\"...Password\", ConnectorSession.class) throws NoSuchMethodException because those methods don't exist in the loaded class.","commonSituations":"Method renames in PinotSessionProperties; mixed jar versions in the deployment; refactor removed controller session properties while auth config still requests user/password mode.","solutions":["Rebuild/redeploy the connector so all classes are consistent","Update the reflective lookup names to the current method names or replace reflection with direct calls","Check for recent renames of the controller session property getters","Confirm controller auth type config requires this provider before it is constructed"],"exampleFix":"// before\nPinotSessionProperties.class.getMethod(\"getControllerAuthenticationUser\", ConnectorSession.class)\n// after\nsession -> PinotSessionProperties.getControllerAuthenticationUser(session)","handlingStrategy":"try-catch","validationCode":"// pre-flight reflective check for controller getters\ntry {\n  PinotSessionProperties.class.getMethod(\"getControllerAuthenticationUser\", ConnectorSession.class);\n  PinotSessionProperties.class.getMethod(\"getControllerAuthenticationPassword\", ConnectorSession.class);\n} catch (NoSuchMethodException e) {\n  throw new IllegalStateException(\"Connector build lacks controller auth session properties\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  provider = new PinotControllerAuthenticationProvider(pinotConfig);\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Failed to create Controller auth provider\")) {\n    log.error(\"Controller auth provider init failed; check build consistency\", e);\n    provider = PinotAuthenticationProvider.none();\n  } else throw e;\n}","preventionTips":["Ensure all connector classes come from the same build artifact","Replace reflection with compile-checked references in connector code","Run connector startup integration tests with controller auth enabled","Monitor renames of controller session property methods"],"tags":["pinot","authentication","reflection","compatibility"],"backgroundTag":"auth-provider-init-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"}