Jump to content

[SOLVED] Argument 1 passed to Blesta\Core\Automation\TaskFactory::cronTask() must be an instance of stdClass, bool given


Anton Qcl

Recommended Posts

[2021-01-28T07:15:01.624512+00:00] general.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Blesta\Core\Automation\TaskFactory::cronTask() must be an instance of stdClass, bool given, called in /var/www/vhosts/hdzona.tv/public_html/app/controllers/cron.php on line 486" at /var/www/vhosts/hdzona.tv/public_html/core/Automation/TaskFactory.php line 74 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Blesta\\Core\\Automation\\TaskFactory::cronTask() must be an instance of stdClass, bool given, called in /var/www/vhosts/hdzona.tv/public_html/app/controllers/cron.php on line 486
at /var/www/vhosts/hdzona.tv/public_html/core/Automation/TaskFactory.php:74)"}

 We have only standard plugins but this error appears every cron run since upgrade to 5.0.2
ENV: centos7, php7.4, mariadb10.4

Link to comment
Share on other sites

1 hour ago, Anton Qcl said:

[2021-01-28T07:15:01.624512+00:00] general.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Blesta\Core\Automation\TaskFactory::cronTask() must be an instance of stdClass, bool given, called in /var/www/vhosts/hdzona.tv/public_html/app/controllers/cron.php on line 486" at /var/www/vhosts/hdzona.tv/public_html/core/Automation/TaskFactory.php line 74 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Blesta\\Core\\Automation\\TaskFactory::cronTask() must be an instance of stdClass, bool given, called in /var/www/vhosts/hdzona.tv/public_html/app/controllers/cron.php on line 486
at /var/www/vhosts/hdzona.tv/public_html/core/Automation/TaskFactory.php:74)"}

 We have only standard plugins but this error appears every cron run since upgrade to 5.0.2
ENV: centos7, php7.4, mariadb10.4

Are any of your automation tasks not completing successfully? Settings > Company > Automation. Were you running PHP 7.4 prior to upgrading to Blesta 5.0.2?

Link to comment
Share on other sites

SOLVED: some of required entries in cron_task_runs were missing. 

List:
process_service_changes for all companies
backups_sftp for company 0
backups_amazons3 for company 0
license_validation for company 0

SQL commands.
For process_service_changes. Note (use your own company ids):
 

INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '29', '2', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '29', '3', NULL, '5', '1', NOW());

 

For other tasks:
 

INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '9', '0', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '14', '0', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '17', '0', NULL, '5', '1', NOW()); 


 

Link to comment
Share on other sites

  • Anton Qcl changed the title to [SOLVED] Argument 1 passed to Blesta\Core\Automation\TaskFactory::cronTask() must be an instance of stdClass, bool given
19 minutes ago, Anton Qcl said:

SOLVED: some of required entries in cron_task_runs were missing. 

List:
process_service_changes for all companies
backups_sftp for company 0
backups_amazons3 for company 0
license_validation for company 0

SQL commands.
For process_service_changes. Note (use your own company ids):
 


INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '29', '2', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '29', '3', NULL, '5', '1', NOW());

 

For other tasks:
 


INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '9', '0', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '14', '0', NULL, '5', '1', NOW()); 
INSERT INTO `blesta`.`cron_task_runs` (`id`, `task_id`, `company_id`, `time`, `interval`, `enabled`, `date_enabled`) VALUES (NULL, '17', '0', NULL, '5', '1', NOW()); 


 

I'm glad that fixed it, thanks for the update! :) Service Changes task was added back in version 3.5, so something may have gone wrong then that wasn't obvious until now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...