Skip to content

AWS Lambda - Error segmentation fault #1737

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

Open
ThiagoFrancaPacheco opened this issue Apr 24, 2025 · 7 comments
Open

AWS Lambda - Error segmentation fault #1737

ThiagoFrancaPacheco opened this issue Apr 24, 2025 · 7 comments
Labels

Comments

@ThiagoFrancaPacheco
Copy link

In Aws Lambda, when trying to use Thick Mode, when calling the oracledb.initOracleClient() method, I am getting the following error:

Error: Runtime exited with error: signal: segmentation fault

@sharadraju
Copy link
Member

sharadraju commented Apr 25, 2025

Hi @ThiagoFrancaPacheco Thank you for using node-oracledb.
Can you please provide us more information on this:

  • What is the Oracle DB version and Oracle Client version used?
  • What node-oracledb version are you using?
  • Was it working in earlier node-oracledb versions and Oracle Client versions?

Note that we do not test in AWS Lambda, but we can try to see from our end, if we can do anything to help.
Please provide a sample test case. Is this use case working in a non-AWS Lambda environment.

@ThiagoFrancaPacheco
Copy link
Author

Hello @sharadraju , thanks for the reply.

I'm trying to connect in Thick Mode to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit.

Node-oracledb version: 6.8.0

I've tested many versions of Oracle Instant Client Linux x86/64, including 19.27, 21.18 and 23.7

This is a new project, locally it works using Oracle Instant Client for Mac, on AWS Lambda the error mentioned occurs.

If I remove the line "oracledb.initOracleClient();" from the code, the error NJS-138 occurs, when I add initOracleClient it gives the error: Error: Runtime exited with error: signal: segmentation fault

@sudarshan12s
Copy link

Hello @sharadraju , thanks for the reply.

I'm trying to connect in Thick Mode to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit.

Node-oracledb version: 6.8.0

I've tested many versions of Oracle Instant Client Linux x86/64, including 19.27, 21.18 and 23.7

This is a new project, locally it works using Oracle Instant Client for Mac, on AWS Lambda the error mentioned occurs.

If I remove the line "oracledb.initOracleClient();" from the code, the error NJS-138 occurs, when I add initOracleClient it gives the error: Error: Runtime exited with error: signal: segmentation fault

Hi @ThiagoFrancaPacheco , When you remove oracledb.initOracleClient(), the driver runs in thin mode and thin mode does not support oracle database 11.2.0.3.0. Hence you got error NJS-138. For thick mode ( oracledb.initOracleClient()), If it does not work in AWS Lambda environment, it could be glibc compatibility.. but I am not sure. The instant client glibc compatibility is listed here . What was the Lambda environment glibc version (ldd --version)

@ThiagoFrancaPacheco
Copy link
Author

Hello @sudarshan12s.

The version of glibc in the AL2023 base image has been upgraded to 2.34, from 2.26 that was bundled in the AL2 base image. Some libraries that developers wanted to use in provided runtimes required newer versions of glibc. With this launch, you can now use an up-to-date version of glibc with your Lambda function.

@ThiagoFrancaPacheco
Copy link
Author

ldd (GNU libc) 2.34
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

@sudarshan12s
Copy link

sudarshan12s commented Apr 28, 2025

ldd (GNU libc) 2.34

Thanks @ThiagoFrancaPacheco!
Could you please check or share the following details:

  • Provide the ODPI-C logs (export DPI_DEBUG_LEVEL=92) and a stack trace, if available.

  • Did you try different Oracle Linux versions (OL9, OL8, OL7, etc.)? Also, could you confirm which zip file you used from the Instant Client downloads? The RPM packages, when extracted, may be quite large and could exceed Lambda size limits. You were just using the available zip file from the downloads?

  • Share the list of installed libraries from the Instant Client (based on the path specified in libDir during initOracleClient, or from LD_LIBRARY_PATH).

@ThiagoFrancaPacheco
Copy link
Author

Hello @sudarshan12s

I will try to get the information you requested and send it here.

Since my project needed to be published urgently, I changed its architecture and published it on Elastic Beanstalk and it worked.

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

No branches or pull requests

3 participants