-
Notifications
You must be signed in to change notification settings - Fork 143
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
aws_xray_sdk.core.exceptions.exceptions.SegmentNotFoundException: cannot find the current segment/subsegment, please make sure you have a segment open #148
Comments
I believe that this is a known limitation when running Django locally. Please read more about it here. Specifically, it looks like the migrator is attempting to create a subsegment when no parent segment exists. The documentation talks about how
Would you be able to try that and see if it solves your problem? |
I tried the
|
Tried beginning a segment in Did some debugging there, it looks like
|
(this is with psycopg2==2.7.7) |
Yeah, if I do:
I don't get the error. |
The problem is really this:
Since the |
Nice job finding the root cause of the issue :)! This is definitely something that will need some further investigation on my end. Does the solution you showed cause any other issues with your application? Is it a viable solution for now until we are able to find a more generalized solution with X-Ray? |
This is not really a solution, I was only able to do this in a ipdb debugging session. One option could be to have a separate settings file for migration (with no xray), but since the real issue is the incompatibility between the wrapped db connection and psycopg2, there could be other things at risk. It looks to me like that this should ideally be fixed in I'll need to put the integration on hold until this is resolved. Happy to help if I can. |
For now, I'll mark this as a bug until we can dig deeper to find a solution. As you had mentioned, it looks like the main issue is that |
I have the same problem, and I am reading about lambda-powertools: |
With a basic integration, as described in #147 , I can't migrate my database.
When I'm trying to run
./manage.py migrate
, I getThe text was updated successfully, but these errors were encountered: