Closed Bug 918555 Opened 11 years ago Closed 11 years ago

App purchase fails with a 404 in region

Categories

(Marketplace Graveyard :: Payments/Refunds, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
2013-09-24

People

(Reporter: krupa.mozbugs, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

unagi/1.01
region is set to US

steps to reproduce:
1. Start the purchase of a paid app on marketplace-dev


expected behavior:
purchase flow begins in a trusted UI


Note: Payments works as expected in regions like Spain
observed behavior:
Purchase is aborted with a 404 and 'payment cancelled' message

logs show
09-19 15:39:34.033 E/GeckoConsole(  374): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [req] Request failed: POST 404
09-19 15:39:34.033 E/GeckoConsole(  374): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [req] Error message:  AddonPaymentAccount matching query does not exist.
09-19 15:39:34.033 E/GeckoConsole(  374): Content JS ERROR at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [payments] Error fetching JWT from API:  NOT FOUND 404
09-19 15:39:34.033 E/GeckoConsole(  374): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [buttons] Purchase flow rejected for Pricepoint10: $0.99
09-19 15:39:34.033 E/GeckoConsole(  374): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [buttons] Unsuccessful install for Pricepoint10: $0.99
Severity: normal → critical
Target Milestone: --- → 2013-09-24
Flags: affects-US+
log of HTTP requests/responses

This looks like the 404:

/api/v1/webpay/prepare/?_user=kmcmillan%2B7555444%40mozilla.com%2Ce5bac3913ddbbc32726a9b87e787e107ba55e1f6af1dd7ebe6a66d0c851c12eca8b220cd83aae10c96ae90d82ca6d636577dba03736690504477443f266d0e28%2C7ccdb8e3e4b341bfa4f605f00b048452&carrier=telefonica&dev=firefoxos&device=firefoxos&lang=en-US&pro=1f7beffb839b.45.2&region=us
Frontend logging:

E/GeckoConsole( 2095): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [req] POSTing https://marketplace-dev.allizom.org/api/v1/webpay/prepare/?_user=---&carrier=telefonica&dev=firefoxos&device=firefoxos&lang=en-US&pro=1f7beffb839b.45.2&region=us
E/GeckoConsole( 2095): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [req] Request failed: POST 404
E/GeckoConsole( 2095): Content JS LOG at https://marketplace-dev-cdn.allizom.org/media/fireplace/js/include.js?b=89098e6-523b6348:5 in anonymous: [req] Error message:  AddonPaymentAccount matching query does not exist.
Priority: -- → P1
Looks like this is happening with existing apps only. Kumar thinks https://github.com/mozilla/zamboni/commit/59d0e8#L1R8 is to blame.
I can't see how the cleanup script would cause this to happen but since new uploads work then maybe. David, anything pop out on this?
The only place where there can be such an exception looks to be here:
https://github.com/mozilla/zamboni/blob/master/mkt/purchase/webpay.py#L96

Note sure how to deal with that missing AddonPaymentAccount at this place, it doesn't look to be related to the cleaning of AddonPremium objects.
To me it looks like this is caused by bug 900459 - when a payment account is removed it breaks the install of all apps that it's associated with and the devhub allows this from the list of accounts page.

We should bump the priority of bug 900459.
Depends on: 900459
I don't think this is region related.
Flags: affects-US+
Summary: App purchase fails with a 404 in region = United States → App purchase fails with a 404 in region
All the logs here are on -dev, has anyone confirmed on stage or prod?
I can confirm some are missing on stage and some are not.

I did a query on prod of all *public* apps missing this data. There are 17 of them. But they were all created before 2012-07-12 08:14:31, which makes me wonder at all why they are still showing up. Perhaps they are admin disabled.

I think things on prod are fine for the moment. I don't think the delete of addon premium causes the issue. I found a Paypal cron job (yeah what) and removed that on the way. I checked the API didn't see anything there. I checked the logs, no clues.

https://github.com/mozilla/zamboni/commit/d59039

This isn't affecting new apps and is not affecting prod, so the only real question, do expect this to happen if we push prod on the next milestone? I don't think so and this shouldn't be a blocker. But if anyone thinks it will, please let me know.

"Payments works as expected in regions like Spain"

I don't think this is true.

If it is please give me examples of apps that work in one region and not the other.
> 
> "Payments works as expected in regions like Spain"
> 
> I don't think this is true.
> 
> If it is please give me examples of apps that work in one region and not the
> other.

I just bought Private Yacht for 0.89 on dev with region = Spain
(In reply to krupa raj[:krupa] from comment #11)
> > 
> > "Payments works as expected in regions like Spain"
> > 
> > I don't think this is true.
> > 
> > If it is please give me examples of apps that work in one region and not the
> > other.
> 
> I just bought Private Yacht for 0.89 on dev with region = Spain

Looks like the problem is real across all regions. Private Yacht is not listed in US.
Severity: critical → normal
Depends on: 919148
Version: 1.0 → 1.3
So now I know what to look for I found:

Sep 18 11:32:46 dev2.addons.phx1.mozilla.com: [uid-4771218][63.245.208.142] z.devhub:INFO [1@None] Soft-deleted payment account (uri: /bango/package/245/) :./mkt/developers/models.py:119
Sep 18 11:32:48 dev1.addons.phx1.mozilla.com: [uid-4771218][63.245.208.142] z.devhub:INFO [1@None] Soft-deleted payment account (uri: /bango/package/273/) :./mkt/developers/models.py:119

I believe bug 900459 will fix this.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: