question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error 'too many values to unpack' in KafkaAdminClient: _send_request_to_controller

See original GitHub issue

Dear kafka-python team,

We start using the API KafkaAdminClient (1.4.4) to create a Topic on a kafka version 1.1 (0.11.0 protocol). We use the following code: kac_dst = KafkaAdminClient(bootstrap_servers=bootstrap_servers,client_id='data') logger.info("Creating topic {}".format(topic_name)) topic_list = [] topic = NewTopic(name=topic_name, num_partitions=2, replication_factor=3) topic_list.append(topic) response = kac_dst.create_topics(new_topics=topic_list, validate_only=True)

The following error occur while executing create_topics function:

kafka/admin/client.py", line 398, in create_topics return self._send_request_to_controller(request) kafka/admin/client.py", line 335, in _send_request_to_controller for topic, error_code in getattr(response, "topic_errors", response.topic_error_codes): ValueError: too many values to unpack (expected 2)

If we set validate_only=False, using one element or few,the same error occur, but the topic/s are created .

Regards, Pablo.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeffwidmancommented, Jun 13, 2019

Using kafka-python 1.4.6 didn’t work for me though, I’m surprised this fix didn’t make it into the release.

This fix was released in 1.4.5, so it should be available in 1.4.6… additionally, the only commit to https://github.com/dpkp/kafka-python/commits/master/kafka/admin/client.py since 1.4.6 was released would not affect this.

Are you positive you tested this correctly? You should start with a fresh virtualenv to doublecheck…

0reactions
jlcontrerascommented, Jun 17, 2019

Confirming that installing from master works, thanks for the tip! For anyone interested: pip install git+git://github.com/dpkp/kafka-python.git

(Using kafka-python 1.4.6 didn’t work for me though, I’m surprised this fix didn’t make it into the release)

EDIT: Made a mistake while testing, it does work when using 1.4.6 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: 'too many values to unpack (expected 2) when applying ...
This kind of error is caused by the mismatch between the number of returned values and the number of variables you are trying...
Read more >
Python valueerror: too many values to unpack (expected 2)
It means you are trying to access too many values from an iterator. In this guide, we talk about what this error means...
Read more >
[Solved] Valueerror: Too Many Values to Unpack (Expected 2)
The error message indicates that too many values are being unpacked from a value. The above error message is displayed in either of...
Read more >
How to Fix Valueerror: too many values to unpack - Hello Code
In this article, I will explain the main reason why you will encounter the Valueerror too many values to unpack error in python...
Read more >
How to Fix Valueerror: too many values to unpack - YouTube
Check out https://www.hellocodeclub.com for more tutorials and projectsLearn how to fix the python error "ValueError: too many values to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found