Duplicate Payment log crash: Please enter a value using 255 characters or fewer

Lukas W.

Well-known member
Affected version
2.1.2
We're currently running into a bunch of these on a client website:

Code:
XF\PrintableException: Error logging payment to payment provider: Please enter a value using 255 characters or fewer. src/XF/Mvc/Entity/Entity.php:1154
Generated by: Unknown account - at -
Stack trace
#0 src/XF/Repository/Payment.php(90): XF\Mvc\Entity\Entity->save()
#1 src/XF/Payment/AbstractProvider.php(203): XF\Repository\Payment->logCallback('-..', 'paypal', '...', 'error', 'Connection to P...', Array, '')
#2 payment_callback.php(69): XF\Payment\AbstractProvider->log(Object(XF\Payment\CallbackState))
#3 {main}

It's a masking error, but unfortunately it hides the actual error behind it, as it gets trimmed away by the error reporting. I assume what was attempted to be logged here was line 195 of src/XF/Payment/PayPal.php: $state->logMessage = 'Connection to PayPal failed: ' . $e->getMessage();, which turned out to be longer than the log message field max length.
 
Top Bottom