-
Notifications
You must be signed in to change notification settings - Fork 246
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
Run into Could not start SASL: Error in sasl_client_start (-4) SASL(-4) when using AWS Lambda #201
Comments
Can you show what you have tried? (code) |
Hi Wes, Thanks for your reply. Here is my code. from impala.dbapi import connect conn = connect('ec2-54-152-186-202.compute-1.amazonaws.com', port=10000, auth_mechanism='PLAIN') def handler(event, context): It runs well on my mac and ec2 instance, but not AWS Lambda I installed: It looks like under the /usr/lib64/ of the ec2 instance there is a sasl2 and libsasl2.so which should be part of the deployment package. I should I set the path for this, looks like the error comes from thrift_sasl. How can I build it with all the dependencies on linux(EC2 for my case)? Thanks! |
Here's an example. https://github.com/jkehler/awslambda-psycopg2 |
I've just spent a fair bit of time getting this working in AWS Lambda, so I'm updating here for future reference. I encountered the same error from thrift_sasl: "Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found" We do not have to statically link these libraries. We need to make sure the shared objects are packaged with our Lambda function, so copy both libsasl2.so and the contents of /usr/lib64/sasl2/ to a folder named 'lib' in the root of your Lambda function package. LD_LIBRARY_PATH is set in Lambda to look in this location when the function runs. libsasl2.so will still try to look for libraries in the /usr/lib64/sasl2 location. In order to have it look in the lib folder where our Lambda function exists, we need to set SAML_PATH. This can be done at the top of your function code before importing thrift_sasl (or importing the dependent module):
Note: make sure you are copying the libraries from the same ami that Lambda uses: http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html |
Hi, I had the same issue, and followed your procedure with no success. |
I was able to resolve this using @alexgibs #201 (comment) solution but I needed to add additional packages before copying the contents of
For the env var I used |
If you are using ldap as a authentication then install library using |
I followed below step but still I am unable to establish connection to Hive from Lambda
• sudo yum update -y
Refer attached screenshot sasl library files kept inside lib folder.png file
Couple of things to note here Refer the attached screenshot sasl code files kept inside sasl folder.png for reference Can someone please guide me how can I resolve above errors and establish connection to Hive from Lambda |
I'm trying to use impyla with aws lambda function. Everything worked well when I run the code on the ec2 instance running Linux. However, when I build the deployment package which include sasl, thrift_sasl and impyla modules and test my code in lambda, it gave me the error: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
I notice a lot of people reporting this error but it works for me on linux without issues. Since lambda requires supplying all the libraries in the deployment package, I think there must be something missing if I just supply the three module listed above. What libs dependencies does sasl require? I need to rebuild the module with the missing dependencies and make them part of the package.
Thanks!
The text was updated successfully, but these errors were encountered: