version.js from https://github.com/oracle/node-oracledb/blob/master/examples/version.jsNode.js version: 6.9.1, 64-bit
Node-oracledb version: 2.3.0
npm run start
What error(s) you are seeing?

What OS (and version) is Node.js executing on?
MacOS version: 10.13.6

I am not sure, I just tried to use this guide: https://oracle.github.io/node-oracledb/INSTALL.html#instosx and although the app runs and I can debug, I get the error above.
PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) set to? On macOS, what is in ~/lib?
I am not sure exactly
Top of my oracle.js file with create pool function (code formatting not working here for me so using screenshot):

Connect:
` connect() {
var connAttrs = (this.creds.poolAlias) ? this.creds.poolAlias : this.creds;
return oracledb.getConnection(connAttrs)
.catch((err) => {
debug('connect failed');
if (_.isUndefined(this.creds.poolAlias)) {
throw new Error(err);
}
else {
return this._catchPoolErr(err, this.creds.poolAlias)
.then(() => {
this.connect();
});
}
});
},`
Try to createPool if does not exist:
` _catchPoolErr(err, poolAlias) {
// connection pool not found. create and reconnect
if (err.toString().match('NJS-047')) {
debug(`connection pool ${poolAlias} not found. Will request creation`);
return this.createPool(poolAlias);
}
else {
throw new Error(err);
}
}`
@rstor1 The way you've written the code, you don't create the pool until a connection request is made. But what happens if two connection requests are made at the same time? That's probably what's leading to the error.
I tend to avoid this alltogether by creating the pool first, just get that out of the way, and then open up the other parts of the app that would service requests. I show how to do this with REST APIs here:
https://jsao.io/2018/03/creating-a-rest-api-with-node-js-and-oracle-database/
It's off topic, but I'm curious, why do you throw a new error
throw new Error(err);
instead of just throwing the existing error?
throw err;
@rstor1 there are also some basic pool examples in the webapp*.js files, e.g. webappawait.js.
@dmcghan thanks for the feeback, will look into this! I guess I should state that I did not write this code, I am helping maintaining and debug an existing service so I am not sure why the decision on throwing the new error. That could be another possible improvement though thanks!
@cjbj thanks for pointing me to the right examples!