crossid / zeebe-mongo-exporter

Apache License 2.0
7 stars 3 forks source link

Unable to export "Receive Task" info to mongodb #5

Closed LuBenjamin1021 closed 3 years ago

LuBenjamin1021 commented 3 years ago

Hi, I have encountered the following error from zeebe when using zeebe-mongo-exporter

2021-02-02 07:58:17.005 [Broker-0-Exporter-1] [Broker-0-zb-fs-workers-1] ERROR io.zeebe.broker.exporter.mongo - Error on exporting record with key -1 java.lang.ClassCastException: class io.zeebe.protocol.impl.record.value.message.MessageSubscriptionRecord cannot be cast to class io.zeebe.protocol.record.value.MessageStartEventSubscriptionRecordValue (io.zeebe.protocol.impl.record.value.message.MessageSubscriptionRecord and io.zeebe.protocol.record.value.MessageStartEventSubscriptionRecordValue are in unnamed module of loader 'app')

at io.crossid.zeebe.exporter.ZeebeMongoClient.handleMessageSubscriptionStartEvent(ZeebeMongoClient.java:561) ~[?:?] at io.crossid.zeebe.exporter.ZeebeMongoClient.newReplaceCommand(ZeebeMongoClient.java:198) ~[?:?] at io.crossid.zeebe.exporter.ZeebeMongoClient.insert(ZeebeMongoClient.java:66) ~[?:?] at io.crossid.zeebe.exporter.MongoExporter.export(MongoExporter.java:73) ~[?:?] at io.zeebe.broker.exporter.stream.ExporterDirector$RecordExporter.export(ExporterDirector.java:354) ~[zeebe-broker-0.24.2.jar:0.24.2] at io.zeebe.util.retry.BackOffRetryStrategy.run(BackOffRetryStrategy.java:51) ~[zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorJob.invoke(ActorJob.java:76) [zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorJob.execute(ActorJob.java:39) [zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorTask.execute(ActorTask.java:118) [zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorThread.executeCurrentTask(ActorThread.java:107) [zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorThread.doWork(ActorThread.java:91) [zeebe-util-0.24.2.jar:0.24.2] at io.zeebe.util.sched.ActorThread.run(ActorThread.java:204) [zeebe-util-0.24.2.jar:0.24.2]

I am playing on this testing bpmn. When it goes to "Receive Task" (i.e. ship Info), the error above will be shown. purchase.zip

Would you help to solve this problem? Thank you.

ranisharim-crossid commented 3 years ago

Which version of Zeebe are you using? It seems like the wrong valueType is being passed from zeebe in your case, which doesn't happen when I try to run it locally with 0.26.0

LuBenjamin1021 commented 3 years ago

The version I used is 0.24.2 but it still happens with 0.26.0. Even like this simple bpmn which only has the receive task, the ClassCastException shows up again when I start a new instance in Simple Monitor.

test_receive_task.zip

I've just tried to add a new instance with variable named "testtest" (no matter what the value is). The error occurred and no more instance can be created. Would you please test again with this bpmn to see whether the issue can be duplicated? Thanks.

Version: Zeebe - 0.26.0 Simple Monitor - 0.19.1

ranisharim-crossid commented 3 years ago

Well, it still doesn't happen on my side. Could you try the new version, and check the logs? See if it outputs "Wrong value type detected: reported MESSAGE_START_EVENT_SUBSCRIPTION actual value is MessageSubscriptionRecordValue"?

Also, it will try to detect this situation and revert to a message subscription export instead, hopefully not crash anymore.

LuBenjamin1021 commented 3 years ago

The new version works well with the receive task and it didn't output the "Wrong value type detected" message. It only outputs the warning

handleMessageSubscriptionEvent zeebe-record_message_subscription 182 2021-02-03 07:15:25.919 [] [I/O dispatcher 1] WARN org.elasticsearch.client.RestClient - request [POST http://elasticsearch:9200/_bulk] returned 1 warnings: [299 Elasticsearch-7.10.2-747e1cc71def077253878a59143c1f785afa92b9 "[types removal] Specifying types in bulk requests is deprecated."]

Nevertheless, it won't affect the performance and everything works fine now. The .jar file that I was using is directly downloaded from your release v0.4 which have this issue. Now I am using the .jar file built from your latest committed version and it works well.

Thanks so much.