Comments (9)
I have the similar issue with Python 3.11.4.
When I add "from aws_xray_sdk.core import patch_all" to my lambda handler, I see below error:
[ERROR] Runtime.ImportModuleError: Unable to import module 'handler': cannot import name 'formatargspec' from 'inspect' (/var/lang/lib/python3.11/inspect.py)
from aws-xray-sdk-python.
It looks formatargspec
function has been deprecated which is not supported in Python 3.12.
DeprecationWarning: formatargspec is deprecated since Python 3.5. Use signature and the Signature object directly
from aws-xray-sdk-python.
it looks like aws-xray-sdk uses a package called wrapt which uses formatargspec
I think this is what is causing the error - please could you look into this
from aws-xray-sdk-python.
Hello, I've reproduced this error. It looks like this error occurs due to using wrapt versions < 1.14.
I've tested that customers error appears using wrapt==1.13.3
when installing my requirements.txt. I've tested that this error is gone when using wrapt==1.14
after deleting the previous installation of wrapt
.
Could you check your wrapt
version, remove the current version if it is older than 1.14, and upgrade to newer version?
from aws-xray-sdk-python.
unfortunately am still getting the same error when deploying the aws chalice lambda function
from aws-xray-sdk-python.
When tested on my end with Chalice, I had to delete all the current downloaded dependencies (including wrapt) and then reinstall with pip3 install -r requirements.txt -t .
to apply the updated wrapt, else I would still get the previous error. Have you tried deleting previous version of wrapt in your Lambda?
from aws-xray-sdk-python.
yes
from aws-xray-sdk-python.
My repro attempt steps:
Followed guide in https://github.com/aws/chalice?tab=readme-ov-file#quickstart until Deploying
section.
python3.12 -m ensurepip --upgrade
->installed pip-23.2.1
python --version
->Python 3.12.1
requirements.txt
includes:
chalice==1.31.0
aws-xray-sdk==2.12.0
wrapt==1.16
- Modified
app.py
to include:
import json
from chalice import Chalice
from aws_xray_sdk.core import patch_all, xray_recorder
- Ran:
pip3 install -r requirements.txt -t .
chalice deploy
- Lambda confirmed to use Python 12 and executes with no error.
With this setup, I cannot reproduce issue. Changing wrapt
version to 1.13.3
will reproduce the error, but then deleting all vendored dependencies and then removing wrapt
entirely from requirements.txt will also fix the error when running chalice deploy
.
@Newlevel462 Is there any other info you can provide about your chalice app configuration? Current I assume that the XRay Python SDK is compatible with Python 12 since I was able to get it working with the above repro steps. Possibly there is a configuration issue with the Chalice Application on your end. Perhaps, could you provide pip3 version you are using?
from aws-xray-sdk-python.
thanks it works now
from aws-xray-sdk-python.
Related Issues (20)
- EKSPlugin HOT 1
- Very rare ReferenceError HOT 2
- Support for psycopg3 HOT 2
- Link a Textract async operation with downstream process HOT 1
- Current tox versions do not like how testenv.passenv is set
- aws_xray_sdk.core.exceptions.exceptions.SegmentNameMissingException: Segment name is required. HOT 1
- Using psycopg2 connection_factory throws exceptions HOT 4
- Documentation for patch_all HOT 2
- Sampling configuration should discuss DefaultSampler vs. LocalSampler HOT 1
- Flask middleware errors when an earlier Flask extension throws an exception in a before_request method HOT 1
- Patched DB cursor and template may record outside of XRayMiddleware HOT 2
- Segment not propgated when subsegment metadata is sufficiently long HOT 4
- sqlalchemy_core patch errors for unencoded special characters in db url HOT 1
- Error when using AsyncContext in python 3.11.5 HOT 3
- MongoDB AttributeError: 'NoneType' object has no attribute 'put_annotation'
- Fix docstring in Entity.close() HOT 1
- No supported for fastAPI, need to add middleware for fastapi HOT 1
- Incompatible with Pynamodb 6.x HOT 4
- trace simple websocket messages - python HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-xray-sdk-python.