-
Notifications
You must be signed in to change notification settings - Fork 147
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
Too many "ECONNRESET" error #126
Comments
Thanks for the report @metalshan. |
Thanks for the quick response @oskarhane I am using node 6.2.1 And about code, the code is simple. Below is the snippet.
cypher query example
|
Thanks, It's enough that you: var neo4j = require('neo4j-driver').v1;
var driver = neo4j.driver(dbPath, neo4j.auth.basic(username, password)); one time and the just create sessions from that. I would write your code like this: var neo4j = require('neo4j-driver').v1;
var driver = neo4j.driver(dbPath, neo4j.auth.basic(username, password));
doDatabaseOperation(query, params, operation) {
if(!operation){
operation = "operation";
}
return new Promise((resolve, reject) => {
var session = driver.session();
session.run(query)
.then(result => {
// I am handling my success here
session.close();
resolve(result);
}).catch(err => {
//The ECONNRESET error is being caught here
reject(err);
});
});
} Could you try that and see if the behavior changes? |
Yes, every neo4j query is executed by that function. |
Is it the same for any query you run or just the example you showed? Do you get the same behavior when connecting to any neo4j database or just the one your seeing this on? |
For any query I am facing the issue. With simple queries the failure rates are may be less, but they are there. Yesterday night I modified the doDatabaseOperation() function to use http endpoints of neo, rather than bolt driver and everything is working pretty good. No failures. So the issue is probably with the driver only. Another thing is since last 1 months the driver was also working fine for same queries. The only difference is, number of data in the database were less. Right now I have 500+ nodes and I'm facing this issue. I restarted and also reinstalled the neo4j containers, but the issue remains with the driver. |
Having the same problem with this code:
I've tried local and remote servers, http and bolt, and have confirmed connectivity in golang. |
@raybradley Your issue is that you're potentially closing the driver before the query is finished.
@raybradley your code should look something like the above. |
That was it, @oskarhane. Thank you! |
Hi, |
Since we never heard back from @metalshan, I'm closing this issue. |
Probably it was an environmental issue... I removed every single thing and set up the server again. Haven't faced this issue after that. |
Hi all, We also encounter this issue, here is the stack trace of the error. Hopefully, someone can take a look and figure out the root cause Neo4jError: read ECONNRESET\n\n at captureStacktrace (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/result.js:200:15)\n at new Result (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/result.js:73:19)\n at _newRunResult (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/transaction.js:348:10)\n at Object.run (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/transaction.js:259:14)\n at Transaction.run (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/transaction.js:103:26)\n at Function.runInTransaction (/var/neo4j-sample-app/node_modules/ogmneo/lib/ogmneo-operation-executer.js:154:32)\n at session.readTransaction (/var/neo4j-sample-app/node_modules/ogmneo/lib/ogmneo-operation-executer.js:129:40)\n at TransactionExecutor._executeTransactionInsidePromise (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/internal/transaction-executor.js:115:37)\n at /var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/internal/transaction-executor.js:67:15\n at new Promise ()\n at new F (/var/neo4j-sample-app/node_modules/core-js/library/modules/_export.js:36:28)\n at TransactionExecutor.execute (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/internal/transaction-executor.js:66:14)\n at Session._runTransaction (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/session.js:214:40)\n at Session.readTransaction (/var/neo4j-sample-app/node_modules/neo4j-driver/lib/v1/session.js:187:19)\n at Promise (/var/neo4j-sample-app/node_modules/ogmneo/lib/ogmneo-operation-executer.js:128:25)\n at new Promise ()\n at Function._executeRead (/var/neo4j-sample-app/node_modules/ogmneo/lib/ogmneo-operation-executer.js:122:16)\n at Function.execute (/var/neo4j-sample-app/node_modules/ogmneo/lib/ogmneo-operation-executer.js:110:29)\n at OGMNeoModel.findOne (/var/neo4j-sample-app/src/api/ogm-neo/ogmneo-model.js:399:44)\n at OAuthAccessTokenManager.findOne (/var/neo4j-sample-app/src/api/managers/BaseManager.js:242:27)\n at onJwtBearerStrategyAuth (/var/neo4j-sample-app/src/config/passport.js:102:52)\n at /var/neo4j-sample-app/node_modules/passport-http-jwt-bearer/lib/strategy.js:99:11 This is running on the environment below: |
We cannot go-live without getting this issue fixed. So does anyone has a resolution can fix this issue? |
Hi @stormit-vn,
Please consider configuring Hope this helps. |
@lutovich Thank you for your suggestion. I have applied above configuration and this issue has no longer occurred. I am still following our application, hopefully, it will work Here is the configuration object that I am using
|
neo4j-javascript-driver - 1.0.1
I am using neo4j with enterprise-3.0.1 edition with your nodejs driver and getting too many (over 90%) ECONNRESET errors from the driver. As the same queries are working perfectly fine if used in neo4j browser client (which uses http protocol), I am expecting the problem is in the driver and hence besides mailing the issue to neo4j support I'm also adding the same here.
The text was updated successfully, but these errors were encountered: