Cron

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
User avatar
david63
Registered User
Posts: 19030
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Cron

Post by david63 »

Is Cron working in 3.1.0 RC2?

I know that it was working in B3 but I don't know if there is now a bug, my test set-up configuration or I have missed some option somewhere.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
Dr.Death
Registered User
Posts: 400
Joined: Fri Apr 25, 2003 10:04 am
Location: Germany
Contact:

Re: Cron

Post by Dr.Death »

I second that....on RC1/RC2 my cron is also not working anymore...nothing changed on my extension cronfiles so far...

EDIT:

Maybe some of the DEV Team could answer our question?

This (private) extensions is working with RC2, except the cron task which was working till Beta-4.

https://github.com/DrDeath/phpbb-ext-f1webtip

It seems, that the cron framework is not executing the new cron Extension defined in the services.yml

Code: Select all

     cron.task.core.email_reminder:
        class: drdeath\f1webtip\cron\task\core\email_reminder
        arguments:
            - @config
            - @controller.helper
            - @template
            - @user
        calls:
            - [set_name, [cron.task.core.email_reminder]]
        tags:
            - { name: cron.task }
Maybe something was changed on the cron framwork between Beta-4 and RC1/RC2 and I'm not able to find this.....
Doc.
User avatar
Dr.Death
Registered User
Posts: 400
Joined: Fri Apr 25, 2003 10:04 am
Location: Germany
Contact:

Re: Cron

Post by Dr.Death »

Update:

If I run the cron.php with the cron_type parameter "cron.task.core.email_reminder" it works in RC2:

http://localhost/phpbb31/cron.php?cron_type=cron.task.core.email_reminder

So the cron task itself is ok, but the framework of RC1/RC2 is not able to provide or detect the service.


Could someone provide a correct or an uptodate service.yml to extend the phpbb core cron system?
Doc.
User avatar
david63
Registered User
Posts: 19030
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Cron

Post by david63 »

I am not even convinced that the "basic" cron is running and/or being triggered.

As a test I set up a vanilla RC2 board - no extension no changes. I created a new forum category in which I created a new forum with auto pruning options set as low as possible (1 day) over a couple of days I made a few posts in this forum and non of them have been pruned despite the fact that I have not visited that particular forum.

I think that the main problem is being able to test cron on a small test forum - the best that I have been able to come up with is to put some add_log commands into the various cron files but non of them have been triggered.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: Cron

Post by nicofuma »

What is the result of the following commands?

Code: Select all

phpBB/bin/phpbbcli.php cron:list
phpBB/bin/phpbbcli.php config:get cron_lock
Member of phpBB Development-Team
No Support via PM
User avatar
david63
Registered User
Posts: 19030
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Cron

Post by david63 »

nicofuma wrote:What is the result of the following commands?

Code: Select all

phpBB/bin/phpbbcli.php cron:list
phpBB/bin/phpbbcli.php config:get cron_lock
I am getting respectively

Code: Select all

No route found for "GET /phpBB/bin/phpbbcli.php%20cron:list"
No route found for "GET /phpBB/bin/phpbbcli.php%20config:get%20cron_lock"
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: Cron

Post by nicofuma »

heu... you have to use the cli phpBB/bin/phpbbcli.php is the path to the script
Member of phpBB Development-Team
No Support via PM
User avatar
david63
Registered User
Posts: 19030
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Cron

Post by david63 »

nicofuma wrote:heu... you have to use the cli phpBB/bin/phpbbcli.php is the path to the script
Sorry but I don't know what you mean
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: Cron

Post by nicofuma »

https://blog.phpbb.com/2013/11/13/comma ... interface/ and the corresponding script is phpbbcli.php (located in bin/)
Member of phpBB Development-Team
No Support via PM
User avatar
david63
Registered User
Posts: 19030
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Cron

Post by david63 »

Sorry but I do not have shell access
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
Dr.Death
Registered User
Posts: 400
Joined: Fri Apr 25, 2003 10:04 am
Location: Germany
Contact:

Re: Cron

Post by Dr.Death »

Hi,

thanks for your help!

I receive this output in my Terminal:

Code: Select all

in /Applications/XAMPP/htdocs/phpbb31
./bin/phpbbcli.php cron:list
TASKS_READY
cron.task.core.tidy_database

TASKS_NOT_READY
cron.task.core.prune_all_forums
cron.task.core.prune_forum
cron.task.core.prune_shadow_topics
cron.task.core.prune_notifications
cron.task.core.queue
cron.task.core.tidy_cache
cron.task.core.tidy_plupload
cron.task.core.tidy_search
cron.task.core.tidy_sessions
cron.task.core.tidy_warnings

Code: Select all

in /Applications/XAMPP/htdocs/phpbb31
 ./bin/phpbbcli.php config:get cron_lock
0

Starting a cron task via cli shows no error messages:

Code: Select all

 ./bin/phpbbcli.php cron:run cron.task.core.tidy_cache 
But trying to start the new cron task (extended by my extension) like this:
./bin/phpbbcli.php cron:run cron.task.core.email_reminder
I receive this error message:
CRON_NO_SUCH_TASK

So, the cron framework is not aware of the new cron task from the extension provided by the Extension services.yml.

...but it has been worked before RC1(or RC2)
Doc.
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: Cron

Post by nicofuma »

You need the latest dev. version to be able to use in the cli a service added by an extension.
Member of phpBB Development-Team
No Support via PM
User avatar
Dr.Death
Registered User
Posts: 400
Joined: Fri Apr 25, 2003 10:04 am
Location: Germany
Contact:

Re: Cron

Post by Dr.Death »

Thanks!

Now the cron task was found on the cli .... I'll test it a little bit more and give you further feedback.....
Doc.
User avatar
Dr.Death
Registered User
Posts: 400
Joined: Fri Apr 25, 2003 10:04 am
Location: Germany
Contact:

Re: Cron

Post by Dr.Death »

ok,

sorry for bumping, but here some news:

Installed a complete fresh DEV phpBB 3.1 with a clean database.
Installed my Extension and enabled it.

Command line commands so far:

Resetting the cron-lock:

Code: Select all

./bin/phpbbcli.php config:set cron_lock 0
Successfully set config cron_lock
listing the existing cron tasks:

Code: Select all

./bin/phpbbcli.php cron:list
Ready tasks:
cron.task.core.email_reminder

Not ready tasks:
cron.task.core.prune_all_forums
cron.task.core.prune_forum
cron.task.core.prune_shadow_topics
cron.task.core.prune_notifications
cron.task.core.queue
cron.task.core.tidy_cache
cron.task.core.tidy_database
cron.task.core.tidy_plupload
cron.task.core.tidy_search
cron.task.core.tidy_sessions
cron.task.core.tidy_warnings
The cron task "cron.task.core.email_reminder" is now ready to start....

Code: Select all

./bin/phpbbcli.php cron:run cron.task.core.email_reminder
 
Fatal error: SQL ERROR [ mysqli ]<br /><br />You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [1064]<br /><br />An SQL error occurred while fetching this page. Please contact the <a href="mailto:dr.death@xxxx.de">Board Administrator</a> if this problem persists. in /Applications/XAMPP/xamppfiles/htdocs/phpBB/phpbb/db/driver/driver.php on line 844
An echo of the malformed $sql statement:

Code: Select all

SELECT *
			FROM phpbb_styles s
			WHERE s.style_id =
huuuu..... I've never created some kind of this sql statements in my Extension ...... :roll:

The cron task itself was running succesfully...... *weird*
Doc.
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: Cron

Post by nicofuma »

It's unrelated but you shouldn't name you service 'cron.task.core.email_reminder' it's not a cron task defined by the core^^

For the SQL error, it's because of the call $user->setup(). Anyway, with the cli (with the cron you can have an other user we because we can't know which one you should assume that it's ANONYMOUS), the user is always ANONYMOUS.
By the way, you should avoid the globals as possible they are deprecated (destined to disappear) and are kept only for compatibility with some legacy functions.
Member of phpBB Development-Team
No Support via PM
Locked

Return to “[3.1.x] Support Forum”