Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 30, 20222 yr Hello, I just updated my community to the last version released today. Since I did it, I've started to get strange notifications about locked tasks. They won't go away. Why is that? See attachment. Thanks
November 30, 20222 yr Community Expert According to the error log you're not using PHP8 for the CLI cron job, even if your TASK setting shows the path to the php8 executable. I've called the locked tasks from the ACP where they worked without any problems and have added some logging code to the applications/core/interface/task/task.php to see what's going on.
November 30, 20222 yr Depending on your set up for cronjobs it can be that your path in the cronjob (config) still points to the 7.4 executable. If you use Plesk f.e. and you use their menu for cronjobs where you have to provide the absolute path to PHP this can happen. It happened for me when I changed my PHP version and forget about the cronjobs. But you can't see this in ACP. Edited November 30, 20222 yr by Hatsu
November 30, 20222 yr Community Expert Solution Can you confirm that you also updated the cron job after switching the PHP version? Depending on your set up for cronjobs it can be that your path in the cronjob (config) still points to the 7.4 executable. If you use Plesk f.e. and you use their menu for cronjobs where you have to provide the absolute path to PHP this can happen. It happened for me when I changed my PHP version and forget about the cronjobs. But you can't see this in ACP. Yea, I'm quite sure that it's this. The current command in the ACP to create the cron job points to /opt/cpanel/ea-php80/root/usr/bin/php so anything created with PHP7.x would have pointed to /opt/cpanel/ea-php7....
November 30, 20222 yr Author Can you confirm that you also updated the cron job after switching the PHP version? I didn't know about the Cron job path. I will check out the cPanel and confirm it's correctly setup. I've been running the community on PHP 8 for a few weeks now without these issues and I didn't update any Cron job settings.
November 30, 20222 yr Community Expert I didn't know about the Cron job path. I will check out the cPanel and confirm it's correctly setup. I've been running the community on PHP 8 for a few weeks now without these issues and I didn't update any Cron job settings. Yea we're just starting to utilize the new PHP8 features and new functions, so there's now a new function being used inside our Mail Class which is only available in PHP>8 So each time a mail is being sent via the cron, it results in Quote Error: Call to undefined function str_starts_with() (0) #0 /home/.../init.php(927) : eval()'d code(144): IPS\_Email::_parseElementForClickTracking(Object(DOMElement), '..')
November 30, 20222 yr Author I fixed the issue I had this morning. I only needed to change the cron job command line to make it work with PHP 8.0. Thanks a lot
November 30, 20222 yr Community Expert We're going to improve the code for the CLI task system so that a warning is logged when the wrong php version is being used.
November 30, 20222 yr We're going to improve the code for the CLI task system so that a warning is logged when the wrong php version is being used. Good idea. With every new version I see a thread with "locked task". A lot of people forget to update the cron path after changing the PHP version.
November 30, 20222 yr Community Expert Good idea. With every new version I see a thread with "locked task". A lot of people forget to update the cron path after changing the PHP version. Us too 😄 lol