Open james-allan opened 2 years ago
Thanks for logging this @james-allan - do you think this is likely to cause issues for merchants? E.g. should we proactively fix this or is it reasonable to wait for reports.
If the merchant does get into this situation, is there a reasonable workaround we could suggest? For example, completely recreating the subscription product (and deleting the orphaned one).
do you think this is likely to cause issues for merchants?
There was at least 1 occurrence of this happening on a site. At least that's how I discovered it via the #wcpay-notices-prod channel. (p1635810288050800-slack-C46H1UYN4)
Looking into the product IDs and blog report card in the specific case, it appeared to be the second scenario I mentioned above - the product ID was associated with a staging site sounding URL, but was being used on a legit site.
I forgot this question:
If the merchant does get into this situation, is there a reasonable workaround we could suggest? For example, completely recreating the subscription product (and deleting the orphaned one).
Yeah, you'd have to delete the WC Product and recreate it or delete the product ID from the post meta.
Thanks @james-allan - do you think the workaround is enough for now? Perhaps we can document the workaround, and if we get reports/requests then we can revisit.
Saw another variation of this in wcpay-notices-prod logs:
No such subscription: 'sub_abcd1234'; a similar object exists in test mode, but a live mode key was used to make this request.
4734326-zen
Resolved the issue by recommending the user create a new subscription product and deleting those created prior to their original account deletion.
5204855-zen is this, I believe, except that the "product" in question is a tax rate? Digging more into this now.
Yes, 5204855-zen is indeed a version of this issue. Theirs is pretty much the worst case scenario, which I think was along these lines:
Why?
prod_XXXXXX
) which did not exist on the live site WC Pay account.prod_XXXXX
) that also did not exist on their live WC Pay account.cus_XXXXXX
) that does not exist on live.Each error was only discoverable once the previous one was fixed, so the issue has been extremely painful for us and them to work on. :(
I realize this is pretty edge case-ish, but we should have a tool in WooCommerce > Status > Tools that can nuke all these "cached" customer and product IDs from the db and Stripe. Looking at the code, they just get recreated if they do not exist anyway (I think).
5219076-zd-woothemes
Also related, also gave the user the workaround of creating new subscriptions to replace the old ones.
5810642-zen
39421119-hc
5854338-zen
Another potential variation of this issue spotted in wcpay-notices-prod: p1691035504352549-slack-C46H1UYN4.
Invalid request error: resource_missing (subscription id)
Describe the bug
It's currently possible to have product IDs stored in the database that aren't linked to the current WCPay Connect account. This can happen in any number of ways. I've included what I believe to be two possible scenarios below.
In both cases, a product ID linked to 1 WCPay account is used with a different WCPay account and results in the following error.
To Reproduce
I'm not 100% sure how to reliably replicate this issue following a real-world set of steps. The steps below are a way of illustrating how this might happen. I've also based the above 2 scenarios after observing the error logs in logstash.
To replicate I:
Expected behavior
When a site moves WCPay accounts existing any product IDs created on a different account should be deleted or some validation should occur to make sure the product ID is still valid for this account.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context