dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

[Bug] `unexpected end of JSON input` with latest CLI #420

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

What are you really trying to do?

Call client.workflow.list and then do for await (const workflow of list) {.

Describe the bug

Execution doesn't reach inside the loop. Instead, after several seconds, I get:

Error: 2 UNKNOWN: unexpected end of JSON input
  at Object.callErrorFromStatus (/Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
  at Object.onReceiveStatus (/Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/client.js:195:52)
  at /Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/call-stream.js:111:35
  at Object.onReceiveStatus (/Users/me/test/temporal-delivery/node_modules/@temporalio/client/lib/grpc-retry.  at Object.onReceiveStatus (/Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/ 65:141)
  at Object.onReceiveStatus (/Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/ 28:181)
  at /Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/call-stream.js:188:78
  at processTicksAndRejections (node:internal/process/task_queues:78:11)
  call at
  at ServiceClientImpl.makeUnaryRequest (/Users/me/test/temporal-delivery/node_modules/@grpc/grpc-js/build/src/client.  at Service.rpcImpl (/Users/me/test/temporal-delivery/node_modules/@temporalio/client/lib/connection.js:206:27)
  at Service.rpcCall (/Users/me/test/temporal-delivery/node_modules/protobufjs/src/rpc/service.js:94:21)
  at executor (/Users/me/test/temporal-delivery/node_modules/@protobufjs/aspromise/index.js:44:16)
  at new Promise (<anonymous>)
  at Object.asPromise (/Users/me/test/temporal-delivery/node_modules/@protobufjs/aspromise/index.js:28:12)
  at Service.rpcCall (/Users/me/test/temporal-delivery/node_modules/protobufjs/src/rpc/service.js:86:21)
  at Service.listWorkflowExecutions (eval at Codegen (/Users/me/test/temporal-delivery/node_modules/@protobufjs/  <anonymous>:4:15)
  at WorkflowClient._list (/Users/me/test/temporal-delivery/node_modules/@temporalio/client/lib/workflow-client.  at _list.next (<anonymous>)
  at eval (webpack-internal:///(api)/./pages/api/[trpc].ts:29:26)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async resolveMiddleware (file:///Users/me/test/temporal-delivery/node_modules/@trpc/server/dist/index.mjs:383:30)
  at async callRecursive (file:///Users/me/test/temporal-delivery/node_modules/@trpc/server/dist/index.mjs:419:32)
  at async next (file:///Users/me/test/temporal-delivery/node_modules/@trpc/server/dist/index.mjs:427:32) {

This happens with CLI:

$ temporal -v
temporal version 0.6.0 (server 1.20.0) (ui 2.11.0)

but it works fine with:

$ temporalite -v
temporalite version (devel) (server 1.17.3)

Minimal Reproduction

npx @temporalio/create@latest ./temporal-delivery --sample food-delivery
cd ./temporal-delivery
npm run dev

Open localhost:3000, click order button, open localhost:3001. You'll see the error in the terminal. Execution doesn't get past this line: https://github.com/temporalio/samples-typescript/blob/ba6208155bc7b547c76931b7e14e92ce4594af28/food-delivery/apps/driver/pages/api/%5Btrpc%5D.ts#L24