Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError when using AWS X-Ray SDK with SQLAlchemy #392

Open
tomeszmh opened this issue May 30, 2023 · 1 comment
Open

IndexError when using AWS X-Ray SDK with SQLAlchemy #392

tomeszmh opened this issue May 30, 2023 · 1 comment
Assignees
Labels

Comments

@tomeszmh
Copy link

I am encountering an issue when using the AWS X-Ray SDK to trace my AWS Lambda function, which utilizes SQLAlchemy for database operations. When invoking the Lambda function, I receive the following error:

Error getting the sanitized query
Traceback (most recent call last):
  File "/opt/python/aws_xray_sdk/ext/sqlalchemy_core/patch.py", line 46, in _sql_meta
    if isinstance(args[0], ClauseElement):
IndexError: tuple index out of range

I am using the patch_all() function from the AWS X-Ray SDK to patch all available libraries, including SQLAlchemy:
Could you please help me understand the cause of this error and suggest a possible solution? Let me know if you need more information about my implementation or environment.

aws_xray_sdk == 2.12.0
Sqlalchemy == 2.0.14

I added lambda Active tracing too.

Many thanks

@carolabadeer
Copy link
Contributor

The X-Ray Python SDK is currently only compatible with SQLAlchemy < 2.0.0 since v2.0.0 introduced breaking changes, please see #381. We can keep this issue open to track support for SQLAlchemy >= 2.0.0 but, in the meantime, using SQLAlchemy 1.x should resolve this error

@carolabadeer carolabadeer self-assigned this Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants