1

I am trying to validate App Check tokens from my AWS lambda in python under the x86_64 architecture.

When i execute my AWS lambda, i got the following error :

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': /var/task/cryptography/hazmat/bindings/_rust.abi3.so: invalid ELF header
Traceback (most recent call last):

I have seen this answer but i am working on MacOS x86_64 so i have the same architecture as the target.

How can i solve this issue since it seems i have compiled it in the correct architecture ?

Note : I know that this is from Firebase App Check because it's the only dependency i have in my lambda and if i remove it everything is fine.

EDIT : here is my other question very related to this one. If someone answers the other, i will just have to compile firebase-admin on my docker ubuntu container.

Tom3652
  • 2,540
  • 3
  • 19
  • 45

1 Answers1

0

I was also facing the same issue, in my case I was using M1 Mac. To fix this I used the following code to install firebase-admin

pip install \
    --platform manylinux2014_aarch64 \
    --target=./package \
    --implementation cp \
    --python 3.9 \
    --only-binary=:all: --upgrade \
    firebase-admin

If you are using x86_64, you can use the following:

pip install \
    --platform manylinux2014_2014_x86_64 \
    --target=./python/lib/python3.9/site-packages \
    --implementation cp \
    --python 3.9 \
    --only-binary=:all: --upgrade \
    firebase-admin
Jazib Khan
  • 408
  • 4
  • 13