prestodb/presto · error · RuntimeException

Failed to create Broker auth provider

Error message

Failed to create Broker auth provider

What it means

The broker authentication provider for Pinot uses reflection to look up session-level credential getter methods (getBrokerAuthenticationUser/getBrokerAuthenticationPassword) on PinotSessionProperties. The constructor wraps a NoSuchMethodException in a RuntimeException, meaning the wired method names/signatures no longer exist on that class.

Source

Thrown at presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/auth/PinotBrokerAuthenticationProvider.java:49

    @Inject
    public PinotBrokerAuthenticationProvider(PinotConfig pinotConfig)
    {
        String type = pinotConfig.getBrokerAuthenticationType();
        switch (type) {
            case "NONE":
                this.delegate = PinotEmptyAuthenticationProvider.instance();
                break;
            case "PASSWORD":
                try {
                    this.delegate = new PinotPasswordAuthenticationProvider(
                            pinotConfig.getBrokerAuthenticationUser(),
                            pinotConfig.getBrokerAuthenticationPassword(),
                            PinotSessionProperties.class.getMethod("getBrokerAuthenticationUser", ConnectorSession.class),
                            PinotSessionProperties.class.getMethod("getBrokerAuthenticationPassword", ConnectorSession.class));
                }
                catch (NoSuchMethodException e) {
                    throw new RuntimeException("Failed to create Broker auth provider", e);
                }
                break;
            default:
                throw new RuntimeException("Unknown authentication type - " + type);
        }
    }

    private PinotBrokerAuthenticationProvider(PinotAuthenticationProvider delegate)
    {
        this.delegate = requireNonNull(delegate, "Delegate broker authentication provider is required");
    }

    @Override
    public Optional<String> getAuthenticationToken()
    {
        return delegate.getAuthenticationToken();
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Rebuild the connector so all classes are from the same version
  2. Update the reflective method names in PinotBrokerAuthenticationProvider to match the current PinotSessionProperties API (ideally replace reflection with direct method references)
  3. Check git history for renames of getBrokerAuthenticationUser/getBrokerAuthenticationPassword
  4. Verify broker.auth type config actually requires user/password mode before construction

Example fix

// before
PinotSessionProperties.class.getMethod("getBrokerAuthenticationUser", ConnectorSession.class)
// after
PinotSessionProperties::getBrokerAuthenticationUser  // direct reference, compile-time checked
(session -> PinotSessionProperties.getBrokerAuthenticationUser(session))
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the session property getter exists before enabling broker auth
try {
  PinotSessionProperties.class.getMethod("getBrokerAuthenticationUser", ConnectorSession.class);
  PinotSessionProperties.class.getMethod("getBrokerAuthenticationPassword", ConnectorSession.class);
} catch (NoSuchMethodException e) {
  throw new IllegalStateException("Connector build lacks broker auth session properties", e);
}

Try / catch

try {
  provider = new PinotBrokerAuthenticationProvider(pinotConfig);
} catch (RuntimeException e) {
  if (e.getMessage() != null && e.getMessage().contains("Failed to create Broker auth provider")) {
    log.error("Broker auth provider init failed; falling back to no-auth or manual headers", e);
    provider = PinotAuthenticationProvider.none();
  } else throw e;
}

Prevention

When it happens

Trigger: Constructing PinotBrokerAuthenticationProvider with broker authentication enabled (user/password mode) and PinotSessionProperties.getMethod(...) throws NoSuchMethodException — i.e. the session property methods were renamed, moved, or removed.

Common situations: Connector code refactoring renamed session property getters while the auth provider still references old names; partial builds or mismatched jar versions where the auth class and session-properties class come from different builds.

Related errors


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