https://supertokens.com/ logo
Title
s

soysushi

11/26/2022, 12:49 AM
Hi! I have a question regarding setting it up as a Lambda Layer. I followed the tutorial but I am getting this error
[ERROR] Runtime.ImportModuleError: Unable to import module 'handler': /opt/python/cryptography/hazmat/bindings/_rust.abi3.so: invalid ELF header
Traceback (most recent call last)
I have spent the whole day to see if it was an issue with the architecture (x86_64), but it wasn't. I had success bunching up all the packages with my m1 mac with boto3. I am stumped here. Is there any advice?
r

rp

11/26/2022, 2:48 AM
Hey @soysushi
@KShivendu can help here.
k

KShivendu

11/26/2022, 3:12 AM
Hey @soysushi, the error seems related to cryptography library. Can you try installing and zipping the requirements in a Linux environment (using docker) and loading it into AWS lambda layer? alternatively, you may try a different version of the cryptography library.
Hi @soysushi did this suggestion help you? if not, feel free to provide more details and I'll be happy to help 😄
s

soysushi

11/27/2022, 7:42 PM
I'll be trying this out on Monday when I'm back at work haha. Thank you guys for the super prompt response!
now i have a different error
[ERROR] Runtime.ImportModuleError: Unable to import module 'handler': /opt/python/cryptography/hazmat/bindings/_rust.abi3.so: cannot open shared object file: No such file or directory
Traceback (most recent call last)
do i have to put the crypt onto another layer perhaps?
k

KShivendu

11/30/2022, 3:56 AM
no you don't need to. what exactly did you try, docker or downgrading?
s

soysushi

11/30/2022, 5:49 PM
i started a docker container that is running in a Linux environment. I installed the same python and pip as my local machine. I followed the tutorial to zip the package and upload it to an AWS layer
our team is currently trying it with NodeJS and I am traversing stackoverflow.
r

rp

11/30/2022, 5:57 PM
Alright. Let us know if you face issues with node
k

KShivendu

12/01/2022, 5:47 AM
@soysushi what version of python are you using? I can do the bundling for you.
We are considering generating .zip files for the lambda layer along with every release. This will make the lambda auth steps seamless. It will be implemented soon.