Unable to import module '[module_name]': /var/task/Crypto/Cipher/_AES.so: invalid ELF header
See original GitHub issueI’m trying to use credstash to retrieve credentials in an aws lambda function e.g.
from credstash import getSecret
password = getSecret(USERNAME)
But I’m getting the following error when the function runs:
Unable to import module '[module_name]': /var/task/Crypto/Cipher/_AES.so: invalid ELF header
I’m not sure what the cause is. My lambda function lives in a virtualenv, and when I deploy I copy the contents of lib/python2.7/site-packages/ into the zip. Do you have any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
aws - "Unable to import module 'process': /var/task/numpy/core ...
The problem has to do with the multiarray.so file which was complied on my local computer's architecture. Spin up an ec2 instance and...
Read more >How to resolve an invalid ELF header error quickly
Are you experiencing an “Invalid ELF header” error when executing your AWS Lambda? If so, you have came to the right place for...
Read more >Faild to launch flatpak "Bottles". Getting libgtk-4.so.1 invalid ...
Getting libgtk-4.so.1 invalid ELF header issue ... File "/app/bin/bottles", line 43, in <module> from bottles.frontend import main File ...
Read more >AWS lambda layers / package import issues - Reddit
"errorMessage": "Unable to import module 'lambda_function': /var/task/nacl/_sodium.abi3.so: invalid ELF header","errorType": "Runtime.
Read more >apache2 invalid elf header - Google Groups
New install of SO as a server. ... into server: /usr/lib/apache2/modules/mod_alias.so: invalid ELF header. Action 'restart' failed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The python openssl library brings a shared library along with it. You want to make sure you build your virtualenv on a linux box. If you build it on OSX, the shared library will be build for OSX, not for linux.
Thanks a million @alex-luminal saved my day!