title: Oracle with node-oracle: Error while trying to retrieve text for error ORA-01804
body: <p>I'm trying to use <a href="https://github.com/joeferner/node-oracle" rel="nofollow noreferrer">node-oracle</a> to connect to a Oracle 11g database in UNIX. I can connect fine to the database using TOAD, but now I want to do application queries and this is what I did:</p>
  
  <p>NodeJS code:</p>
  
  <pre><code>var oracle = require('oracle');
  
  var connectData = {
    hostname: "host.com",
    port: 1521,
    database: "DB0000",
    user: "me",
    password: "password"
  }
  
  oracle.connect(connectData, function(err, connection) {
    if (err) { console.log("Error connecting to db:", err); return; }
  
    connection.execute("SELECT systimestamp FROM dual", [], function(err, results) {
      if (err) { console.log("Error executing query:", err); return; }
  
      console.log(results);
      connection.close();
    });
  });
  </code></pre>
  
  <p>Then I this command on the unix box:</p>
  
  <pre><code>sh-3.2$ OCI_LIB_DIR= /oracle/client/v11.2.0.2-64bit/client_1/lib/ OCI_INCLUDE_DIR=/client/v11.2.0.2-64bit/client_1/rdbms/public/ OCI_HOME=/oracle/clien
  t/v11.2.0.2-64bit/client_1/ NLS_LANG=.UTF8 LD_LIBRARY_PATH=/client/v11.2.0.2-64bit/client_1/lib/ /bin/node app.js
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>terminate called after throwing an instance of 'oracle::occi::SQLException'
    what():  Error while trying to retrieve text for error ORA-01804
  </code></pre>
  
  <p>Some notes:</p>
  
  <ul>
  <li>I haven't set up env variables properly yet, this was my first test, thus the long <code>node</code> command.</li>
  <li>the paths are similar to those described but I removed the prefixes which would tie this to my company</li>
  </ul>
  
  <p>I've looked around the web and a lot of people point this to a poorly configured <code>LD_LIBRARY_PATH</code> variable. If I <code>ls</code> that folder I get:</p>
  
  <pre><code>acfslib.pm          libclient11.a      libgnsjni11.so     libmm.a        libntcpaio11.so        liboraz.a          libsql11.a          naect_std.o.dbl             sscoreed.o
  acfsroot.pl         libclntsh.so       libhasgen11.so     libn11.a       libntcps11.a           liborion11.a       libsqlplus.a        naedhs.o                    stubs
  acfstoolsdriver.sh  libclntsh.so.10.1  libheteroxa11.so   libnbeq11.a    libntcps11_std.a.dbl   libowm2.so         libsqlplus.so       naeet.o                     sysliblist
  activation.jar      libclntsh.so.11.1  libimf.a           libncrypt11.a  libntns11.a            libplc11.a         libsqora.so.11.1    naeet_std.o.dbl             transx.zip
  classgen.jar        libclntst11.a      libintlc.so.5      libnhost11.a   libnus11.a             libplc11_pic.a     libsrvm11.so        nautab.o                    xmlcomp2.jar
  clntsh.map          libclsra11.so      libipgo.a          libnjni11.so   libnzjs11.a            libplp11.a         libsrvmhas11.so     nautab_std.o.dbl            xmlcomp.jar
  facility.lis        libcommon11.a      libipp_bz2.a       libnl11.a      libocci11.a            libplp11_pic.a     libsrvmocr11.so     nigcon.o                    xml.jar
  jcr-1.0.jar         libcore11.a        libippcore.a       libnldap11.a   libocci.so             libpls11.a         libsvml.a           nigtab.o                    xmlmesg.jar
  jdev-rt.zip         libcorejava.so     libippdcemerged.a  libnls11.a     libocci.so.11.1        libpls11_pic.a     libuini11.so        nnfgt.o                     xmlparserv2.jar
  lclasses12.zip      libcxaguard.so.5   libippdcmerged.a   libnnet11.a    libocijdbc11.so        libpsa11.a         libunls11.a         ntcontab.o                  xmlparserv2_jaxp_services.jar
  lclasses14.zip      libdbcfg11.so      libippsemerged.a   libnnetd11.a   libocr11.so            librdjni11.so      libvsn11.a          ojcr.jar                    xmlparserv2_sans_jaxp_services.jar
  ldflags             libeons.so         libippsmerged.a    libnnz11.a     libocrb11.so           libskgxn2.so       libvsn11_std.a.dbl  oraclexsql.jar              xschema.jar
  ldflagsO            libexpat.a         libipp_z.a         libnnz11.so    libocrutl11.so         libskgxp11.so      libwwg.a            osds_acfslib.pm             xsqlserializers.jar
  libagent11.a        libexpat.la        libirc.a           libnoname11.a  liboevm.a              libskgxpcompat.so  libxdb.so           osds_acfsroot.pm            xsu12.jar
  libagfw11.so        libexpat.so        libldapclnt11.a    libnque11.so   libons.so              libskgxpd.so       libxml11.a          osds_unix_linux_acfslib.pm
  libagtsh.so         libexpat.so.1      libldapjclnt11.a   libnro11.a     libonsx.so             libskgxpg.so       libzt11.a           osntabst.o
  libagtsh.so.1.0     libexpat.so.1.5.2  libldapjclnt11.so  libnsgr11.a    liborabz2.a            libskgxpr.so       libztkg11.a         s0main.o
  libasmclntsh11.so   libgeneric11.a     liblxled.a         libnsslb11.a   liborasdkbase.so.11.1  libslax11.a        mail.jar            schagent.jar
  libcell11.so        libgns11.so        liblzopro.a        libntcp11.a    liborasdk.so.11.1      libsnls11.a        naect.o             scorept.o
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>I've looked at these question, but although similar I couldn't troubleshoot my problem with them:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/12560925/error-while-trying-to-retrieve-text-for-error-ora-01019">Error while trying to retrieve text for error ORA-01019</a></li>
  <li><a href="https://stackoverflow.com/questions/12837811/error-while-trying-to-retrieve-text-for-error-ora-01804">Error while trying to retrieve text for error ORA-01804</a></li>
  </ul>
  
  <p>Cheers.</p>