DataDog / dd-trace-py

Datadog Python APM Client
https://ddtrace.readthedocs.io/
Other
507 stars 398 forks source link

Using ddtrace-run together with `gUnicorn` causes all `Spyne` SOAP endpoints to break. #9500

Open jur-clerkx opened 1 month ago

jur-clerkx commented 1 month ago

Summary of problem

Which version of dd-trace-py are you using?

2.8.5

Which version of pip are you using?

23.3.2

Which libraries and their versions are you using?

Django 4.2 Python 3.10 Spyne 2.14

`pip freeze` asgiref==3.8.1 attrs==23.2.0 bytecode==0.15.1 cattrs==23.2.3 ddsketch==3.0.1 ddtrace==2.8.5 Deprecated==1.2.14 Django==4.2 envier==0.5.1 exceptiongroup==1.2.1 gunicorn==22.0.0 importlib_metadata==7.1.0 lxml==5.2.2 opentelemetry-api==1.25.0 packaging==24.1 protobuf==5.27.1 pydevd-pycharm==232.10227.11 pytz==2024.1 six==1.16.0 spyne==2.14.0 sqlparse==0.5.0 typing_extensions==4.12.2 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.19.2

How can we reproduce your problem?

I created a repository for reproduction: https://github.com/jur-clerkx/ddtrace-django-spyne-reproduction Follow the guide in the readme to reproduce. Would suggest to use SOAP UI for the SOAP messaging. You can fetch the wsdl from the /soap?wsdl endpoint.

What is the result that you get?

Spyne breaks into an error. When removing ddtrace-run from our docker container, everything works as expected. After doing some remote debugging into the ddtrace-run gunicorn process, we saw that the spyne code always receives a wsgi.input object that is empty in the request.META object from Django. This is not the case when we don't use ddtrace-run.

What is the result that you expected?

Spyne works correctly, also with ddtrace-run.

emmettbutler commented 1 month ago

@jur-clerkx Thank you for reporting this issue, and for the replication code! We'll take a look.

MDaams commented 2 weeks ago

Hi @emmettbutler,

Is there any update on this? Do you have enough information to get started?

emmettbutler commented 2 weeks ago

We haven't been able to look into this yet. The reproduction does look like it provides enough information to get started.

cc @mabdinur