orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 67 forks source link

OrientDB.ConnectionError [10]: Cannot select the server #445

Open fedor-pavlov opened 3 years ago

fedor-pavlov commented 3 years ago

Hi folks! I use SAP Cloud Platform, Cloud Foundry, to host a small API server which talks to OrinetDB database (hosted somewhere else). In few minutes after the app start it loses connection to DB and any following attempt to acquire a session from session pool leads to this error: "OrientDB.ConnectionError [10]: Cannot select the server".

I saw this error before in other environments (Heroku, for instance), and as a consequence I had to implement an ugly workaround: "Keep-alive Select" query that happens every 30 minutes to keep connection up. But that workaround doesn't work in SAP Cloud Platform. Even if I do selects every 5 minutes, the connection doesn't survive. What could be a problem? I don't like an idea to re-establish connection for each and every select that my app might need. It's truly ugly workaround. Any ideas?

My env:

"node" : "^14.0" "orientjs": "^3.0.11" Orient DB: 3.1.9 (via docker image)

The issue is very easy to re-create. Just publish any nodejs server with orienjs client, and wait for 5-10 minutes :) I'm happy to provide a link to this crashy orientdb-based api server, plus access to logs and whatever needed to troubleshoot. Let's fix this together. "Cannot select the server" error happens very often, many people face it (just google it) and there's no good answer for the problem. I believe, it's time to fix it.