Answers.Body: <p>This is caused by <a href="https://lab.civicrm.org/dev/core/-/issues/4060" rel="nofollow noreferrer">this bug</a> introduced in 5.56. The related <a href="https://github.com/civicrm/civicrm-core/pull/25287" rel="nofollow noreferrer">pull request</a> fixes this.</p>
  <p>We will have to watchout when updating until the PR has been introduced.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-11T14:08:13.677Z
Answers.Text: The fix will be included with 5.57.1  If you need it fixed before then, it's a simple change.  See the PR.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-11T18:41:16.653Z
Answers.Text: Yes, I can confirm that it is a very easy 2 or 3 lines fix.
Answers.UserDisplayName: thoni56
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-08T21:14:52.717Z
Answers.LastActivityDate: 2023-01-08T21:14:52.717Z
Answers.UserDisplayName: thoni56
Answers.Body: <p>It might be from some bad smarty code in a template. You can try installing <a href="https://civicrm.org/extensions/smarty-message-template-error-handler" rel="nofollow noreferrer">https://civicrm.org/extensions/smarty-message-template-error-handler</a> or applying <a href="https://github.com/civicrm/civicrm-packages/pull/313/files" rel="nofollow noreferrer">this patch</a> which is roughly the same thing that might make the error more visible.</p>
  <p>Otherwise you could try running the job with <code>cv</code> and see if that gives a different error.</p>
  <p>I assume you've checked all the <a href="https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories">civi logs</a> too.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-21T12:23:26.087Z
Answers.Text: I tried to use `cv` to run the command but encountered this problem: https://github.com/civicrm/cv/issues/139. Are they related?
Answers.UserDisplayName: thoni56
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-21T12:29:41.700Z
Answers.Text: I installed Smarty, but it did not help. We do not use email templates. I installed CV and got the same Factory.php error as @thoni56. civi logs does not seem to show anything related to this error. There are entries in them, but all are timestamped well away from my job execute error.
Answers.UserDisplayName: Charlie Wilder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-21T15:52:18.893Z
Answers.Text: There is an incompatibility between how joomla does upgrades for extensions and civi where it doesn't delete the whole civi folder and so some old files get left behind that can cause problems. Maybe this is the issue. See the last paragraph at https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension. Are you able to replace the civicrm folder with one from a fresh install and see if that fixes it?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T17:53:43.973Z
Answers.Text: I moved the `civicrm` directory to the side and did a new install/upgrade to 5.56.1 so all files in `ROOT/administrator/components/com_civicrm/civicrm` are now fresh. Same problem.
Answers.UserDisplayName: thoni56
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-20T17:46:28.733Z
Answers.LastActivityDate: 2022-12-20T17:46:28.733Z
Answers.UserDisplayName: Demerit
Body: <p>I upgraded to 5.56.0 from 5.55.2, run in Joomla 3.10, and power with php 7.4.32 and apache httpd 2.4.54. The very next cron run produced &quot;Error&quot;. Running by hand also produces &quot;Error&quot;.</p>
  <p>There are no entries in access_log or error_log. Successive issuing of the cli command may produce warnings:</p>
  <pre><code>root@host:/var/log/httpd# php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd# php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  WARNING: Class Civi\Api4\Event\Subscriber\ActivityPreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\ContactPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\ContributionPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\CustomFieldPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\CustomGroupPreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\OptionValuePreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  Errorroot@host:/var/log/httpd#  php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd#  php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd#
  </code></pre>
  <p>What should we fix to remedy this issue?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-21T12:11:34.337Z
