News:

Join the Facebook Fan Page.

Main Menu

Cron Error

Started by Grant, December 06, 2022, 07:26:56 PM

Previous topic - Next topic

Grant

Hi all,
I have been cleaning up my SMF sites and have a new problem. I have a cron job that seems to be throwing errors everytime I (or, indeed, anyone) does anything on the site. I think the errors were there before I upgraded to 2.1.3, but definitely still there now I have upgraded. The two errors I get are (I've xxx the site):
QuoteGuest
http://xxx/forum/cron.php
xxx/forum/Sources/Subs.php (Line 529)
Backtrace information

Type of error: Database
Error message Select
: Incorrect string value: '\xE0\xAE\x9A\xE0\xAE\xBF...' for column 'value' at row 1

and

QuoteGuest
http://xxx/forum/cron.php
xxx/forum/Sources/Subs-Db-mysql.php (Line 590)
Backtrace information

Type of error: Cron
Error message Select
8: Trying to access array offset on value of type null

Backtracing I get to line 131 of cron.php which is this:

Quote// At this point we could reseed the RNG but I don't think we need to risk it being seeded *even more*.
// Meanwhile, time we got on with the real business here.
while ($task_details = fetch_task())
{
   $result = perform_task($task_details);
   if ($result)
   {
      $smcFunc['db_query']('', '
         DELETE FROM {db_prefix}background_tasks
         WHERE id_task = {int:task}',
         array(
            'task' => $task_details['id_task'],
         )
      );
   }
}
obExit_cron();
exit;

Searching this forum I have found this: https://www.simplemachines.org/community/index.php?topic=582405.msg4125668#msg4125668 which suggests it's a UFT8 issue. But I can't find anything that isn't in UTF8 anywhere on the site.

Any pointers?

Many thanks,
Grant

Grant

Ah, sorry, I have sorted this now. For anyone else getting this issue:

I deleted all mods sequentially (all were smf updates back to around 1.0.8 anyway) and around 2.0.3 the errors stopped occurring. So, moral of the story ... delete all packages / mods and go again with the new install if you get this error.

Thanks,
Grant

Grant

Sorry - it's back. Hrumph!  >:(

Steve

Is this still a problem and what version are you on? Also, what version of PHP?
DO NOT pm me for support!

Grant

#4
Hi Steve,

Yes, it's still happening - thanks for following-up.

I'm now using PhP 8.1 (was using 7.2 in the past when problem began); and 2.1.3 of SMF (although the problem began with a much earlier version).

Even refreshing the page in a web browser causes the addition of two more errors to the error logs. The same errors though:

xxx/forum/Sources/Subs.php (Line 529)

and

xxx/forum/Sources/Subs-Db-mysql.php (Line 590)

Any ideas what might be causing this?

Many thanks,
Grant

Edit: ps. I have no mods and Integration Hooks is empty..

Doug Heffernan

Quote from: Grant on December 06, 2022, 07:26:56 PMBut I can't find anything that isn't in UTF8 anywhere on the site.

Are you sure that all the columns are utf-8 as well?

Grant

#6
Hi Doug,

Just in case I'm looking in the wrong place, where would I find this?

I've been looking in:

admin>config>languages>edit languages

and

admin>maintenance>Forum Maintenence>Database (and run the task)

Many thanks,
Grant

edit: corrected places looked.

live627

phpmyadmin

unless @shawnb61 has made a script for this...

Grant

Oh, there - server side.
Hmmm. Interesting. I seem to have both there as per the attached picture.You cannot view this attachment.
I'm going to go out on a limb here and assume this isn't good.
Is there a way of converting those instances?
Many thanks live627.

Doug Heffernan

Quote from: Grant on December 20, 2022, 02:55:32 AMI'm going to go out on a limb here and assume this isn't good.

Yes, you can say that. As you can see, your database contains a mixture of utf-8 and latin 1 collation. All the tables, and their fields too, should be utf-8.

Quote from: Grant on December 20, 2022, 02:55:32 AMIs there a way of converting those instances?

Yes, you can convert them from phpmyadmin.

Additionally have a look at this link on how to do a proper utf-8 conversion. It says it is for Smf 2.0 but it is valid for 2.1.x as well.

https://wiki.simplemachines.org/smf/UTF-8_Readme

shawnb61

I don't have a tool that automates the fix.  But I do have a tool that helps find any non-utf8 settings, tables or columns:
https://github.com/sbulen/sjrbTools/blob/master/smf_utf8_diag.php

The fixes are easy enough when done manually.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Grant

Ahh. And that does it! Thank you all. I changed all collations to utf8_general_ci and the problem has gone away.

For others coming across this thread, I followed the step by step pictures provided here as well as following the links provided above by shawnb61 and Doug.

Thank you all again - I'm learning quickly!

Best
Grant

Advertisement: