-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot unref() node http2 connections #16647
Comments
Deno 1.28.3 I get the same exception when using zeebe-node which also establishes a grpc-connection. Since we are in the process of deciding to use either Deno or NodeJS for script and CLI application development and we need such libraries, it would be good to know if GRPC should actually work with Deno via NPM packages and this is just a bug, or if Deno generally does not support GRPC via HTTP2 in NPM packages. |
Deno 1.29.1 Same exception using |
@kt3k could you take a look at this issue? |
Little update on this issue. If you follow the quick-start guide here and setup the server using docker. Then, by running the code below: import { GRPC } from 'npm:@cerbos/grpc';
const client = new GRPC('localhost:3593', { tls: false });
const kind = 'album:object';
const actions = ['view:public', 'comment'];
const cerbosPayload = {
principal: {
id: 'bugs_bunny',
roles: ['user'],
attributes: {
beta_tester: true,
},
},
resource: {
kind: kind,
id: 'BUGS001',
attributes: {
owner: 'bugs_bunny',
public: false,
flagged: false,
},
},
actions: actions,
};
const decisions = await client.checkResource(cerbosPayload);
console.log(decisions);
client.close(); You get the following error: deno run --allow-env --allow-net --allow-write=. --allow-read=. main.ts
// result: error: Uncaught NotOK: gRPC error 14 (UNAVAILABLE): No connection established However, running the code below using ts-node works well. import { GRPC } from '@cerbos/grpc';
(async () => {
const client = new GRPC('localhost:3593', { tls: false });
const kind = 'album:object';
const actions = ['view:public', 'comment'];
const cerbosPayload = {
principal: {
id: 'bugs_bunny',
roles: ['user'],
attributes: {
beta_tester: true,
},
},
resource: {
kind: kind,
id: 'BUGS001',
attributes: {
owner: 'bugs_bunny',
public: false,
flagged: false,
},
},
actions: actions,
};
const decisions = await client.checkResource(cerbosPayload);
console.log(decisions);
client.close();
})(); ts-node main.ts
// result:
CheckResourcesResult {
resource: { id: 'BUGS001', kind: 'album:object', policyVersion: '', scope: '' },
actions: { comment: 'EFFECT_DENY', 'view:public': 'EFFECT_DENY' },
validationErrors: [],
metadata: undefined
} I hope it helps! 🙏 |
ran into this issue using Temporal SDK for TypeScript:
Was able to reproduce with grpc-js as well:
Seems like an issue when loading Node's |
Ran into this issue as well with Deno 1.35, when trying to use Google's SecretManagerService, which uses gRPC and so needs http/2 support:
Steps to reproduce: Unfortunately, you have to have valid gcloud credentials locally, else we fail before even making a connection:
import {SecretManagerServiceClient as Client} from "npm:@google-cloud/secret-manager"
const client = new Client({ projectId: "my-project"})
const secret = await client.getSecret({name: "my-secret"}) |
Having the same issue here as @NfNitLoop |
I am currently working on improving support for |
Just for the sake of reporting, I'm also experiencing the same issue with Deno v1.36.1 while trying to use the |
Same here, experiencing the issue with |
This commit improves "node:http2" module implementation, by enabling to use "options.createConnection" callback when starting an HTTP2 session. This change enables to pass basic client-side test with "grpc-js/grpc" package. Smaller fixes like "Http2Session.unref()" and "Http2Session.setTimeout()" were handled as well. Fixes #16647
This commit improves "node:http2" module implementation, by enabling to use "options.createConnection" callback when starting an HTTP2 session. This change enables to pass basic client-side test with "grpc-js/grpc" package. Smaller fixes like "Http2Session.unref()" and "Http2Session.setTimeout()" were handled as well. Fixes #16647
Just checked this morning with 1.39:
|
Same issue here: ✗ deno -v
deno 2.0.0-rc.2
✗ deno run -A npm:trigger.dev@beta login
Trigger.dev (3.0.0-beta.56)
T Logging in to Trigger.dev
|
o Created authorization code
|
o Please visit the following URL to login:
| https://cloud.trigger.dev/account/authorization-code/Ws6oxuBRDovT7O0m4c1rzz_Gmb-6Zomzm7hGtqnYdQqkuFK3Lvsi62VLnamWi4bC
X Error: Cannot read properties of undefined (reading 'unref') |
Deno 1.28.0
While using npm compatibility, one of my dependencies establishes a http2 connection, and then tries to close the session calling
session.unref()
, which causes the following errorThis happens using the Cerbos package like so:
I've checked, and it doesn't seem like neither Cerbos nor its grpc dependency has postinstall scripts.
Thank you.
The text was updated successfully, but these errors were encountered: