Skip to content

Startup fails if authorization fails on arbitrary "first" topic #29

@jeff303

Description

@jeff303

User report: the kc-repl client fails to initialize properly due to an authorization problem.

I do see that the list of topics is returned by the broker. It happens twice, not sure why. Right after the second response the log mentions that the consumer is assigned to one of the topic. Then there is a call to get more information about the topic and that fails with an exception.

Exception in thread "async-dispatch-1" org.apache.kafka.common.errors.TopicAuthorizationException: Not authorized to access topics: [--topic_name--]

The issue is likely the fact that the client attempts to assign an arbitrary topic returned from the initial topic listing here, and if the client identity used does not have access to that topic, this fails. The fix is likely to either

  1. Allow specification of a starting topic, that the user knows the client auth will have access to, rather than reading an arbitrary one from the list-topics result
  2. Keep trying to assign discovered topics until one of them succeeds (more resilience)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions