I have a fresh install of Magento 2.3.6. I enabled the default paypal payment method, and I am trying to debug it using sandbox mode.
I am able to complete the process of the payment on Paypal, but when it suppose to return to the site, it just hangs on Processing...
in Paypal site (see image below), and in devtools I see that there is a request to magento url paypal/express/onAuthorization
that is pending.
After exactly 60 seconds, I am getting an error in the UI:
The backend is using nginx->php-pfm setup. In nginx log I see error 499:
10.244.43.27 - - [30/Apr/2021:14:54:06 +0000] "POST /index.php/paypal/express/onAuthorization/ HTTP/1.1" 499 0 "http://example.com/index.php/checkout/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36" "10.244.43.0, 10.244.226.77
The onAuthorization link is showing 504 error:
There is nothing in php-pfm that correlates to that time. There is nothing relevant in var/log/* files.
The payment on Paypal is actually successful. The seller account received the payment.
I also enabled debug on magento config for (Sales=>Paypal=>Advanced=>Debug mode), and I see, about 10 seconds after the confirmation of the pay on paypal site, var/log/payment.log
with a response of 'PAYMENTINFO_0_PAYMENTSTATUS' => 'Completed'
.
I tried to increase timeouts both in nginx and in php-pfm.
php-pfm:
# php -i | grep timeout
hard_timeout => 2 => 2
Read timeout => 86400
default_socket_timeout => 600 => 600
opcache.force_restart_timeout => 180 => 180
nginx:
# grep fastcgi_read_timeout /var/www/html/magento2.conf
fastcgi_read_timeout 100s;
fastcgi_read_timeout 600;
How to debug this from here?