question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using createWorkflowInstanceWithResult

See original GitHub issue

working through this tutorial, https://zeebe.joshwulf.com/quickstart/quickstart/ getting to the point where i change update createWorkflowInstance to createWorkflowInstanceWithResult.

I’m receive this error after a few seconds of running it with “createWorkflowInstanceWithResult”.

> Error: 13 INTERNAL: Unexpected error occurred during the request processing
    at Object.exports.createStatusError (C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\grpc\src\common.js:91:15)
    at Object.onReceiveStatus (C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\grpc\src\client_interceptors.js:1209:28)
    at InterceptingListener._callNext (C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\grpc\src\client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\grpc\src\client_interceptors.js:618:8)
    at callback (C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\grpc\src\client_interceptors.js:847:24) {
  code: 13,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'Unexpected error occurred during the request processing'

I’m presuming it’s from not receiving a response but idk for sure. Below is my worker code.

> zbc.createWorker(null, "ImageInspection", (job, complete) => {
  console.log(JSON.stringify(job, null, 2))
  try {
      const readimage = 'c:\\images'
      const imageid = '123423'
      complete.success({
          readimage
      })
  } catch (e) {
      console.error("Something went wrong!")
      console.error(e)
      complete.fail(e.message)
  }
});

which is responding this

{
  "key": "2251799813693006",
  "type": "ImageInspection",
  "workflowInstanceKey": "2251799813692999",
  "bpmnProcessId": "Test_Yolo_workflow",
  "workflowDefinitionVersion": 4,
  "workflowKey": "2251799813692753",
  "elementId": "ReadImage",
  "elementInstanceKey": "2251799813693005",
  "customHeaders": {
    "propVideoFilepath": "VideoFilepath"
  },
  "worker": "52b33f3f-1af1-46b8-975a-57f36463f6cf",
  "retries": 3,
  "deadline": "1581962956672",
  "variables": {
    "readimage": "",
    "readvideo": ""
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jwulfcommented, Feb 19, 2020

Use triple backticks to enclose code samples and console output to preserve formatting.

Please use GitHub issues for reporting bugs and making feature requests. For helping hetting started and using the library, use Slack and the Zeebe Forum.

0reactions
IamManifoldcommented, Feb 18, 2020

Ok, i think that may have fixed the error. Should I be able to set up operate to view the status of my workflows and so on? I can log in but not sure where to config it, i’m sure there’s a file or something i’m missing.

I’m also missing something with my workers. I’m not sure what they are doing but i’m not showing anything about them marking a task complete in the console

First worker

const zb = require(‘zeebe-node’)

;(async () => { const zbc = new zb.ZBClient(‘127.0.0.1:26500’) const topology = await zbc.topology() console.log(JSON.stringify(topology, null, 2))

const zbWorker = zbc.createWorker(‘ImageInspection’, ‘ImageInspection’, handler) setTimeout(() => { console.log(‘Closing client…’) zbc.close().then(() => console.log(‘All workers closed’)) }, 1000000) })()

function handler(payload, complete) { console.log(‘ZB payload’, payload) complete.success(payload.variables,{ newvar:‘bob’}) }

RESPONSE

{ “brokers”: [ { “partitions”: [ { “partitionId”: 1, “role”: “LEADER” } ], “nodeId”: 0, “host”: “172.19.0.2”, “port”: 26501 } ], “clusterSize”: 1, “partitionsCount”: 1, “replicationFactor”: 1 } {“timestamp”:“2020-02-18T21:07:14.007Z”,“context”:“C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\zeebe-node\dist\zb\ZBWorker.js:28”,“id”:“ImageInspection”,“level”:30,“message”:“Ready for ImageInspection…”,“time”:“2020 Feb-18 16:07:14PM”,“pollInterval”:30000,“namespace”:“ZBWorker”,“taskType”:“ImageInspection”}

second example of worker const { ZBClient } = require(‘zeebe-node’) const zbc = new ZBClient({ onReady: () => console.log(Connected!), onConnectionError: () => console.log(Disconnected!)

zbc.createWorker(“ImageInspection”, “log”, (job, complete) => { console.log(job); complete.success(); })

zbc.createWorker(null, “VideoInspection”, (_, complete) => { complete.success({ recommendation: “Video Inspection” }) }) Second Response

C:\Zeebe\WorkerClient\Node\zeebeNodeClient>node worker.js {“timestamp”:“2020-02-18T21:08:36.512Z”,“context”:“C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\zeebe-node\dist\zb\ZBWorker.js:28”,“id”:“ImageInspection”,“level”:30,“message”:“Ready for log…”,“time”:“2020 Feb-18 16:08:36PM”,“pollInterval”:30000,“namespace”:“ZBWorker”,“taskType”:“log”} {“timestamp”:“2020-02-18T21:08:36.526Z”,“context”:“C:\Zeebe\WorkerClient\Node\zeebeNodeClient\node_modules\zeebe-node\dist\zb\ZBWorker.js:28”,“id”:“6f512eb5-9590-443e-bb2e-ff6ff0db9957”,“level”:30,“message”:“Ready for VideoInspection…”,“time”:“2020 Feb-18 16:08:36PM”,“pollInterval”:30000,“namespace”:“ZBWorker”,“taskType”:“VideoInspection”} Connected!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when using createWorkflowInstanceWithResult #126
getting to the point where i change update createWorkflowInstance to createWorkflowInstanceWithResult. I'm receive this error after a few ...
Read more >
Create a Workflow Instance - Zeebe Node.js Client Guide
Be aware that if your createWorkflowInstanceWithResult request times out, or the connection with the broker is lost during this operation, you will not...
Read more >
gRPC API Reference - Camunda Platform 8 Docs
Error handling​. The gRPC API for Zeebe is exposed through the gateway, which acts as a proxy for the broker. Generally, this means...
Read more >
Coming in Zeebe 0.22: Awaitable workflow outcomes
The new CreateWorkflowInstanceWithResult command allows you to “synchronously” execute workflows and receive the outcome. It's a popular feature ...
Read more >
zeebe-node-next - npm
Start using zeebe-node-next in your project by running `npm i ... Completing tasks with success, failure, error, or forwarded; Working with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found