About 5pm yesterday, our drupal site at http://www.workersliberty.org just died:
-
Fatal 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 '' at line 1 query: SELECT title FROM node WHERE nid= in /home/newawl/www/includes/database.mysql.inc on line 97
-
I stopped MySQL and checked all the tables. Nothing wrong, even on extended check. The error appears on every possible URL within the site, and seems to suggest that drupal is sending a malformed query to the database.
Drupal is 4.4.1 (yeah, I know, we've been meaning to upgrade for a while), php is 4.3.10-15 and MySQL is Ver 12.22 Distrib 4.0.24 - nothing has changed in recent days, yet suddenly this lot won't talk to each other.
Any thoughts?
Many thanks,
Nick
Nick Holden wrote:
Fatal 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 '' at line 1 query: SELECT title FROM node WHERE nid= in /home/newawl/www/includes/database.mysql.inc on line 97
I stopped MySQL and checked all the tables. Nothing wrong, even on extended check. The error appears on every possible URL within the site, and seems to suggest that drupal is sending a malformed query to the database.
Drupal is 4.4.1 (yeah, I know, we've been meaning to upgrade for a while), php is 4.3.10-15 and MySQL is Ver 12.22 Distrib 4.0.24 - nothing has changed in recent days, yet suddenly this lot won't talk to each other.
I think you are right that Drupal is sending a malformed query. It appears to be specifically the book.module that is generating it (or possibly a contributed module).
The next step is kind of tough. It's being generated on your home page, so among the questions I have is what you have as a setting for your default front page in the admin->settings menu (try http://www.workersliberty.org/admin/settings or umm, http://www.workersliberty.org/?q=admin/settings) to see if you can look at it.
Also, it might be useful to see the error log, if you can get to it. Try http://www.workersliberty.org/admin/logs/error or http://www.workersliberty.org/?q=admins/logs/error).
I hope I have those non-clean URLs right, with the ?q= bits.
You might try disabling the book module, if you can get there: http://www.workersliberty.org/admin/modules or http://www.workersliberty.org/?q=admin/modules.
..chrisxj
On Monday 28 November 2005 22:09, Chris Johnson wrote:
The next step is kind of tough. It's being generated on your home page, so among the questions I have is what you have as a setting for your default front page in the admin->settings menu (try http://www.workersliberty.org/admin/settings or umm, http://www.workersliberty.org/?q=admin/settings) to see if you can look at it.
Also, it might be useful to see the error log, if you can get to it. Try http://www.workersliberty.org/admin/logs/error or http://www.workersliberty.org/?q=admins/logs/error).
I hope I have those non-clean URLs right, with the ?q= bits.
You might try disabling the book module, if you can get there: http://www.workersliberty.org/admin/modules or http://www.workersliberty.org/?q=admin/modules.
Thanks, Chris, and although you were wrong about the book module you did make me look again at the fact the problem was showing up on every page, and therefore it had to be caused by something in a block which was called from every page. Sure enough I figured it out tonight - there was a custom-written module block which scanned the most recent fifty comments in order to list the five unique stories with most recent comments, and for the first time since the module was written six months ago, fifty comments was not enough to find five unique node ids. So the fifth search was for the content of a node with a null id. Hence the breakdown.
I guess the lessons are (a) it's always what changed what broke it, and (b) if there's core code and user code it's the user code what broke it, too.
Thanks for your patience. I'll just go back to loving drupal now.
Nick