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

dj-stripe adds unwanted connections to db to query djstripe_webhookendpoint that blocks use of django-extensions commands like reset_db #2005

Open
duaneking opened this issue Nov 3, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@duaneking
Copy link

duaneking commented Nov 3, 2023

Describe the bug
I'm starting a new app using dj-stripe and I'm noticing that any attempted use of the django-extenton reset_db command fails locally due to what I have tracked down as an extra unwanted connection that seems to be spun up by dj-stripe to do a SQL query for the api endpoints based on dj-stripe as sort of a prelude, that is unwanted and actively breaks things.

To be clear, it should NOT be making this query for endpoint data, but here is the psql output that shows its connecting to my dev db even if I don't want it to as it should not be doing anything like this, it should not be touching the db at all for this operation, as that blocks the dropping of the database and does not allow us to reset it for dev work locally but also creates HUGE issues for production deployments.

 16398 | gdc_dev   | 30948 |            |       10 | postgres |                  | ::1         |                 |       50153 | 2023-11-02 19:04:21.528199-07 |                               | 2023-11-02 19:04:21.703432-07 | 2023-11-02 19:04:21.703629-07 | Client          | ClientRead          | idle   |             |              |          | SELECT "djstripe_webhookendpoint"."djstripe_created", "djstripe_webhookendpoint"."djstripe_updated", "djstripe_webhookendpoint"."djstripe_id", "djstripe_webhookendpoint"."id", "djstripe_webhookendpoint"."djstripe_owner_account_id", "djstripe_webhookendpoint"."livemode", "djstripe_webhookendpoint"."created", "djstripe_webhookendpoint"."metadata", "djstripe_webhookendpoint"."description", "djstripe_webhookendpoint"."api_version", "djstripe_webhookendpoint"."enabled_events", "djstripe_webhookendpoint"."secret", "djstripe_webhookendpoint"."status", "djstripe_webhookendpoint"."url", "djstripe_webhookendpoint"."application", "djstripe_webhookendpoint"."djstripe_uuid", "djstripe_webhookendpoint"."tolerance" FROM "djstripe_webhookendpoint" | client backend

I dont want these queries to happen, they are blocking my ability to get work done because they are blocking my ability to use the reset_db command, actively interfering with common dev tools that I depend on. How do I turn them off until this is fixed?

To Reproduce
Install a new django 4.2 app, add dj-stripe, add and configure django-allauth if you want everything I have locally, and add dj-extensions, then then do a bad deployment and need to reset your db by using the django-extention reset_db command. It will fail, citing unwanted extra connections in the same table, even if you reset your server and try again, because the dj-stripe query is connecting even when it should not be, and making the db fall over by blocking the 'reset_db' command.

Software versions

  • Dj-Stripe version: 2.8.3
  • Python version: 3.11
  • Django version: 4.2
  • Stripe API version: not used yet
  • Database type and version: postgresql-x64-15
@duaneking duaneking added the bug label Nov 3, 2023
@jleclanche jleclanche added this to the 3.0.0 milestone May 19, 2024
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

3 participants