Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scrapex opened this issue Nov 29, 2017 · 0 comments
Open

Comments

@scrapex
Copy link

scrapex commented Nov 29, 2017

I keep getting the following error when running the lambda in aws "ORA-12154: TNS:could not resolve the connect identifier specified". The connection works fine when I try running on my local windows machine or even in an EC2 instance. The issue only happens when deploying on lambda.

I am running Nodejs 6.3 and have included all the necessary libraries. There seems to be an issue with the connection string but it works fine else where.

`exports.handler = function(event, context, callback) {
console.log('event:', event);
console.log('context:', context);
try {
oracledb = require('oracledb-for-lambda');
console.log('oracledb: supported');

  var conn = {
	  user: "my user",
	  password: "my password",
	  connectString: "DOMAIN:PORT/DATABASE",
	  externalAuth: false
	};

  oracledb.getConnection(conn, (err, connection) => {
	if (err) {
	  console.log("connection ERROR.."); ->> CODE FAILS HERE
	  console.error(err.message);
	  return;
	}
	console.log("connection successful..");
  });
	

} catch (e) {
    console.log('Failed to load oracledb:');
    console.log(e);
    callback('Failed to load oracledb');
}

if (oracledb != null) {
    callback(null, 'Oracle DB is supported');
} else {
    callback('Did not actually expect to see this, `require(\'oracledb\')` will fail');
}

};
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant