

nodejs fails to connects to local hana cloud with hana-client library: Socket cl...
source link: https://answers.sap.com/questions/13839434/nodejs-fails-to-connects-to-local-hana-cloud-with.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

nodejs fails to connects to local hana cloud with hana-client library: Socket closed by peer
I want to use nodejs to access hana cloud instance in local docker container, the nodejs code is below
var hdb = require("@sap/hana-client"); var options = { host: "localhost", port: "30041", uid: "uname", pwd: "pw", encrypt: true, polling: true, sslValidateCertificate: false, connectTimeout: 10000, disableCloudRedirect: true, ca: "", emptyTimeStampIsNull: false, ssl: true, }; var client = hdb.createClient(options); client.connect(function (err) { if (err) { client.close(function (e) { if (e) { debug("Error while closing connection.", e); } }); console.error("hana connection failed: " + err); } else { console.error("hana connection succeed"); } });
I use the SQLDBC Tracing, the trace information is follow, I have hidden my ip address and replace the ip address with "localip"
System call 'connect' succeeded: localip:56732 -> localip:30041 ADDRESS RESOLVED TO: localip The connection took 1 milliseconds and 1 attempt(s) doPollBeforeSendToDetectSocketDead poll returned true doPollBeforeSendToDetectSocketDead recv returned 0, throwing ERR_NETWORK_SOCKET_SHUTDOWN_wHOST SQL ERROR : SQLCODE : -10709 SQLSTATE : MESSAGE : Connection failed (RTE:[89013] Socket closed by peer {localip:56732 -> localip:30041} (localip:56732 -> localip:30041)) ::PHYSICAL CONNECTION OPEN 2023-03-11 13:00:04.707000 FAILED -10709 / Connection failed (RTE:[89013] Socket closed by peer {localip:56732 -> localip:30041} (localip:56732 -> localip:30041)) LOCATION localip:30041 CHANGED FROM REACHABLE TO UNREACHABLE Closed socket handle 2023-03-11 13:00:04.724000<br><br>
my OS is windows11, I have installed hana client in my system. I also tried other clients to access my local hana docker container
- Using hana database explorer from BTP cloud, it works.
- Using DBeaver installed in local, it also works
- Deploy the nodejs APP in other PC and connects to my local hana, it also works
- Using JDBC command to connect to the local hana, it works
- Using hdbsql to connect, it reports the same error.
it seems that my OS has some issues. could someone guide how to solve the issue? thanks.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK