-
Notifications
You must be signed in to change notification settings - Fork 28
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
GraphQL conection hang up with message: { type: 'complete' } #35
Comments
The library should reconnect automatically when it encounters a You can run with debug logs enable by starting your script with the environment variable Until investigation is completed, one easy thing to do it to catch the "complete" event and simply restart your stream when it happens. |
I did as you proposed and left process fora few weeks to detect when problem occurs, these are the logs I get when connection hang up:
Whenever connection hangups I always receive message exactly like this, only with ID changed each time. |
Do you have the full debug logs? What network did you connect to? If this is a full print of the full received message, it would mean it's a server problem because this is a message that tells the stream to complete without reconnecting. |
I enabled dfuse logs according to your sugestion. I set flag Connection hang ups each few hours up to few days. |
Please also provide the endpoint where to connect to. The
If you got it correctly, you should see something like this: $ DEBUG="dfuse:*" yarn run:example examples/basic/eosio/stream-transfers-graphql.ts
yarn run v1.16.0
$ yarn run ts-node -O '{"module":"commonjs"}' examples/basic/eosio/stream-transfers-graphql.ts
$ /Users/maoueh/work/dfuse/client-js/node_modules/.bin/ts-node -O '{"module":"commonjs"}' examples/basic/eosio/stream-transfers-graphql.ts
dfuse:http Using `fetch` global value found on 'global' variable (Node.js environment). +0ms
dfuse:socket:stream Using `WebSocket` global value found on 'global' variable (Node.js environment). +0ms
dfuse:socket:graphql Using `WebSocket` global value found on 'global' variable (Node.js environment). +0ms
dfuse:client Inferring API token store default concrete implementation to use +0ms
... |
Let me know, if this gonna help. |
I got the same error |
Hi!
I am building application which synchronizes live with EOS blockchain. I established graphQL connection like this using dfuse-js:
this.dFuseClient.graphql(graphQLQuery, async (message) => { // do something });
My connection hang up after a few days and I am wondering how can I prevent it in the future?
I think terminal message I got was:
console.log(message); // { type: 'complete' }
and just in case one error message before I got:
console.log(message); // { type: 'error', errors: [ { message: 'graphql: hammer search result: rpc error: code = Unavailable desc = transport is closing (trace_id: 4bba6b2d211cb515713be5698c2014e1)' } ], terminal: true }
What should I do in such situation?
How can I make sure connection was closed so I can re establish it?
Or how to make sure connection won't hang up?
The text was updated successfully, but these errors were encountered: