camunda-community-hub / nestjs-zeebe

Zeebe transport and client for nestjs framework
MIT License
24 stars 11 forks source link

SAXException while parsing input stream #10

Closed gilffcunha closed 3 years ago

gilffcunha commented 3 years ago

Hi, I was trying to deploy a Zeebe process with nestjs-zeebe 2.0.0, like so: @Inject(ZEEBE_CONNECTION_PROVIDER) private readonly zbClient: ZBClient const deployed = await this.zbClient.deployProcess('test2.bpmn') However, I get the following error:

Error: 3 INVALID_ARGUMENT: Command 'CREATE' rejected with code 'INVALID_ARGUMENT': Expected to deploy new resources, but encountered the following errors:
'test2.bpmn': SAXException while parsing input stream

I checked the logs on my Zeebe container and found that it was "Caused by: org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Premature end of file." I checked my bpmn file and it seems fine. If I use instead zeebe-node 1.3.4 directly, the process is deployed successfully:

import { ZBClient } from 'zeebe-node'
const zbc = new ZBClient('zeebe:26500')
const deployed = await zbc.deployProcess('test2.bpmn')

Any idea of what can it be? Thank you in advance :slightly_smiling_face:

gilffcunha commented 3 years ago

PS: My Zeebe Workers are not being defined either. When I run a process instance, it starts fine but jobs are not processed by Zeebe Workers, when I declare a handler with the decorator @ZeebeWorker.

jwulf commented 3 years ago

According to the package.json on the master branch, it's still using a pre-release alpha of zeebe-node, which will do this.

Upgrading that dependency to 1.3.4 will fix this.

gilffcunha commented 3 years ago

Hi, @danshapir is it possible to upgrade the package.json to meet this zeebe-node version? Additionally, is it also possible to upgrade it to be compatible with nestjs 8.0.0?

danshapir commented 3 years ago

@gilffcunha Sure, I'll do it now. But I get the same SAXException even when working with v1.3.4. How did you manage to fix it?

Do define your zeebe workers you need to follow the readme, create a microservice, start them, attach the ZeebeServer, otherwise they won't be picked up.

danshapir commented 3 years ago

@gilffcunha You can update to the latest version and enjoy :)

gilffcunha commented 3 years ago

Thank you so much for your help guys 😄 @jwulf @danshapir