Comments.Text: Issue created here: https://lab.civicrm.org/dev/core/-/issues/4035
Comments.UserDisplayName: thoni56
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-01-05T11:27:53.537Z
Comments.Text: I have applied civicrm-5.57.0 and get the same uninformative message: Error. Occasionally, I get the WARNING messages too.
Comments.UserDisplayName: Charlie Wilder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-14T08:54:39.553Z
Comments.Text: Perhaps you could accept my answer, now that 5.57.1 has been out for a while.
Comments.UserDisplayName: thoni56
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-15T11:18:33.213Z
Comments.Text: I accept @thoni56's answer. See https://lab.civicrm.org/dev/core/-/issues/4035 for details.
Comments.UserDisplayName: Charlie Wilder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-15T11:38:05.277Z
Comments.Text: Thanks, on StackExchange sites you do that by pressing the checkmark on the left of the answer ;-)
Comments.UserDisplayName: thoni56
Tags: <joomla><php><cron-job><civicrm-home><scheduled-job>
Title: Cannot run scheduled jobs - cli.php errors out with uninformative "Error"
ThreadText: # Cannot run scheduled jobs - cli.php errors out with uninformative "Error"
  
  (Asked by: username_0 on 2022-12-20)
  
  I upgraded to 5.56.0 from 5.55.2, run in Joomla 3.10, and power with php 7.4.32 and apache httpd 2.4.54. The very next cron run produced "Error". Running by hand also produces "Error".
  There are no entries in access_log or error_log. Successive issuing of the cli command may produce warnings:
  root@host:/var/log/httpd# php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd# php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  WARNING: Class Civi\Api4\Event\Subscriber\ActivityPreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\ContactPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\ContributionPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\CustomFieldPreSaveSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\CustomGroupPreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  WARNING: Class Civi\Api4\Event\Subscriber\OptionValuePreCreationSubscriber was expected to have a service definition, but it did not. Perhaps it needs service name.
  Errorroot@host:/var/log/httpd#  php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd#  php .../administrator/components/com_civicrm/civicrm/bin/cli.php -u user -p pw -e Job -a execute
  Errorroot@host:/var/log/httpd#
  
  What should we fix to remedy this issue?
  
  **Tags:** joomla, php, cron-job, civicrm-home, scheduled-job
  
  > **Comments:**
  > **username_1**: Issue created here: https://lab.civicrm.org/dev/core/-/issues/4035  
  > **username_0**: I have applied civicrm-5.57.0 and get the same uninformative message: Error. Occasionally, I get the WARNING messages too.  
  > **username_1**: Perhaps you could accept my answer, now that 5.57.1 has been out for a while.  
  > **username_0**: I accept @username_1's answer. See https://lab.civicrm.org/dev/core/-/issues/4035 for details.  
  > **username_1**: Thanks, on StackExchange sites you do that by pressing the checkmark on the left of the answer ;-)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-01-08. Score: 2 | Accepted answer
  
  This is caused by [this bug](https://lab.civicrm.org/dev/core/-/issues/4060) introduced in 5.56. The related [pull request](https://github.com/civicrm/civicrm-core/pull/25287) fixes this.
  
  We will have to watchout when updating until the PR has been introduced.
  
  > **Comments:**
  > **username_2**: The fix will be included with 5.57.1  If you need it fixed before then, it's a simple change.  See the PR.  
  > **username_1**: Yes, I can confirm that it is a very easy 2 or 3 lines fix.  
  
  ---
  
  ### Answer by username_3 on 2022-12-20. Score: 0
  
  It might be from some bad smarty code in a template. You can try installing <https://civicrm.org/extensions/smarty-message-template-error-handler> or applying [this patch](https://github.com/civicrm/civicrm-packages/pull/313/files) which is roughly the same thing that might make the error more visible.
  
  Otherwise you could try running the job with `cv` and see if that gives a different error.
  
  I assume you've checked all the [civi logs](https://civicrm.stackexchange.com/questions/15931/where-are-the-configandlog-and-templates-c-directories) too.
  
  > **Comments:**
  > **username_1**: I tried to use `cv` to run the command but encountered this problem: https://github.com/civicrm/cv/issues/139. Are they related?  
  > **username_0**: I installed Smarty, but it did not help. We do not use email templates. I installed CV and got the same Factory.php error as @username_1. civi logs does not seem to show anything related to this error. There are entries in them, but all are timestamped well away from my job execute error.  
  > **username_3**: There is an incompatibility between how joomla does upgrades for extensions and civi where it doesn't delete the whole civi folder and so some old files get left behind that can cause problems. Maybe this is the issue. See the last paragraph at https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension. Are you able to replace the civicrm folder with one from a fresh install and see if that fixes it?  
  > **username_1**: I moved the `civicrm` directory to the side and did a new install/upgrade to 5.56.1 so all files in `ROOT/administrator/components/com_civicrm/civicrm` are now fresh. Same problem.  
  
  ---
  
  