PDA

View Full Version : Database Error from cron jobs


acegames
10-18-2007, 08:13 AM
Hope somebody can help me fix this problem , I am getting emails with a database error from a cron job and need help tracing what is causing it

Database error in vBulletin 3.6.8:

Invalid SQL:

UPDATE user AS user
SET user.threads =
(
SELECT COUNT(threadid)
FROM thread AS thread
LEFT JOIN forum AS forum ON forum.forumid = thread.forumid
WHERE visible = 1
AND (forum.options & 4096)
AND user.userid=postuserid
);

MySQL Error : You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'SELECT COUNT(threadid)
FROM thread AS thread
LEFT JO
Error Number : 1064
Date : Thursday, October 18th 2007 @ 02:13:36 AM
Script : http://www.acegames.us/forum/cron.php?&rand=256860
Referrer : http://www.acegames.us/forum/
IP Address : 195.93.21.5
Username : Unregistered
Classname : vb_database

Marco van Herwaarden
10-18-2007, 08:16 AM
What MySQL version are you using?

You should be able to determine the Scheduled Task causing this problem, by comparing the time the error occurs and the time set for each Scheduled Task.

acegames
10-18-2007, 08:32 AM
Hello thankyou for the quick reply , I am using MySQL Version 4.0.27-standard

I have just ran my cron jobs one by one and found it is from :

Hourly Cleanup
This script performs various cleanup tasks once per hour.

How can I fix this please ?

Paul M
10-18-2007, 09:04 AM
That code is being run by a modification you have installed, and is using syntax that will not work on the version of mysql you have installed. You can either disable the modification or upgrade mysql.

acegames
10-18-2007, 09:08 AM
Thankyou , found it and its Zoints Thread Tags causing it , I have had that installed from the time it was released though

--------------- Added 1192706309 at 1192706309 ---------------

After disabling zoints trags it fixed the error but now an hour later its back

Marco van Herwaarden
10-18-2007, 10:34 AM
The standard "Hourly Cleanup" does not contain this query. It might be a modification that uses a plugin at the 'cron_script_cleanup' hook location.

And as Paul already mentioned, that query is not valid for MySQL 4.0.

acegames
10-18-2007, 10:39 AM
ok thankyou will investigate further