Page MenuHomePhabricator

Fix batch refund under coworker
Open, Needs TriagePublic

Description

The refund form coded in T421277 works for synchronously executed refunds but fails when they are executed under coworker via JSON rpc.

For Adyen: Configuration key 'accounts//ws-api-key' does not exist.
For PayPal: POST request to https://api.paypal.com/nvp failed 7 times.
For Gravy: Key cannot be empty

Seems it's somehow not loading the SmashPig context correctly, but it's hard to understand how.

https://phabricator.wikimedia.org/T405053 has advice for running coworker with debug. (but that involves running via wmf-cv not jsonrpc)

Event Timeline

Note that I have set wmf_max_synchronous_refunds to 500 as a temporary measure to avoid hitting this on prod, so we'll want to reset that to something reasonable (it was 25 previously) once this is fixed.

Just noting that Breianne says 20 gravy refunds only takes 10s, so we might be able to leave the limit higher than 25 before sending to queue, unless non-gravy ones are slower.