Python-Azure function issue for Kafka trigger

CK 11 Reputation points
2022-10-13T10:42:24.897+00:00

I am facing below error while executing python azure function from VSCODE. I have checked bindings and all extension, looks good. Could you please let me know what may cause this issue? Any help would be appriciated.

250068-image.png

KafkaMessageReceiver: kafkaTrigger

For detailed output, run func with --verbose flag.
[2022-10-13T10:35:27.277Z] Host lock lease acquired by instance ID '0000000000000000000000009936F7DD'.
[2022-10-13T10:35:27.826Z] Worker process started and initialized.
[2022-10-13T10:36:04.297Z] Executing 'Functions.KafkaMessageReceiver' (Reason='(null)', Id=40b8568c-8bca-46df-8c93-2f7012b0accd)
[2022-10-13T10:36:04.957Z] Executed 'Functions.KafkaMessageReceiver' (Failed, Id=40b8568c-8bca-46df-8c93-2f7012b0accd, Duration=838ms)
[2022-10-13T10:36:04.958Z] System.Private.CoreLib: Exception while executing function: Functions.KafkaMessageReceiver. System.Private.CoreLib: Result: Failure
Exception: AttributeError: 'str' object has no attribute 'type'
Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 388, in _handle__invocation_request
args[pb.name] = bindings.from_incoming_proto(
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\bindings\meta.py", line 88, in from_incoming_proto
return binding.decode(datum, trigger_metadata=metadata)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure\functions\kafka.py", line 176, in
decode
return cls.decode_multiple_events(data, trigger_metadata)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure\functions\kafka.py", line 265, in
decode_multiple_events
key=cls._decode_typed_data(
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure\functions\meta.py", line 126, in _decode_typed_data
data_type = data.type
.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2022-10-19T15:30:49.637+00:00

    @CK Thank you for sharing the information and reaching out to Microsoft Q&A. This really helped in engaging our SDK team and after the investigation, they found the cause.

    For Community:
    This is due to a bug #388 in azure-functions-kafka-extension and PR with fix has been created here. Our product team is working on the roll out of the fix and please follow #388 for the same. The workaround for now is to use Kafka function with single mode rather than batch mode.

    Sorry for the inconvenience caused by the issue. Feel free to add a comment if any further questions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.