Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrokerMetadata throwing TypeError using old-style string conversion #1633

Closed
jeffwidman opened this issue Nov 13, 2018 · 1 comment
Closed

Comments

@jeffwidman
Copy link
Contributor

jeffwidman commented Nov 13, 2018

I was accidentally passing a BrokerMetada object rather than a node_id, but debugging was more cryptic than it needed to be:

    354
    355             if conn is None:
--> 356                 assert broker, 'Broker id %s not in current metadata' % node_id
    357
    358                 log.debug("Initiating connection to node %s at %s:%s",

TypeError: not all arguments converted during string formatting

Looks like the old-style %s is having problems but using format() doesn't...

BrokerMetadata(nodeId=3, host=u'kafka03.stg.local', port=9092, rack=None)
ipdb> str(node_id)
"BrokerMetadata(nodeId=3, host=u'kafka03.stg.local', port=9092, rack=None)"
ipdb> assert False, "%s" % node_id
*** TypeError: not all arguments converted during string formatting
ipdb> assert False, "{}".format(node_id)
*** AssertionError: BrokerMetadata(nodeId=3, host=u'kafka03.stg.local', port=9092, rack=None)
@jeffwidman
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant