Struggling with Event Hub Errors: Unable to Trigger Functions After Changing Partition Count

KURAMOTOAHUJATAIRA-3118 250 Reputation points
2023-07-24T10:03:34.3733333+00:00

I have built a system where I send messages from devices to IoT Hub, pass them through Stream Analytics, and trigger Functions from Event Hub. I conducted a series of tests at this point and confirmed that Functions were triggered successfully.

Later, I decided to change the number of partitions in the Event Hub. To do this, I deleted one of the aliases of the Event Hub and recreated it with the same name but with a different partition count. However, after conducting tests following this change, I encountered the following error, and now I cannot trigger Functions from the Event Hub.

2023-07-24T09:31:54Z [Error] An exception occurred while receiving events for Event Hub: sensingedge-count (Consumer Group: '$Default', Partition Id: '0'); Operation Id: '8c6a5407-51b0-4348-9fc1-c6d32149aecb'. Error Message: 'The supplied offset '55846066024' is invalid. The last offset in the system is '-1' TrackingId:a3b6d45c-62a7-4f66-aa49-07c1cf7ed1f5_B5, SystemTracker:rl-eventhub-stg:eventhub:sensingedge-count~32766, Timestamp:2023-07-24T09:31:53 Reference:88685577-389e-46e1-8043-7ecfb9934651, TrackingId:478dfd8f-d20b-49cd-9a77-e233428681ce_B5, SystemTracker:rl-eventhub-stg:eventhub:sensingedge-count~32766|$default, Timestamp:2023-07-24T09:31:53 TrackingId:d1709763cb25457a8eefd0dd4cbc2a80_G7, SystemTracker:gateway5, Timestamp:2023-07-24T09:31:53 For troubleshooting information, see https://aka.ms/azsdk/net/eventhubs/exceptions/troubleshoot' 2023-07-24T09:31:54Z [Information] Completed receiving events for Event Hub: sensingedge-count (Consumer Group: '$Default', Partition Id: '0'); Operation Id: '8c6a5407-51b0-4348-9fc1-c6d32149aecb'. Service Retry Count: 1; Event Count: 0; Duration: '0.40' seconds 2023-07-24T09:31:54Z [Error] An exception occurred while processing events for partition '0' by processor instance with identifier '60231fe4-8ba6-4bb6-a172-0ab8be5ed8d5' for Event Hub: sensingedge-count and Consumer Group: $Default. Error Message: 'The supplied offset '55846066024' is invalid. The last offset in the system is '-1' TrackingId:a3b6d45c-62a7-4f66-aa49-07c1cf7ed1f5_B5, SystemTracker:rl-eventhub-stg:eventhub:sensingedge-count~32766, Timestamp:2023-07-24T09:31:53 Reference:88685577-389e-46e1-8043-7ecfb9934651, TrackingId:478dfd8f-d20b-49cd-9a77-e233428681ce_B5, SystemTracker:rl-eventhub-stg:eventhub:sensingedge-count~32766|$default, Timestamp:2023-07-24T09:31:53 TrackingId:d1709763cb25457a8eefd0dd4cbc2a80_G7, SystemTracker:gateway5, Timestamp:2023-07-24T09:31:53 For troubleshooting information, see https://aka.ms/azsdk/net/eventhubs/exceptions/troubleshoot'

Afterwards, I reverted to the original state, but the same error persisted, and the situation did not improve, and troubleshooting did not work for me. Could you please provide some guidance on how to address this issue?

Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
564 questions
Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
333 questions
{count} votes

Accepted answer
  1. Sander van de Velde 29,281 Reputation points MVP
    2023-07-24T17:19:09.9066667+00:00

    Hello @KURAMOTOAHUJA TAIRA (倉本A 平),

    I see you are using the $default consumer group.

    Consumer groups are not to be reused by multiple consumers (azure resources listening to incoming iot hub messages).

    This could be Stream Analytics, Azure Functions, TimeSeries Insights, or even diagnostics tooling like Visual Studio Code or the IoT Explorer.

    Because all these tools use $default by default, a mistake is made quickly.

    Please use separate consumer groups for every consumer:

    User's image

    Check the Built-in endpoints page in the IoT Hub.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful