Periodic tasks have stopped running

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Periodic tasks have stopped running

Post by AndySt »

phpBB 3.3.13

I have configured periodic tasks to be run via a system cron job every 5 minutes. The two periodic tasks I have are for the mailer in the Digests extension and a daily backup via the Auto Database Backup extension.

Both of these tasks have been sending emails and taking backups successfully for a number of weeks, but I just realised I've received no digests for 4 days and there have been no backups taken since then as well. When I checked the configuration for Auto Database Backups I noticed the due date for the next backup was still set to the day of the last successful backup recorded in the Admin log.

I have looked in the phpBB Admin and Error logs and can find no errors reported. And the last entries for execution of the Digests mailer and Auto Database Backups are consistent with the last digest I received and the last database backup file created in /store.

I've also not seen any errors from the system cron job but I've opened a ticket with my hosting service provider to see if they have access to log files I can't see.

I'm trying to figure out if this is a problem with the system cron job or has phpBB for some reason stopped queuing tasks for the system cron to process. Is there a database table or a file somewhere which contains details of the tasks to be processed by the system cron job?

Thanks in advance for any hints about where I need to look to track down the cause of the problem.

Andy
User avatar
SpIdErPiGgY
Registered User
Posts: 320
Joined: Sun May 02, 2021 2:11 pm
Location: Erpe-Mere, Aalst, BE
Name: Andy Dm

Re: Periodic tasks have stopped running

Post by SpIdErPiGgY »

I have the same issue

_____

Systeem: Linux 6.1.0-28-cloud-amd64 • Forumversie: 3.3.14
Webserver: Apache/
PHP-versie: 8.3.14 - PHP-FPM Forced
Databaseserver: MySQL(i) 11.4.4-MariaDB-deb12
Besturingssysteem: Debian GNU/Linux 12 (bookworm)
Image
User avatar
ssl
Registered User
Posts: 2059
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Periodic tasks have stopped running

Post by ssl »

AndySt wrote: Mon Dec 23, 2024 7:34 pm a daily backup via the Auto Database Backup extension.
What version do you use for this extension?
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.14 | PHP: 8.3.15
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

ssl wrote: Mon Dec 23, 2024 8:30 pm
AndySt wrote: Mon Dec 23, 2024 7:34 pm a daily backup via the Auto Database Backup extension.
What version do you use for this extension?
Sorry - should have included all the versions in my original post.

phpBB: 3.3.13
php: 8.2.26
Database: MySQL(i) 10.6.19-MariaDB-cll-lve
Auto Database Backup: 2.0.1
Digests: 3.3.18
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6518
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Periodic tasks have stopped running

Post by thecoalman »

There is similar topic, is the "New posts" list piling up too?
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
ssl
Registered User
Posts: 2059
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Periodic tasks have stopped running

Post by ssl »

For Digests extension you can read this: https://www.phpbb.com/customise/db/exte ... pic/248539
For Auto DB Backup I use this version with any trouble: https://github.com/rmcgirr83/autodbbackup
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.14 | PHP: 8.3.15
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

Well miraculously both the digest mailer and the auto backups started working again this morning.

I'm still waiting for some clarity from my hosting service but I know they were looking into the cron job for me so I suspect they found it was stuck and just kicked it off again.

The only thing I had changed in the meantime was to correct the next db backup date to yesterday evening but I can't think how that would have kicked off the cron job again unless the wrong date had set a permanent error condition which caused the cron job to bail out each time it ran and before it could process the queued digests. But this is just guesswork because I have no knowledge of how the scheduled phpBB tasks are queued and in what order they are processed.

Anyhow - all is now running again as before and I'm also delighted and impressed that Digests mailer does a catch-up of all digests missed since the problem first occurred. Kudos to Mark the developer to design in that recovery! It also seems to further support the theory that it was a cron job problem as the digests were queued but just not sent.

Thanks to all who posted their thoughts. Your willingness to help a not-too-technocal-newbie is much appreciated.

Andy
User avatar
thegioiluatsu
Registered User
Posts: 52
Joined: Wed Dec 23, 2020 12:10 pm

Re: Periodic tasks have stopped running

Post by thegioiluatsu »

The tasks processed by phpBB's cron job are stored in the phpbb_tasks database table. You can check this table to see if tasks like the Digests mailer and Auto Database Backup are still queued and marked as "ready." If there are no tasks in the table, phpBB might have stopped queuing them. Additionally, check the cron.lock file in the /cache directory; if it exists, delete it to reset the cron lock. Ensure the periodic tasks are still enabled in the settings of the respective extensions, and verify that your system cron job (executing the cron.php file) is running correctly by reviewing logs from your hosting provider once they are available. These steps should help identify whether the issue lies with phpBB's task queuing or the system cron job execution.
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
User avatar
Mike-on-Tour
Registered User
Posts: 558
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: Periodic tasks have stopped running

Post by Mike-on-Tour »

There is no _tasks table in vanilla phpBB, at least I haven't found one in several installations.
AFAIK phpBB uses the config variables ending with _gc to determine the interval between two cron job runs and _last_gc to determine the last run of a cron job.
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

AndySt wrote: Tue Dec 24, 2024 10:38 am Well miraculously both the digest mailer and the auto backups started working again this morning.

I'm still waiting for some clarity from my hosting service but I know they were looking into the cron job for me so I suspect they found it was stuck and just kicked it off again.
Well my hosting provider support got back to me and said this:
Hi there,

The only thing that I can guess could have caused this issue was an update to the way the default PHP binary works, by automatically using the version of PHP that is chosen by the PHP selector in cPanel.

Your cron did use unusual syntax it was:

cd /home/fellfixe/public_html/ftfforum && bin/phpbbcli.php cron:run

And it should have been :

/opt/alt/php74/usr/bin/php -l /home/fellfixe/public_html/ftfforum/bin/phpbbcli.php cron:run

Or

/usr/bin/php -l /home/fellfixe/public_html/ftfforum/bin/phpbbcli.php cron:run

As you can see your cron comomand did not specify the application used to run the cron which I believe led to the incompatibility / issue.
I know I got the 'unusual' syntax from the installation instructions in the FAQ for the Digests extension and it was working fine. I don't really understand the explanation given by the hosting support guy for why it suddenly stopped working but it sounds like something changed on their side which invalidated the command syntax.

So now the the cron job appears to be running and producing the following output in the log file:

[2024-12-28 13:30:02] - Included in script: phpbbcli.php - No errors


But my earlier post saying the problem was fixed turns out to be premature. As before, digests are not being mailed and the auto database backups are not executing with the 'next backup time' stuck in the past at one day after the last successful backup.

As per the suggestions from
thegioiluatsu wrote: Fri Dec 27, 2024 4:04 am The tasks processed by phpBB's cron job are stored in the phpbb_tasks database table... Additionally, check the cron.lock file in the /cache directory; if it exists, delete it to reset the cron lock. Ensure the periodic tasks are still enabled in the settings of the respective extensions, and verify that your system cron job (executing the cron.php file) is running correctly by reviewing logs from your hosting provider once they are available.
There is no phpbb_tasks table in my installation. A cron.lock file does not exist in the /cache directory. The periodic tasks are still enabled in the extensions settings. The cron job appears to be executing but given the issue identified with the command syntax maybe the command is still wrong?

Re
Mike-on-Tour wrote: Fri Dec 27, 2024 9:41 am There is no _tasks table in vanilla phpBB, at least I haven't found one in several installations.
AFAIK phpBB uses the config variables ending with _gc to determine the interval between two cron job runs and _last_gc to determine the last run of a cron job.
Where do I find these variables defined so I can check their values?
User avatar
Steve
Registered User
Posts: 1598
Joined: Tue Apr 07, 2009 7:48 pm
Location: Co. Durham, England
Name: Steven Clark

Re: Periodic tasks have stopped running

Post by Steve »

This extension is great for viewing cron job status via ACP.

https://www.phpbb.com/customise/db/extension/cronstatus
@ The Chief Medical Officers guideline for men is that: You are safest not to drink regularly more than 14 units per week.
- I drank that today++ :lol: 🍺
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

Steve wrote: Sat Dec 28, 2024 7:52 pm This extension is great for viewing cron job status via ACP.

https://www.phpbb.com/customise/db/extension/cronstatus
Thanks for that. I wasn't aware of that extension. Sounds very useful.

In the meantime my hosting provider suggested I ran the command from the cron job in Terminal. So I ran the command using the syntax they recommended i.e. /opt/alt/php74/usr/bin/php /home/fellfixe/public_html/ftfforum/bin/phpbbcli.php cron:run and got these errors:

In exception_subscriber.php line 51:
Could not obtain cron lock.
In run.php line 97:
CRON_LOCK_ERROR
cron:run [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--safe-mode] [-e|
--env ENV] [--] <command> [<name>]


So that's pointing back to an issue with the cron lock but as per my earlier post I cannot find a cron.lock file anywhere in my hosted system. Any idea where else I should be looking?
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

Steve wrote: Sat Dec 28, 2024 7:52 pm This extension is great for viewing cron job status via ACP.

https://www.phpbb.com/customise/db/extension/cronstatus
And what that shows me is there are multiple cron tasks which are coloured red.
cron_status.jpg
And according to the header for Cron Status this means those tasks are locked by cron manager and blocking other tasks. So my question now is "how for I get cron manager to release the locks?"
You do not have the required permissions to view the files attached to this post.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6518
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Periodic tasks have stopped running

Post by thecoalman »

use:

Code: Select all

/usr/bin/php /home/fellfixe/public_html/ftfforum/bin/phpbbcli.php cron:run
The one you are using is specific to that php version and will fail when the php version is inevitably removed.

There is entry in phpBB_config table for cron lock, set it to 0.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
AndySt
Registered User
Posts: 24
Joined: Sun Aug 18, 2024 4:08 pm

Re: Periodic tasks have stopped running

Post by AndySt »

thecoalman wrote: Sat Dec 28, 2024 10:13 pm use:

Code: Select all

/usr/bin/php /home/fellfixe/public_html/ftfforum/bin/phpbbcli.php cron:run
The one you are using is specific to that php version and will fail when the php version is inevitably removed.
Yes I figured that but decided I would go with it until I got the main issue resolved. I have a feeling that changing the cron job command was a red herring and the real issue was the cron lock in phpBB.
thecoalman wrote: Sat Dec 28, 2024 10:13 pm There is entry in phpBB_config table for cron lock, set it to 0.
I found it and have set it to 0 and am just waiting to see if the scheduled Digests mailer and the auto database backups resume later today.

Will update this post to report success or failure.

Return to “[3.3.x] Support Forum”