0

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.

enter image description here

After exactly 60 seconds, I am getting an error in the UI:

enter image description here

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:

enter image description here

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?

1

After a month of debugging, we were able to find the cause of the problem. The issue was that backend process took 5 minutes to complete. For some reason the order confirmation email of Magneto took 4 minutes. Disabling all emails in the admin dashboard (Stores => Configurations => Sales => Sales emails) Solved the problem.

To debug the problem we used 'strace' to trace the actual calls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.