question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

conn.login not working when hosted on AWS Lambda with Node8.10

See original GitHub issue

Hello everyone,

I am currently running a script on AWS Lambda using jsforce. I need to update the runtime from Node6.10 to 8.10. However, while I manage to make the script work locally with the 8.10 version, it is not working on AWS Lambda.

For some reasons, this piece of code is not working anymore on AWS Lambda.

let connnection = new jsforce.Connection( { loginUrl: 'https://eu16.salesforce.com' } );
connnection.login( config.get( 'salesforce_login' ), config.get( 'salesforce_password' ), function( err ) {
        if ( err ) { return logger.error( err, true ); }
        instance = connnection.instanceUrl;
        token = connnection.accessToken;
} );

Any idea about what could be the issue ?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

4reactions
dhenardcommented, Sep 25, 2019

Did you find a solution? I’m trying with Node.js 10.x on AWS and what works locally to login is not working on AWS lambda.

Update: I removed the async keyword from exports.handler = (event) => { line and was able to login.

0reactions
kwabena53commented, Jun 16, 2022

Did you find a solution? I’m trying with Node.js 10.x on AWS and what works locally to login is not working on AWS lambda.

Update: I removed the async keyword from exports.handler = (event) => { line and was able to login.

This is what worked for me. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot networking issues in Lambda
Issue : Your Lambda function needs access to AWS services without using the internet. To connect a function to AWS services from a...
Read more >
Troubleshoot Lambda function failures in Amazon Connect
The AWS Lambda function that I added to my Amazon Connect instance fails to invoke when my contact flow tries to invoke the...
Read more >
AWS Lambda function errors in Node.js
exports.handler = async function() { return x + 10 }. This code results in a reference error. Lambda catches the error and generates...
Read more >
Troubleshoot invocation issues in Lambda
Error : EFSMountConnectivityException: The function couldn't connect to the Amazon EFS file system with access point arn:aws:elasticfilesystem:us-east-2: ...
Read more >
Invoke Lambda with Step Functions
Step Functions can control certain AWS services directly from the Amazon States Language. For more information about working with AWS Step Functions and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found