-
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
ECONNRESET - Session Expired #242
Comments
I too am having this issue. I don't really have a solution, but a temporary work around is to generate a script that restarts your app (Dynos in my case; I am working with Heroku) every half an hour. |
Hi @jremyf, @Lahpman7. Thanks for reporting this problem. It feels like I think this error might also be caused by some load balancer that closes connections after some period of inactivity. Do you guys know if there is smth like this in your network setup? If you want this problem to go away transaction functions API available in 1.2+ driver might help. They retry given transaction with exponential backoff on network errors. Relevant API functions are: Looking forward to your reply. |
Hi @lutovich, unfortunately, because I am using Heroku with GrapheneDB, I only have access to messages.log and neo4j.log, and both are clear from errors. The only error I am getting (after around 20-30 minutes) is this below:
I guess I could give transactional functions a shot, but I would like to try to resolve this before swapping all the syntax in my project. Thanks for the response |
Hi @Lahpman7, Database can close driver connections on protocol errors or unsuccessful authentication. It writes logs about such events. So if there is nothing like that in What kind of dynos do you use? Docs mention dyno sleeping that happens after 30 mins of inactivity. Could it be something you experience? |
Hello @lutovich , I didn’t install any load balancing system on my Azure VM. It didn’t seem like there is such a thing by default. For print the log, I did the followings steps:
The first one is always working, and the second one crash, as expected.
I did the same process with a request sent by transaction. It’s actually working ... in more than 20 seconds. And I get the following error in Maybe you want me to test this with an enterprise edition to get more information? Update : I will check on my side in the azure configuration. |
@lutovich
|
Hello @lutovich , On Azure, I can only have an idle timeout of 30 minutes maximum. After this delay, the connection will be closed. So i'm asking if a keep alive system in the driver could be a solution cause we have no control over it except for some database configurations. For now, I am sending a little request every 3 minutes to bypass this issue. Thanks for helping. |
@jremyf @Lahpman7 it does sound like some keep alive or ping functionality could be useful here. I guess it is also possible to do a simpler thing and just close connections that were idle for more than configurable amount of time. This approach also omits TCP retransmission possible during ping. We will investigate how to add such feature in upcoming releases. |
Same issue in aws market place version maybe something is undertunned in cloud versions? any configuration we can do on the server? It used t o work fine in the docker container |
Same issue using neo4j-driver 1.4.0 in AWS Lambda function using Node 6.10
@arboreal84 on SO suggested this may be related to nodejs event loop starvation?? Not sure if this helps to narrow down the problem... |
With some further investigation of the possibility of event loop starvation I notice that the only place in the driver that uses process.nextTick is in the promise related code - so I'm wondering whether the use of the promise approach ( update: I've now seen this error both in promise style code and eventEmitter style code, so disregard this thought :-) |
Just saw it again after I set NODE_DEBUG=tls,net
compared to a successful request:
Note that in the successful request the Neo4j query is followed by a message being published to an SNS topic. Hopefully this will help someone work out what's going on - it's beyond me :-( |
That debug message returns the number of bytes read by #define ECONNRESET 104 /* Connection reset by peer */ This means the remote peer is closing the connection. Everything after that is cleanup. Now, why is this happening? I would follow the TCP stream following a tool like Wireshark or |
thanks @arboreal84 - challenge is that this is happening in AWS Lambda function, so no opportunity to use wireshark :-( I'll look into trying to replicate locally, but not sure whether that will be possible or whether it will tell me much given the difference in infrastructure configuration. I'll try attacking from the other end and see if GrapheneDB can help. |
In my case the issue was on the database side I could increase memory settings. I guess cloud setups (including official community edition on aws marketplace)are not optimised to take full advantage of the host machine unless you manually configure them to achieve it and that somehow defeats the purpose of installing it from marketplace. |
Hi, I am closing this issue as the initial cause is already addressed. If you have other problems, please be free to open new issues. |
Hi!
I am making a web application based on NodeJS and AngularJS. These applications are deployed on Azure and I also have a virtual machine with Neo4J on it.
My requests through the driver are OK, excepted after a certain amount of time,
I get this error :
Here is how I instantiate the driver :
var neo4j = require('neo4j-driver').v1; var driver = neo4j.driver("bolt://server.adress", neo4j.auth.basic("login", "password")); module.exports = driver;
Here is how I request my server. For each request that is send, I create a new session that I closed right after.
var driver = require('driver_neo4j'); this.method = function() { var session = driver.session(); session.run("REQUEST") .then(function(result) { session.close(); }); }
I found nothing weird in the Neo4J server logs.
It's look like it's related to this #144
If you have any ideas to solve this problem, I'm taking them!
Update :
I actually upgrade neo4j-driver version 1.2 to 1.3.
From now on I get the exact same stack of error with the following code : 'ServiceUnavailable'
@Lahpman7 This error is happening every 5 to 10 minutes in my application.
The text was updated successfully, but these errors were encountered: