Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notification job fail sometimes #86

Closed
mrj0b opened this issue Jul 6, 2021 · 14 comments · Fixed by #93 or #100
Closed

notification job fail sometimes #86

mrj0b opened this issue Jul 6, 2021 · 14 comments · Fixed by #93 or #100
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mrj0b
Copy link

mrj0b commented Jul 6, 2021

sometimes the notification job fail and the status of the failed notification is :

scheduled
at 1970-01-01 00:00:00

this is the log from the admin panel :

2021-07-06 17:02:22 | INFO | Next ticker scheduled at: 2021-07-06 18:03:22

2021-07-06 17:02:17 | INFO | Next ticker scheduled at: 2021-07-06 18:03:16
2021-07-06 17:01:30 | INFO | Cron check ticked
2021-07-06 16:59:51 | INFO | Next ticker scheduled at: 2021-07-06 18:00:51
2021-07-06 16:59:37 | INFO | Cron check ticked
2021-07-06 16:58:37 | INFO | Next ticker scheduled at: 2021-07-06 17:59:37
2021-07-06 16:58:29 | INFO | Cron check ticked
2021-07-06 16:57:24 | INFO | Next ticker scheduled at: 2021-07-06 17:58:24
2021-07-06 16:57:23 | INFO | Next ticker scheduled at: 2021-07-06 17:58:23
2021-07-06 16:57:20 | INFO | Cron check ticked
2021-07-06 16:56:21 | INFO | Scheduling a broadcast notification
2021-07-06 16:56:21 | DEBUG | Array ( [title] => MJB Tech Tips [body] => كشفت ASRock عن قائمة اللوحات الأم التي ستدعم ويندوز 11 [icon] => https://mjbtechtips.com/wp-content/uploads/2021/06/cropped-icone.png [image] => https://mjbtechtips.com/wp-content/uploads/2021/06/2021-06-25-image-23-j.webp [require_interaction] => 1 [extra] => Array ( [url_to_open] => https://mjbtechtips.com/2021/07/%d9%83%d8%b4%d9%81%d8%aa-asrock-%d8%b9%d9%86-%d9%82%d8%a7%d8%a6%d9%85%d8%a9-%d8%a7%d9%84%d9%84%d9%88%d8%ad%d8%a7%d8%aa-%d8%a7%d9%84%d8%a3%d9%85-%d8%a7%d9%84%d8%aa%d9%8a-%d8%b3%d8%aa%d8%af%d8%b9%d9%85/ ) )
2021-07-06 16:56:21 | INFO | Scheduling job id=61, result: 1

and this is from /var/log/php7.4-fpm.log

[06-Jul-2021 16:56:21] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

there was nothing on the /var/log/nginx/error.log related to this event

@rwngallego
Copy link
Collaborator

HI @djeber, thanks for your message. Could you please confirm if this is not related to the content, like if it fails when you send a url with a specific length, or the character encoding, etc? Could you please paste a screenshot of the notification job details? It usually contains some stats that are useful for troubleshooting. For the moment we will try to reproduce the same notification you sent. Thank you!

@mrj0b
Copy link
Author

mrj0b commented Jul 6, 2021

i tried the same url and the notification failed
Screenshot from 2021-07-06 22-58-45
Screenshot from 2021-07-06 22-58-52

@rwngallego
Copy link
Collaborator

rwngallego commented Jul 6, 2021

Hello, we're narrowing down the problem, could you please comment the 310 line in includes/class-perfecty-push.php using the plugin editor, go to Plugins > Plugin editor > Select Perfecty Push Notifications.

includes/class-perfecty-push.php:

//		$this->loader->add_action( 'admin_init', $plugin_admin, 'check_cron' );

This will disable the cron checker, which we suspect is having conflicts with the notification job scheduler.

@mrj0b
Copy link
Author

mrj0b commented Jul 8, 2021

sorry for taking long to reply, I've done as you instructed me but the problem still persist

@rwngallego
Copy link
Collaborator

rwngallego commented Jul 8, 2021

Could you please confirm that the cron-check entries are not appearing in the logs? They should not appear at all after you commented this line:

//                    $this->loader->add_action( 'admin_init', $plugin_admin, 'check_cron' );

They look like:

2021-07-06 17:02:17 | INFO | Next ticker scheduled at: 2021-07-06 18:03:16
2021-07-06 17:01:30 | INFO | Cron check ticked
2021-07-06 16:59:51 | INFO | Next ticker scheduled at: 2021-07-06 18:00:51
2021-07-06 16:59:37 | INFO | Cron check ticked
2021-07-06 16:58:37 | INFO | Next ticker scheduled at: 2021-07-06 17:59:37
2021-07-06 16:58:29 | INFO | Cron check ticked
2021-07-06 16:57:24 | INFO | Next ticker scheduled at: 2021-07-06 17:58:24
2021-07-06 16:57:23 | INFO | Next ticker scheduled at: 2021-07-06 17:58:23

@mrj0b
Copy link
Author

mrj0b commented Jul 10, 2021

yes they are not appearing after commenting the line

@mrj0b
Copy link
Author

mrj0b commented Jul 14, 2021

this is from the plugin log for a failed notification after commenting the code you told me

2021-07-14 07:56:05 | INFO | Scheduling a broadcast notification

2021-07-14 07:56:05 | DEBUG | Array ( [title] => MJB Tech Tips [body] => وكالة الرقابة الفرنسية تغرم جوجل 591 مليون دولار لفشلها في التفاوض على صفقات عادلة مع ناشري الأخبار المحليين [icon] => https://mjbtechtips.com/wp-content/uploads/2021/06/cropped-icone.png [image] => https://mjbtechtips.com/wp-content/uploads/2021/07/2021-07-13-image-29-j.webp [require_interaction] => 1 [extra] => Array ( [url_to_open] => https://mjbtechtips.com/2021/07/%d9%88%d9%83%d8%a7%d9%84%d8%a9-%d8%a7%d9%84%d8%b1%d9%82%d8%a7%d8%a8%d8%a9-%d8%a7%d9%84%d9%81%d8%b1%d9%86%d8%b3%d9%8a%d8%a9-%d8%aa%d8%ba%d8%b1%d9%85-%d8%ac%d9%88%d8%ac%d9%84-591-%d9%85%d9%84%d9%8a/ ) )
2021-07-14 07:56:05 | INFO | Scheduling job id=68, result: 1

@rwngallego
Copy link
Collaborator

Yes, it's apparently related to wp-cron. We're changing how we execute the notification jobs so that this doesn't affect the execution. This is related to https://stackoverflow.com/questions/60374317/wordpress-cron-wp-schedule-single-event-action-not-always-working

@rwngallego rwngallego added bug Something isn't working help wanted Extra attention is needed labels Jul 17, 2021
@MocioF
Copy link
Contributor

MocioF commented Jul 18, 2021

Hi have experienced this in the past when the link sent was a zoom meeting link. I am not able to reproduce it every time and on all servers.

@matteomorreale
Copy link

matteomorreale commented Jul 29, 2021

Same problem here, almost 1000 subscribers but most notifications fail around 200 (one never even get to 30).
In logs only this:

2021-07-29 09:04:54 | INFO | Cron check ticked

2021-07-29 09:05:11 | INFO | Next ticker scheduled at: 2021-07-29 09:06:11
2021-07-29 09:06:15 | INFO | Cron check ticked
2021-07-29 09:06:17 | INFO | Next ticker scheduled at: 2021-07-29 09:07:17
2021-07-29 09:07:17 | INFO | Cron check ticked
2021-07-29 09:07:19 | INFO | Next ticker scheduled at: 2021-07-29 09:08:19

It's 9:11 here, push count is struck

@rwngallego
Copy link
Collaborator

Hello, this is something happening in WordPress and require changes on how to handle the crons. We will make the appropriate adjustments and we estimate that it could be ready in two weeks. Thank you!

@rwngallego
Copy link
Collaborator

We've implemented a mechanism to unleash the stalled jobs #93 that will fix this bug, and will be included in 1.3.3. This is prior to the general refactoring to the notification job execution we will implement in 1.4.0.

@rwngallego
Copy link
Collaborator

This has been released in v1.3.3

@rwngallego
Copy link
Collaborator

A new version with performance improvements has been released in v1.4.0. Please check: https://docs.perfecty.org/wp/performance-improvements/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
4 participants