Body: <p>I'm getting some errors when running the schedule job for mail processing from our cron and via command line. I have tried with both the cv command and the drush command, both give similar errors pointing to Smarty. I cannot figure out what is going on. This is on Core 5.74.4 and Smarty 3 is turned on in the settings.</p>
  <p>When I run: <code>/usr/local/bin/cv api job.process_mailing --user=Feicron --cwd=/var/www/civicrm</code>, I get:</p>
  <pre><code>In smarty_resource_recompiled.php(52) : eval()'d code line 35:
  
    Unsupported operand types: string - string
  </code></pre>
  <p>When I run: <code>drush civicrm-api -u 1 job.process_mailing</code>, I get:</p>
  <pre><code>Drush command terminated abnormally due to an unrecoverable error.                                                                                                                                     [error]
  Error: A non-numeric value encountered in /var/www/civicrm/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code, line 35
  </code></pre>
  <p>If I just run <code>/usr/local/bin/cv api job.execute --cwd=/var/www/civicrm</code> (without the user), it looks like it runs fine (shows a return with is_error = 0), but I then go into the process_mailing job log, and it shows this error:</p>
  <pre><code>Finished execution of Mailings scheduler with result: Failure, Error message: API permission check failed for Group/get call; insufficient permission: require access CiviCRM
  </code></pre>
  <p>That makes me think I have to include the user. But then I get the other errors. I'm not sure if this is a bug with mail processing and Smarty or if I'm just doing something wrong here. Any ideas?</p>
  <p>I also now end up with a bunch of scheduled mailings in a &quot;Running&quot; state (though they never ran and sent) and don't know how to reset those. Any help would be appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-02T17:18:26.597Z
Comments.Text: The first thing I would do is switch to smarty 4 in civicrm.settings.php. At this point the answer to any question about smarty 3 is try 4. Just change the 3 to a 4.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-09T14:14:16.517Z
Comments.Text: @Demerit, this did not work. I changed to 4 and it gives the same error.
Comments.UserDisplayName: Paul B
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-09T15:14:48.107Z
Comments.Text: Based on the first error you probably have some code in the mailing it doesn't like. Are you using smarty in your civimails?
Comments.UserDisplayName: Demerit
Tags: <scheduled-job>
Title: Smarty Errors When Running job.process_mailing API
ThreadText: # Smarty Errors When Running job.process_mailing API
  
  (Asked by: username_0 on 2024-08-02)
  
  I'm getting some errors when running the schedule job for mail processing from our cron and via command line. I have tried with both the cv command and the drush command, both give similar errors pointing to Smarty. I cannot figure out what is going on. This is on Core 5.74.4 and Smarty 3 is turned on in the settings.
  When I run: /usr/local/bin/cv api job.process_mailing --user=Feicron --cwd=/var/www/civicrm, I get:
  In smarty_resource_recompiled.php(52) : eval()'d code line 35:
  
    Unsupported operand types: string - string
  
  When I run: drush civicrm-api -u 1 job.process_mailing, I get:
  Drush command terminated abnormally due to an unrecoverable error.                                                                                                                                     [error]
  Error: A non-numeric value encountered in /var/www/civicrm/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code, line 35
  
  If I just run /usr/local/bin/cv api job.execute --cwd=/var/www/civicrm (without the user), it looks like it runs fine (shows a return with is_error = 0), but I then go into the process_mailing job log, and it shows this error:
  Finished execution of Mailings scheduler with result: Failure, Error message: API permission check failed for Group/get call; insufficient permission: require access CiviCRM
  
  That makes me think I have to include the user. But then I get the other errors. I'm not sure if this is a bug with mail processing and Smarty or if I'm just doing something wrong here. Any ideas?
  I also now end up with a bunch of scheduled mailings in a "Running" state (though they never ran and sent) and don't know how to reset those. Any help would be appreciated.
  
  **Tags:** scheduled-job
  
  > **Comments:**
  > **username_1**: The first thing I would do is switch to smarty 4 in civicrm.settings.php. At this point the answer to any question about smarty 3 is try 4. Just change the 3 to a 4.  
  > **username_0**: @username_1, this did not work. I changed to 4 and it gives the same error.  
  > **username_1**: Based on the first error you probably have some code in the mailing it doesn't like. Are you using smarty in your civimails?  
  
  ---
  
  ## 0 answers
  
  