[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'aws_xray_sdk'
- Lingua principale
- Python
- Stelle
- 338
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi,
I am using AWS Codestar to develop a python lambda function.
I added X-Ray support following https://docs.aws.amazon.com/codestar/latest/userguide/customize-project-xray.html and added pip install aws-xray-sdk to my buildspec.yml
# Upgrade AWS CLI to the latest version
- pip install --upgrade awscli
# Upgrade AWS X-Ray SDK
- pip install --upgrade aws-xray-sdk
Add instrumented my code as per https://docs.aws.amazon.com/lambda/latest/dg/python-tracing.html.
But CloudWatch Logs always show this error.
> START RequestId: f785062e-6687-496a-91a9-653e0127d2d0 Version: 8
>
> [ERROR] Runtime.ImportModuleError: Unable to import module 'lambda/s3_trigger_start_notebook_function': No module named 'aws_xray_sdk'
>
> END RequestId: f785062e-6687-496a-91a9-653e0127d2d0
>
> REPORT RequestId: f785062e-6687-496a-91a9-653e0127d2d0 Duration: 13.87 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 69 MB Init Duration: 293.24 ms
> XRAY TraceId: 1-5de586ab-3073f132c67bc0163d18fd9b SegmentId: 1ebd10451b253bf7 Sampled: true
>
There is no requirements.txt by default in CodeStar projects. What is missing here?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da buildspec.yml e ispeziona l’artefatto Lambda distribuito per verificare se aws_xray_sdk è incluso insieme al codice della funzione. Confronta i passaggi di packaging con le guide collegate su AWS CodeStar e il tracing di Lambda; il lavoro è completato quando la funzione distribuita importa l’SDK senza che si verifichi Runtime.ImportModuleError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, python
- Ambito
- backend, cloud
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100