-
Notifications
You must be signed in to change notification settings - Fork 395
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
DatabaseError with ddtrace #435
Comments
Hello @szaboat ! can you check if you still have this issue with the latest version? https://github.com/DataDog/dd-trace-py/releases/tag/v0.11.1 We did a change in how Django is instrumented (I see you're using also Django), so maybe that problem was connected with another one. If it's not working, let us know so we can investigate more. Thank you! |
Unfortunately it's not working and we are getting the same error with
|
@szaboat ok it wasn't connected to this problem. Let me schedule some work on it, so that I can reach you back with a realistic ETA for the fix. Thanks for reporting that! |
Same issue for me, cant use ddtrace the way this is. |
@palazzem Any update on this? We're evaluating datadog on our Python3.6 infrastructure and this is a blocker atm. ddtrace==0.12.0 Here is the supervisord config for uwsgi+gevent+django app which is reverse proxied with nginx.
We tried disabling gevent to see if that resolves the issue but it didn't. It's not working with the default django postgres db engine too. @szaboat Did you find the fix? |
@babu-upcomer unfortunately not and it also became a blocker for us. we didn't have time to debug it, so we are not using dd-trace now. sad but true. |
Hello @babu-upcomer and thanks for sharing your details! We're actually planning to make some changes for this instrumentation because it doesn't play very well on some use cases. Unfortunately it's taking a bit more time because we need to investigate how to make it work even for use cases we're already supporting. @szaboat I'm sorry about that! One thing I would like to ask is if you're using I'll keep you both updated! |
@szaboat Ok. Till then following your blog post here we have done only the integration in the Django settings without encapsulating ddtrace-run with the wsgi server command. That is,
and can see partial traces, sometimes the 'web' service dashboard shows Also is it mandatory to encapsulate the wsgi server command with ddtrace-run or just adding 'ddtrace.contrib.django' in the INSTALLED_APPS would be enough? This part is never been clear in any of your docs as I can see the partial traces even without configuring ddtrace-run. |
Thank you for the feedbacks! |
|
OK thanks for all the details. I'll proceed the investigation and will reach you back today with more questions. Actually I think I've reproduced the problem with your configurations. I'll keep you all updated! |
After investigating the problem, I may have found the root cause (or at least one of them). For now, let's focus in using the If the application runs as expected, we can say the issue is solved. Then we can chat about other remaining issues that are (if I didn't miss something):
Using only the Django app, will not instrument other libraries. Thanks for pushing the resolution of this (critical) issue. |
@palazzem I'll test in my local and let you know. |
Thank you very much! |
@palazzem Can't install from that PR. I guess your fork is not public. How could I install that commit using pip or should I wait till it is merged with origin master? |
I think you can install it via pip:
or in your
Does it work using |
Tested in my local, it worked. The error is not occurring. Btw, when you said the request is not automatically patched and needs to be patched manually, can it be set in the django settings module? Like this,
Because we have a tens of workers and other python manage.py commands being spawned up along with the uwsgi web server. All share the common django settings.py and setting this there would be more easier. |
@babu-upcomer great! I'm going to merge that PR closing this issue then. I'll move the chat in another thread so I can provide a better support for this other problem. I'll ping you there: #485 Thank you very much everyone and feel free to re-open the issue if you think it's not solved! The release will be out this week. Sorry for the delay in the release, but we prefer to verify with the community that the problem is really solved, and it took a bit more. |
This issue started reappearing from ddtrace 0.16. We are stuck with 0.15.0. Using Django+gunicorn with gevent workers. |
@palazzem Any update? |
Hello @babu-upcomer ! Thanks to report that! we'll reach you back as soon we have news to share! |
@palazzem This is our current stack. We switched to gunicorn+gevent workers later but again stuck with the 0.15. |
[Solution included] We had similar problem. Running Our stack:
Solution export DATADOG_PATCH_MODULES="gevent:true,django:false"
ddtrace-run gunicorn ... Then in the # settings.py
from ddtrace import config, patch
patch(django=True) Hope it helps someone to not waste a week debugging this :D |
ddtrace created a
DatabaseWrapper
in a different thread. And an exception is raised when the save called on the model.Current dependencies
The text was updated successfully, but these errors were encountered: