azure-functions-kafka-extension icon indicating copy to clipboard operation
azure-functions-kafka-extension copied to clipboard

Kafka trigger in function app stops receiving -processing- messages randomly Exception detected on SDK Assembly

Open nachoge opened this issue 4 years ago • 3 comments

Hello,

We have a set of funtions apps with kafka triggers despite they work perfectly most of the time we are experiencing isses regularly.

We have messages -we know they exist- received at the kafka server -a standalone kafka server- but functions do not process them -seems the client is not connected. The Azure monitors says the function aapp is running, so the only way to wake-up is by rebooting the function app.

Is there a know issue on this, or maybe a miss-configuration?

The platform: azure linux docker in premium plan with java sdk kafka extension

If you need the config used on function app side let me know

Thanks in advance

nachoge avatar Oct 06 '21 09:10 nachoge

Hi,

Continuing with this issue here are the details reported by insights.

Exception Properties

Message Broker: Coordinator load in progress Exception type: Confluent.Kafka.ConsumeException Exception type: Confluent.Kafka.ConsumeException Problem Id: Confluent.Kafka.ConsumeException at Confluent.Kafka.Consumer`2.Consume Assembly: Confluent.Kafka, Version=1.5.2.0, Culture=neutral, PublicKeyToken=12c514ca49093d1e Severity level: Error Telemetry type: exception Device type: PC SDK version azurefunctions: 3.2.0.0

Custom Properties

FormattedMessage: Consume error prop__{OriginalFormat}: Consume error LogLevel: Error Category: Host.Triggers.Kafka

Call Stack

Confluent.Kafka.ConsumeException: at Confluent.Kafka.Consumer2.Consume (Confluent.Kafka, Version=1.5.2.0, Culture=neutral, PublicKeyToken=12c514ca49093d1e) at Confluent.Kafka.Consumer2.Consume (Confluent.Kafka, Version=1.5.2.0, Culture=neutral, PublicKeyToken=12c514ca49093d1e) at Microsoft.Azure.WebJobs.Extensions.Kafka.KafkaListener`2.ProcessSubscription (Microsoft.Azure.WebJobs.Extensions.Kafka, Version=3.2.1.0, Culture=neutral, PublicKeyToken=null: /home/vsts/work/1/s/src/Microsoft.Azure.WebJobs.Extensions.Kafka/Listeners/KafkaListener.cs:277)

Thanks

nachoge avatar Oct 15 '21 08:10 nachoge

I'm not sure why it stop processing, however, one thing you can do is enable debugging. https://tsuyoshiushio.medium.com/azure-functions-kafka-trigger-performance-tips-concept-and-architecture-ec94a31d8b93 Coud you see the debug section? If you can't find anything for the details logs, and broker side . This looks similar one. https://github.com/confluentinc/confluent-kafka-dotnet/issues/1090

TsuyoshiUshio avatar Oct 18 '21 00:10 TsuyoshiUshio

Hi TsuyoshiUshio,

I've setted up the debug. Right now with "broker,consumer" I did not set up fetch because the huge amount of traces. It's a matter of time to get info I will analize it -once the problem happens again- and I will give it to you

nachoge avatar Oct 19 '21 08:10 nachoge

@nachoge are you still facing the same issue ??

shrohilla avatar Nov 08 '22 06:11 shrohilla

Hi @shrohilla,

Yes it still happends. It seems the trigger somehow goes zombie and stopps precessing messages. The internal azure monitoring does not detetcs any issue. To minimize this situation we have a monitoring mechanism which detecs the state and reboots the function.

Is there new version we could use? the installing process of the extension seems to be automatic so right now I don't know which versions we are using. By the way, how can I check the current triggret version?

Thanks

nachoge avatar Nov 09 '22 08:11 nachoge

@nachoge if your app is in dotnet can you try with 3.6.0 released version of Kafka extension ??

shrohilla avatar Nov 09 '22 09:11 shrohilla

@shrohilla is not dotnet is Java. We are using Java SDK Kafka trigger extension

nachoge avatar Nov 09 '22 10:11 nachoge

@nachoge not sure about your setup please share the sample code along annotation attributes, hosts.json for more details

shrohilla avatar Nov 09 '22 11:11 shrohilla

`@FunctionName("drop-functionapp-"+BuildConstants.BUILD_ENV+"-CF-OUT-ResolveOT") public void runOne( @KafkaTrigger( name = "kafkatriggerResolveOT", topic = "drop-"+BuildConstants.BUILD_ENV+"-CF-OUT-resolveOT", brokerList=BuildConstants.BUILD_KAFKA_BROKERS, consumerGroup="drop-"+BuildConstants.BUILD_ENV+"-CF-OUT-resolveOT", username=BuildConstants.BUILD_KAFKA_USERNAME, password=BuildConstants.BUILD_KAFKA_PASSWD, protocol=BrokerProtocol.SASLSSL, dataType="string", authenticationMode=BrokerAuthenticationMode.SCRAMSHA512, cardinality=Cardinality.ONE, sslCertificateLocation="/home/site/wwwroot/certificate/kafka.pem", sslCaLocation="/home/site/wwwroot/certificate/kafka.pem"

        ) String kafkaEventData,
        final ExecutionContext context) {

	// logic

    }`

host.json { "version":"2.0" }

is this enough? thanks

nachoge avatar Nov 09 '22 12:11 nachoge

@nachoge are you running your function app using extensions.csproj file ??

shrohilla avatar Nov 09 '22 12:11 shrohilla

Hi, don't use it despite I have one outside the src

nachoge avatar Nov 10 '22 18:11 nachoge

@nachoge as per my understanding of your current setup, please update the extensions.csproj file in the Package reference section <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Kafka" Version="3.6.0" />

run below command -- re-deploy with the latest kafka extension and would request you to share your feedback if this issue is appearing again.

shrohilla avatar Nov 11 '22 03:11 shrohilla

No response from @nachoge seems this issue is resolved

shrohilla avatar Dec 16 '22 07:12 shrohilla