oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Error in host connection #1673

Open danielferayte opened 1 month ago

danielferayte commented 1 month ago

Hello i would like ro report an error when connecting to the database when the host is not an ip image i get the next message error: image I am not sure what is the problem, it happes whin any host The version i am using is the oracledb 6.5 and nodejs vs20

cjbj commented 1 month ago

Looks like some parsing in node-oracledb has broken and you're not seeing the real error. Node-oracledb 6.0 throws (in my environment): Error: NJS-515: error in Easy Connect connection string: could not resolve hostname: ip-10-142-132-50.aws.lnig.com

danielferayte commented 1 month ago

I already try in my environment, with the version you mentioned and i get the same error, so that is the message i get when connecting directly from the database client, which is right because the host is in a private network and the local machine can't find it, but since i get a different error in the code i though maybe something was broken in the last version, so yeah there is a bug in the parsing that is not showing the real error. Thanks!

sharadraju commented 1 month ago

Hi @danielferayte Is the connect string a valid connect string? I assume based on your message, that hostname is valid, but it is not accessible.

The earlier DNS look up error from node-oracledb 6.0 (NJS-515: error in Easy Connect connection string: could not resolve hostname: ip-10-142-132-50.aws.lnig.com) was removed in the later versions to improve network performance.

So this is not a bug, but an intended behavior. However, we do need to improve the error message to reflect this use case as well.

danielferayte commented 1 month ago

Hi @sharadraju , yes, the connect string is a valid string i just changed a number in the ip to make an example of the error message, without exposing the real one, but even the real one wouldn't be accesible because the private network and we would get the same error. I though because the host name is a little different it was not contemplated.

sharadraju commented 1 month ago

Thanks @danielferayte We will definitely look to make the error message more informative and user-friendly!