node.jsoracle11gubuntu-12.04node-oracledb

Unable to connect to Oracle 11g using node-oracle driver for Node.js: are they compatible?


We are trying to use node.js app to connect to Oracle 11g server (Enterprise Edition 11.2.0.1.0 - 64bit production) from an Ubuntu 12.04.1 LTS server. We are running Node v0.10.12 and the nearinfinity node-oracle module 0.3.1. There are other posts here on stackoverflow that talk about the other node oracle module node-db-oracle, but that version is no longer maintained and cannot be built with Node 0.10.12 due to node-waf being deprecated.

Even the tiniest Node program will not connect even though using the same connection info we can connect from the sqlplus64 client and a simple 3 line PHP program. We have tried all the different options for connecting, such as specifying all the connection info in the json passed to connect function, specifying just user, password, and referencing a connection string in the oracle tnsnames.ora file, or even passing the connection string directly to the json. We get one of two errors:

Error: ORA-12154: TNS:could not resolve the connect identifier specified

or if we change the parameters a bit:

Error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I have tried connecting to different Oracle servers in our datacenter: one single server using the SID=databasename convention and a RAC system using the SERVICE_NAME=database_servicename convention. Same story both cases.

I have looked at all the other Node.js/Oracle posts here and have tried everything they speak of. Firing up sqlplus64 username/password@SID_NAME connects immediately. I am beginning to conclude that the combination of versions I am using simply do not work together. Any ideas?


Solution

  • The solution was to use a recent patch to the module that hasn't been released yet. The current release is 0.3.1 of node-oracle. That version does not have the TNS support fix. If you check out the latest code for the module from github to a new directory and build it there ('npm link' in that directory) and then do npm link oracle from your project directory you will get the new version with the fix. We had to work through a number of permission problem which are most likely platform specific so I won't delve into those here. I have requested that the authors of the module release this patched version soon presumable as 0.3.2.