First run of Drupal on my Fedora Apache Server returns this error

MySQL server version for the right syntax to use near ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/www/html/drupal-6.4/includes/menu.inc on line 315.

HELP!!!!

Comments

cog.rusty’s picture

Run update.php once more to rebuild the menus.

If that doesn't work,
- check your php memory_limit (http://drupal.org/node/59680)
- increase it if it is not enough for Drupal 6 requirements (http://drupal.org/node/207036). Try 32M.
- go to phpmyadmin and drop all tables of your Drupal database
- copy (don't rename) sites/default/default.settings.php to settings.php
- start over

If that doesn't work either, it could be a cookie problem with your browser, but let's not get into that yet.

marcvangend’s picture

And by the way, when you start over, get Drupal 6.5.

cog.rusty’s picture

By the way, if the suggestions in my answer seem a bit "random" to you, take a look at this issue where people seem to be solving this kind of problem in a dozen different ways:

http://drupal.org/node/280015

From which I deduce that a random malfunction left the installation incomplete and, in my experience, the most usual causes are insufficient php memory and timeouts.

morrislex’s picture

I followed your instructions.... we are up !!!!

Thank you for your help

deSade’s picture

I tried all of the above and received the same error - until I realized I had cookies disabled on my browser. I dropped the tables, reset the settings.php file back to default, and tried the installation again. Everything installed properly.

Out of curiousity, I reset everything again and disabled cookies for my browser. Same error on line 315 in menu.inc. For me, the error was definitely due to disabled cookies.

ballin’s picture

user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\includes\menu.inc on line 315. 
user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\includes\menu.inc on line 315. 

I'm having this problem and so far nothing I have tried has fixed it.
PHP memory is set to 128M, I have tried recreating the DB multiple times using the default settings.php
I have allowed all cookies, added the site to the trusted sites etc in IE to no avail.

I am running drupal 6-6, Apache 2.2.10, MySQL 5.0.67 and PHP 5.2.6 so all latest versions (on Windows Server 2003 SP2).
Incidentally, if I try running update.php as suggested (even though this is a fresh installation), I receive:

Fatal error: Call to undefined function filter_xss_bad_protocol() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\includes\common.inc on line 898

cog.rusty’s picture

Check whether the filter.module file exists, and is located under modules/filter.
Then check your database, the system table, the filter module's entry, to see whether it is enabled (status=1) and has the correct path.

After fixing that, try running update.php again.

ballin’s picture

Hi,

The filter.module file does exist under modules/filter.
When I check the database, I cannot see a filter module entry in the system table.

I see the following : http://www.aseo23.dsl.pipex.com/drupal.jpg

(Hope you can see the image)
Thanks for your help!

cog.rusty’s picture

You are looking at the *structure* of the system table. You don't want that, you need to "browse" the table to see the entries in it, or "search" it to find the entry with name=filter, and check if its status=1 and if its path is correct.

I don't know what tools you have available for that. Don't you have phpmyadmin?

ballin’s picture

Ok I did as you said and changed the status to 1.
This then solved the problem with update.php.

However now, when I try to update it says No Update Available as I have the latest version. If I try to Update anyway, it opens http://172.26.248.41:8080/update.php?op=start&id=4 but is just a blank page.

I tried the previous version in the drop down box but the same problem. What am I supposed to do here if I have the latest version and there is nothing to upgrade to?

TIA!

cog.rusty’s picture

In Drupal 6, update.php is not only for updates, it also does some cleanup and rebuilds the menus. When it fails to complete, something is wrong.

If update.php does not complete successfully, check the requirements of Drupal 6 (see http://drupal.org/requirements) and especially the PHP memory limit (see http://drupal.org/node/207036). For a new Drupal installation you need at least 16M, and with additional modules you may need 32M or 64M or more.

Also, note that the filter module is one of the five "required" modules and should be enabled by default. It remains a mystery why it was disabled. So, take another look at the system table to make sure that the other "required" modules are enabled (status=1). Those are:
- block
- filter
- node
- system
- user

Then run update.php again and make sure that it completes.

ballin’s picture

I hate to keep coming back and bugging you, but I am still failing to get this fresh installation working!
I meet the requirements, and have 128M set for memory.
Most of thsoe modules were status=0 so I have changed them to 1 as suggested.

When I re-run update.php, I still receive a blank page.

I have looked at http://drupal.org/node/112884 but cannot get any errors to display on the browser.

Any further suggestions?!

cog.rusty’s picture

The still unanswered question is why were those modules disabled. Normally they just can't be disabled.

I would try a completely clean re-installation. I would drop all database tables, completely delete all Drupal files (in case the installer was picking some misplaced second copy of the files under the installation directory), upload Drupal again, and start over.

ballin’s picture

Okay I deleted everything, created a new database with a new name, and even installed drupal to a new directory and updated apache config.

I went in and checked the created DB and the only modules with a status of 1 are:
system
themes/garland

Every other status is 0.

I have tried a reinstall a few times and each time is the same result?!

cog.rusty’s picture

Are all subdirectories and files readable by apache? (Usually that means permissions at least 755 for the directories and at least 644 for the files.)

Are you using the default installation profile? (on the first page of the installer)

ballin’s picture

Actually I'm running this directly on the webserver ie. not uploading it via FTP. Therefore it is just default Windows permissions on the files and directories.
I will check what permissions should be given to the files as maybe that is the problem.

Yes I believe I used the default installation profile, didn't see any other option as far as I recall!

Thanks again for all your help!

cog.rusty’s picture

Try also to download a fresh Drupal 6.6 package, in case the one you have is somehow corrupted.

ballin’s picture

Unfortunately no change still :-(

I have downloaded a fresh copy of drupal, I have double-checked all the PHP/Apache/MySQL config and tried again.
Exactly the same process as before, the status of the modules remains 0 and the furthest I can get is a green tick after "Set up database" (even though it's not correctly created according to the status you say) then a blank frame where it should be Installing Site.

This is just a fresh install thats what I don't understand, how can it be so hard?!

marcvangend’s picture

Have you checked if your database user has all the necessary permissions? I quote from http://drupal.org/requirements:

NOTE: Drupal makes use of some features not available on some inexpensive hosting plans so please check that your host allows database accounts with the following rights:
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES

As of 6.x, Drupal core no longer requires CREATE TEMPORARY TABLES or LOCK TABLES, and can be installed without them. However some contributed modules may still rely on them.

ballin’s picture

I have full permissions yes, using the root account

Yura Filimonov’s picture

I am having the same problem on Drupal 6.6, cookies enabled, PHP memory limit at 128mb, local install (via WAMP 2.0c).

I am running multi-site and the first, default, site was installed and works ok. The second one I am having problems with, described above.

Also, when there's a timeout on any operation after the installation, most of the links in the admin navigation menu disappear and typing in the URLs directly doesn't work.