PayPal Donation Extension

Paypal can't get a response from the ipn-listener - PayPal Donation Extension

Paypal can't get a response from the ipn-listener

by Jasero » Thu Mar 21, 2024 7:45 pm

Paypal started recently sending out this email:

Code: Select all

Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:

https://[site]/app.php/ipn-listener

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.

Thank you for your prompt attention to this issue.
Googling that it seems that this kind of message is sent when Paypal can't get a 200 from the ipn listener, and Paypal keeps retrying 15 times. Internet advice tells just to ignore this email. This is not a serious issue in itself, but more of a nuisance, and this didn't used to happen before. (My site's been using the extension successfully since September 2023.)

Admin panel transaction logs (and DB) show each transaction once, and people get the notification their donation went through normally (though it seems pretty slow to appear). However when I check the logs in /store/ext/ppde there are 10-16 log files for each transaction, and after the time stamps in each, they do say they've returned a 200, though the contents of the logs vary a little in the property order and content. For example:

Some of the logs show

Code: Select all

HTTP/1.1 200 OK
Connection: close
Content-Length: 8
right at the start instead of the connection closing being at the bottom.

It doesn't seem to make any difference on this issue which address is set on Paypal's side as the IPN address, or if the IPN is completely disabled there or not.

This issue started happening starting from a donation made on March 10th, 2024, 10:17:20 am EDT, and has happened with every donation ever since. Prior to that the site was momentarily in maintenance mode as I ran server updates (so that could also be the culprit since it fits time-wise).

Have you run into this issue before, and if so, any tips? Or would you have any advice if this is something I can debug from the site's or extension's setting or logs, or if this might be an issue with Paypal, or if I need to keep digging into the server updates in case something didn't get updated properly on the server, or an update simply broke stuff.

Many thanks in advance in any case!
Jasero
Registered User
Posts: 3
Joined: Thu Mar 21, 2024 6:32 pm

Re: Paypal can't get a response from the ipn-listener

by Jasero » Sat Mar 23, 2024 2:32 pm

Some additional information:

After reading this thread https://www.phpbb.com/customise/db/exte ... pic/241006 about the total amount raised shown on admin panel doubling, I started keeping an eye on that figure. It seems that every time PayPal tries to call the ipn-listener again, the donated amount gets added to the total, even though the transaction is already marked as completed in the transactions log db table.

Checking my server's access logs shows that PayPal is actually getting a 499 as a response, not a 200, so that at least explains why Paypal keeps trying to resend the message to the ipn-listener.

Checking my database's slow log shows a ppde-related query taking ages, but I'm not quite sure what initiates it, and whether or not it has anything to do with the problem.

Code: Select all

# Query_time: 93.548309  Lock_time: 0.000004 Rows_sent: 0  Rows_examined: 98171835
SET timestamp=1711203788;
SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
			FROM phpbb_acl_groups a, phpbb_user_group ug, phpbb_groups g, phpbb_acl_roles_data r, phpbb_acl_options ao
			WHERE a.auth_role_id = r.role_id AND r.auth_option_id = ao.auth_option_id 
				AND a.group_id = ug.group_id
				AND g.group_id = ug.group_id
				AND ug.user_pending = 0
				AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
				
				
				AND ao.auth_option = 'a_ppde_manage';
Jasero
Registered User
Posts: 3
Joined: Thu Mar 21, 2024 6:32 pm

Re: Paypal can't get a response from the ipn-listener

by Skouat » Mon Mar 25, 2024 12:23 am

Hi Jasero,

The SQL query you quoted is a phpBB query.
https://github.com/phpbb/phpbb/blob/3.3 ... #L669-L680

What happens if you run this SQL query directly from your SQL server?
Does it take the same time?
Skouat
Code Contributor
Posts: 1058
Joined: Mon Mar 10, 2008 5:30 pm
Location: France

Re: Paypal can't get a response from the ipn-listener

by Jasero » Sun Jul 14, 2024 12:14 pm

Sorry for taking such a long time to get back to you on this issue!

I've now run the same query straight from the SQL server, and the results are the same. Executing the query straight from the SQL server takes anywhere from 104 to 127 seconds. It goes through almost 100 million rows and returns an empty set. So I wonder if this is even related to the issue, or if it's an issue with my database.

In any case the problem I described still persists on my site, and now paypal keeps turning the IPN off every couple weeks.
Jasero
Registered User
Posts: 3
Joined: Thu Mar 21, 2024 6:32 pm

Re: Paypal can't get a response from the ipn-listener

by Skouat » Mon Jul 15, 2024 6:25 pm

Hi Jasero,

From PPDE IPN Settings, have you tried to enable the error logs feature ?
Each time PayPal use the IPN listener, it logs the communication into a dedicated file.

For the slow query, this is not related to my extension.
Maybe you have to investigate your database (size, settings)
Skouat
Code Contributor
Posts: 1058
Joined: Mon Mar 10, 2008 5:30 pm
Location: France