-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
value too long for type character varying(9) when processing checkout.session.completed webhook (possible stripe API version 2024-04-10 issue) #2038
Comments
I am also running into this issue. It appears to be stemming from the I have found that the following migration file, which increases the length of the field to 255 characters temporarily fixes it. # Generated by Django 5.0.3 on 2024-04-16 12:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("djstripe", "0012_2_8"),
]
operations = [
migrations.RunSQL(
"ALTER TABLE djstripe_paymentintent ALTER COLUMN capture_method TYPE varchar(255);"
),
] A simple solution in the library would be to bump up the length of the field. I will submit a PR for that. |
Hello @jleclanche, any update for this? I'm facing the same issue. |
Due to the issue I believe we will exceptionally release a 2.8.5 with migrations included. |
Thank you for the quick response @Jenselme 👍 we're waiting this updates. |
@jleclanche very appreciated, thank you for your work. |
@jleclanche would it be helpful for me to add the migration to #2040? |
@czue Yes please go for it. |
@jleclanche migration added. also created a PR into the stable/2.8 branch (#2041) as I wasn't totally sure where it should go. |
@jleclanche I believe we need to include all migration files in the new release version, the reason is for old dj-stripe versions who had migration files need to clear the docker exec -it <postgres_container_name_or_id> psql -U <username> <database_name>
DROP TABLE django_migrations; then; python manage.py migrate --fake |
Hello @jleclanche sorry to ping you again. When we expect the new release will happens?
|
@agusmakmun if you're needing a patch urgently you can always add a migration like the one mentioned above to any of your Django apps. I would expect it to fix the issue and be compatible with any future migration that ships in djstripe |
@jleclanche sorry to pester, but just wondering what the steps are to go from #2040 or #2041 to a release, and whether there's anything I can do to help move things along? At the moment anyone who uses this library with a new Stripe account will get all kinds of errors in webhooks (and maybe other places). Not a great experience. |
Note that stripe support can downgrade your API level if you ask them, that's another way of getting dj-stripe working right now. |
Folks, I'm going to try to get a release to happen ASAP but I'm swamped IRL right now. If you need to run this in production, you can write the following in your SQL db: alter table djstripe_paymentintent alter column capture_method type character varying(15); I haven't tested it but it should work as-is and be forward-compatible with future migrations. |
This is fixed in 2.9.0a1 which was released recently, please test that release (note: it has not been tested in production yet, please create issues with all feedback). |
@jleclanche awesome, thanks! What's the easiest way for me to see what else is in that release? |
Describe the bug
processing a checkout.session.completed webhook after a purchase results in an error: value too long for type character varying(9)
This is in test mode on a newly opened stripe account which is on API version 2024-04-10. I previously did a very thorough amount of testing on another stripe account which is on version 2023-08-16 and never encountered that issue. I am purposefully keeping a stripe account in test mode (dev/qa/prod environments). It doesn't appear to be possible to downgrade the API version on a stripe account.
Sentry crash report:
https://language-tools.sentry.io/share/issue/f1549f96d5ed42c59af3b21d65e96d01/
Full stack trace:
Here's the the webhook data:
To Reproduce
Perform a purchase using the hosted stripe checkout page.
Software versions
The text was updated successfully, but these errors were encountered: