Page MenuHomePhabricator

Paypal EC Pending Transaction Resolver failed (weekend failure)
Closed, ResolvedPublic

Description

The Paypal Pending Transaction Resolver(PTR) failure that @AndyRussG responded to over the weekend might have been a timing-related error. The PTR appears to have attempted to create a new recurring subscription shortly after one was set up.

The failure happened in the same method that broke earlier this week T332396: Paypal EC Pending Transaction Resolver failed (missing 'date' param)

I can see in the /srv/archive/civi1001/process-control/20230319/recurring_queue_consume-20230319-120001.log.civi1001.bz2 that the recurring queue consumer processed a 'subscr_signup' message for the related ct_id 174400055 at 2023-03-19 12:00:26 UTC, followed by a 'subscr_payment' at 2023-03-19 12:00:32 UTC.

Those events happened right before the Paypal PTR processed the affected pending record and attempted to create a new(possibly duplicate) recurring subscription for the same donor. I can see this in /srv/archive/civi1001/process-control/20230319/paypal_pending_resolver-20230319-120001.log.civi1001.bz2

2023-03-19 12:00:31,134 ERROR   WD php: TypeError: Return value of                                       [error]                                                                                                  
2023-03-19 12:00:31,134 INFO    TypeError: Return value of Civi\Api4\Action\PendingTransaction\Resolve::startRecurringPaymentAndReturnStatus() must be of the type string, null returned in Civi\Api4\Action\PendingTransaction\Resolve->startRecurringPaymentAndReturnStatus() (line 655 of /srv/org.wikimedia.civicrm/drupal/sites/default/civicrm/extensions/wmf-civicrm/Civi/Api4/Action/PendingTransaction/Resolve.php).        
2023-03-19 12:00:31,134 ERROR   Civi\Api4\Action\PendingTransaction\Resolve::startRecurringPaymentAndReturnStatus()                                                                                               
2023-03-19 12:00:31,135 ERROR   must be of the type string, null returned in
2023-03-19 12:00:31,135 ERROR   Civi\Api4\Action\PendingTransaction\Resolve->startRecurringPaymentAndReturnStatus()                                                                                               
2023-03-19 12:00:31,135 ERROR   (line 655 of
2023-03-19 12:00:31,135 ERROR   /srv/org.wikimedia.civicrm/drupal/sites/default/civicrm/extensions/wmf-civicrm/Civi/Api4/Action/PendingTransaction/Resolve.php).                                                  
2023-03-19 12:00:31,135 ERROR   Drush command terminated abnormally due to an unrecoverable error.       [error]

Also, there is something else odd that I noticed. The pending message doesn't have an email address(which I think is ok for Paypal pending messages), but the problem is that the method attempting to create a new recurring subscription expects an email address. Checkout PendingTransaction::startRecurringPaymentAndReturnStatus() and the internally called SmashPig\PaymentProviders\PayPal\Api::createRecurringPaymentsProfile()

Event Timeline

jgleeson moved this task from Backlog to In Progress on the Fundraising Tech - Chaos Crew board.

we should get the email from our status lookup API call

Change 901223 had a related patch set uploaded (by Ejegg; author: Ejegg):

[wikimedia/fundraising/SmashPig@master] Always return a status for PayPal profile creation

https://gerrit.wikimedia.org/r/901223

ah, so we could potentially delete pending messages in the recurring queue consumer too, not just in the one-time queue consumer and payments-init

Change 901223 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Always return a status for PayPal profile creation

https://gerrit.wikimedia.org/r/901223

Dwisehaupt claimed this task.
Dwisehaupt moved this task from Pending Deployment to Done on the Fundraising Tech - Chaos Crew board.
Dwisehaupt set Final Story Points to 1.