Open danielloader opened 3 months ago
I wondered if this is related: https://github.com/deeplay-io/nice-grpc/pull/609
Though the package.json
in this repo is already utilising nice-grpc@2.1.9
already.
EDIT: looks like package-lock.json has grpc-js 1.10.8 at current head: https://github.com/smartive/zitadel-node/blob/cd68a02fa7661d30e4637ef7559d7b0378fdb9c6/package-lock.json#L175
My notes indicated some 1.10 versions may cause issues. https://github.com/deeplay-io/nice-grpc/pull/609#issuecomment-2151244474 though v1.10.8 was not listed at the time. I've forgotten why.
You could try bumping grpc-js to latest version and see what happens. But it may be a deeper issue, since I think I had a reason for listing only those bad 2 versions at the time and not a wider range.
D 2024-08-21T20:36:06.867Z | v1.10.9 28 | load_balancing_call | [22] Received metadata
Unfortunately as evidenced by this log, adding my own dependency hasn't changed the fact the zitadel-node package is using or wants to use 1.10.9.
Just ended up with both in the yarn.lock:
"@grpc/grpc-js@1.11.1":
version "1.11.1"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.11.1.tgz#a92f33e98f1959feffcd1b25a33b113d2c977b70"
integrity sha512-gyt/WayZrVPH2w/UTLansS7F9Nwld472JxxaETamrM8HNlsa+jSLNyKAZmhxI2Me4c3mQHFiS1wWHDY1g1Kthw==
dependencies:
"@grpc/proto-loader" "^0.7.13"
"@js-sdsl/ordered-map" "^4.4.2"
"@grpc/grpc-js@^1.10.8":
version "1.10.9"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.10.9.tgz#468cc1549a3fe37b760a16745fb7685d91f4f10c"
integrity sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==
dependencies:
"@grpc/proto-loader" "^0.7.13"
"@js-sdsl/ordered-map" "^4.4.2"
Not sure how to override this to force it to use 1.11.1.
Edit: Have since learned about resolutions, added this to package.json, trying again:
"resolutions": {
"@grpc/grpc-js": "1.11.1"
}
Edit2: Come back with bad news:
D 2024-08-21T20:52:05.326Z | v1.11.1 28 | retrying_call | [17] halfClose called
D 2024-08-21T20:52:05.327Z | v1.11.1 28 | load_balancing_call | [18] halfClose called
D 2024-08-21T20:52:05.327Z | v1.11.1 28 | subchannel_call | [19] end() called
D 2024-08-21T20:52:05.327Z | v1.11.1 28 | subchannel_call | [19] calling end() on HTTP/2 stream
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | subchannel_call | [19] HTTP/2 stream closed with code 8
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | subchannel_call | [19] ended with status: code=1 details="Call cancelled"
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | load_balancing_call | [18] Received status
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | load_balancing_call | [18] ended with status: code=1 details="Call cancelled" start time=2024-08-21T20:52:05.326Z
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | retrying_call | [17] Received status from child [18]
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | retrying_call | [17] state=TRANSPARENT_ONLY handling status with progress PROCESSED from child [18] in state ACTIVE
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | retrying_call | [17] ended with status: code=1 details="Call cancelled" start time=2024-08-21T20:52:05.326Z
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | resolving_call | [16] Received status
D 2024-08-21T20:52:05.328Z | v1.11.1 28 | resolving_call | [16] ended with status: code=1 details="Call cancelled"
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
ClientError: /zitadel.management.v1.ManagementService/GetMyOrg CANCELLED: Call cancelled
at wrapClientError (/app/node_modules/nice-grpc/lib/client/wrapClientError.js:9:16)
at Object.callback (/app/node_modules/nice-grpc/lib/client/createUnaryMethod.js:27:66)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:193:36)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:129:78
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
path: '/zitadel.management.v1.ManagementService/GetMyOrg',
code: 1,
details: 'Call cancelled'
}
Node.js v22.6.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
same issue and the log is nice enough to show it's the newer version.
We've ended up wrapping the calls this library makes in our code with a try/catch and returning a 503 if there's an exception raised so the client can decide to retry the request.
If retry friendly exceptions were bubbled up from nice grpc it would be nice if this library had its own retry mechanism to attempt to smooth out transient issues but as this mitigates our customer affecting issue well enough I'm happy to just leave this issue up for future comments or closure.
Bit of a strange one but figured I'd ask, I've got an issue where if a nodejs microservice is idle for some time (not known how long yet for a pattern) and then receives a request which requires a hit on the
/zitadel.management.v1.ManagementService/GetMyOrg
method, there's a high chance it'll crash the nodejs process with an uncaught exception.If you need any more information I'll try to provide it for you.
I've enabled the following environment variables for information:
Debug level log for the failed call:
Debug level log for a successful call of the same endpoint (after hitting refresh a few times after the container is live again):