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

aiokafka create topic error > 0.10.0 #633

Closed
MarkCWirt opened this issue Jul 12, 2024 · 8 comments
Closed

aiokafka create topic error > 0.10.0 #633

MarkCWirt opened this issue Jul 12, 2024 · 8 comments

Comments

@MarkCWirt
Copy link

MarkCWirt commented Jul 12, 2024

Checklist

  • [ X] I have included information about relevant versions
  • [ X] I have verified that the issue persists when using the master branch of Faust.

(this has been addressed in master, but there may still be an issue)

Steps to reproduce

Tell us what you did to cause something to happen.

When trying to run a Faust application running Faust against aiokafka 0.11.0, a stackstrace is thrown.

Note I don't know if this is relevent, but the issue onlu cropped up when I included a agent with
a timer, ie

@timer_app.timer(interval=TIMER_INTERVAL_SECONDS)
async def send_alert_timer():
    """
    Check for the existence of new reminders periodically.
    """

    if RESOLUTION == "hour":
        now = datetime.datetime.utcnow().replace(minute=0, second=0, microsecond=0).isoformat()
    elif RESOLUTION == "day":
        now = datetime.datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0).isoformat()

    etc.

Before creating that end-point I did not experience the error.

Expected behavior

Tell us what you expected to happen.

I expected the application to run.

Actual behavior

Tell us what happened instead.

Full traceback

    await self.declare()
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/faust/topics.py", line 498, in declare
    await producer.create_topic(
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/faust/transport/drivers/aiokafka.py", line 1275, in create_topic
    await cast(Transport, self.transport)._create_topic(
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/faust/transport/drivers/aiokafka.py", line 1490, in _create_topic
    await wrap()
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/mode/utils/futures.py", line 58, in __call__
    result = await self.fun(*self.args, **self.kwargs)
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/faust/transport/drivers/aiokafka.py", line 1557, in _really_create_topic
    wait_result = await owner.wait(
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/mode/services.py", line 740, in wait
    return await self._wait_one(coros[0], timeout=timeout)
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/mode/services.py", line 809, in _wait_one
    results = await self.wait_first(coro, timeout=timeout)
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/mode/services.py", line 787, in wait_first
    f.result()  # propagate exceptions
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/aiokafka/client.py", line 516, in send
    future = self._conns[(node_id, group)].send(
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/aiokafka/conn.py", line 461, in send
    header = request.build_request_header(
  AttributeError: 'CreateTopicsRequest_v1' object has no attribute 'build_request_header'

Important note

This was addressed in a recent pull reuqest (merged three days ago). The traceback changed, but it is still throwing an error:

... same until 1490...
...

 File "/Users/mwirt/git/OPC/faust/faust/transport/drivers/aiokafka.py", line 1490, in _create_topic
    await wrap()
  File "/Users/mwirt/.virtualenvs/test/lib/python3.10/site-packages/mode/utils/futures.py", line 58, in __call__
    result = await self.fun(*self.args, **self.kwargs)
  File "/Users/mwirt/git/OPC/faust/faust/transport/drivers/aiokafka.py", line 1566, in _really_create_topic
    assert len(response.topic_error_codes), "single topic"
AttributeError: 'CreateTopicsResponse_v1' object has no attribute 'topic_error_codes'

Versions

  • Python version : 3.10
  • Faust version: 0.10.21. Also master
  • Operating system: MacOS Sonoma, Arch Linux Current, Ubuntu 22.04
  • Kafka version: 3.7.0
  • RocksDB version (if applicable): NA

By the way, constraining aiokafka makes the issue go away

aiokafka>=0.9.0,<0.11.0
@harrystuart
Copy link

Downgrade worked for me also - thanks for saving me potentially a lot of time.

@zevisert
Copy link
Contributor

Appearing on stackoverflow as well: https://stackoverflow.com/questions/78730446/faust-streaming-error-in-hello-world-demo-code-object-has-no-attribute-build-r/78747295#78747295

@dada-engineer
Copy link
Collaborator

@wbarnha when is the fix in the merge request released? This is crucial

@wbarnha
Copy link
Member

wbarnha commented Jul 17, 2024

@wbarnha when is the fix in the merge request released? This is crucial

My goal is to get it out ASAP, the problem is that I need to decide what should be done about aredis. I may just allow tests for Python 3.12 to fail in the meantime and publish a release.

Edit: You know what? Let's just do that.

@wbarnha
Copy link
Member

wbarnha commented Jul 17, 2024

Just created a release, should be available to you shortly!

@wbarnha wbarnha closed this as completed Jul 17, 2024
@cristianmatache
Copy link

Just a reminder @wbarnha, this issue should be reopened because faust errors further dowm with AttributeError: 'CreateTopicsResponse_v1' object has no attribute 'topic_error_codes' as @MarkCWirt pointed in the update above.

@wbarnha wbarnha reopened this Jul 26, 2024
@wbarnha
Copy link
Member

wbarnha commented Jul 26, 2024

Well, that's unfortunate. I'll look further into it.

@cristianmatache
Copy link

cristianmatache commented Jul 26, 2024

Renaming to topic_errors will do @wbarnha

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

6 participants