Setup:
PHP Version 5.2.0-8+etch11
MySQL version: 5.0.32-Debian_7etch5-log
Drupal Version: 6.x-dev 2008-Jul-08

Using a clean installation I tried to run install.php, which worked fine until the point "Install Site" where it canceled with these errors:

* 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 test_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/drupal2/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 test_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /var/drupal2/includes/menu.inc on line 315.

I didn't have this problem with 6.2 and the previous 6.x-dev version (I think it was from Jul-05)

The generated test_menu_router is empty, that's why the errors come.

Any ideas how to get this running?

Comments

k1tsune’s picture

Found the trigger for the bug (if this isn't a feature):
If the $cookie_domain is wrong, for example 'example.com', then you get this bug.

SolaFide001’s picture

Title: cannot install drupal » cannot install drupal - $cookie_domain is not the answer, but it is close!
Version: 6.x-dev » 6.3

I have been having this failure to install on 6.3 over approximately 20 retries, using every technique that someone has reported to work, including the the $cookie_domain. Mine was unset (the default). I set it to the domain I am installing for, and it STILL failed with the same error.

I do think the cookie issue is very close to the problem - I deleted cookies, so that should have solved it, but it did not (using Firefox 3.0.1). However, as a final effort I changed browsers (to Konqueror, but I suspect anything new would work) and it worked perfectly.

om457’s picture

Version: 6.3 » 6.4

What additional information is needed to debug or remedy this error? How can I help?

Drupal 6.4
OpenSolaris
php 5
mySQL client 5.0.51
FF 3.0.1

* 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 /users/home/mysite/web/public/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 /users/home/mysite/web/public/includes/menu.inc on line 315.

om457’s picture

Title: cannot install drupal - $cookie_domain is not the answer, but it is close! » cannot install drupal - menu_router error
ravendas’s picture

I started installing previous fresh versions to see where this bug first appeared, and it looks like 6.2-6.4 all have it. Installation of 6.1 was just fine, and subsequent upgrades to 6.2->6.3->6.4 worked as well. I never messed with any cookies and all installs were through IE 7. Hope that helps.

gurubert’s picture

Hi, I just came accross this issue after trying to install another site bsides my default drupal site.

I have enabled $cookie_domain after reading settings.php because the new site will be served from 3 different domain names (using symlinks in the sites directory).

I got the SQL error message and finally found this bug report.

I commented $cookie_domain (unset it), deleted all previously created database tables and retried install.php and it works now.

Drupal version is 6.4

om457’s picture

re: Drupal 6.4 and 6.1

I tried uncommenting $cookie_domain in the settings.php file and deleted the tables but your suggestion did not work for me.

What is the function of menu_router? Or more importantly, what is the problem with the mySQL query?

* 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 iona_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /users/home/mysite/web/public/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 iona_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /users/home/mysite/web/public/includes/menu.inc on line 315.

dannygoh’s picture

I encountered this issue with drupal 6.4 + firefox 3.0.1, tried reinstall 5 times but still that same error.

I then fire up IE-7 as Ravendas did, clear all browser caches, and it gets installed beautifully (as usual)!

I think that's something to do with the browser cache or cookies. Hope you'll try it.

krf’s picture

Yes, i confirm that the last comment solved the issue for me. My browser denies all cookies per default. When enabling those for my site the install went on (had to clear database and to extract the tarball again). Thank you.

nevets’s picture

I found the error due to the install failing (did not complete) and that was due to the PHP memory limit being too low.

unscarred1925’s picture

I have exactly the same problem as you guys and my site was down for 3 days because i can't find an answer until this post. So thanks man this is how did it.
1. Empty my database and restored them back
2. Enter www.yoursite.com/install.php and go to view existing site
3. OMG! Everything is back to normal

D 6.4
Firefox 3.0.3
Mysql 5.0.51a

asteffes’s picture

I've just run into the problem while attempting to install a multi-site installation using WAMP server and Firefox 3.03.

I'm new to Drupal, so this is a test install and I am able to drop my database and start over from scratch using I.E. 6.0; however I've heard the term "empty my database" multiple times.

Can someone please explain to me the process of "emptying' a database? Are you going through each table and deleting all rows?

Thanks in advance.

andypost’s picture

A lot of visitors of drupal.ru site are catch this bug and everytime it happens with 6.2-6.4 fresh install using FF as browser

dropcube’s picture

Status: Active » Closed (duplicate)
andypost’s picture

Status: Closed (duplicate) » Postponed (maintainer needs more info)

This is not dup - this against 6.x branch and depends on browser!

alexanderpas’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

It might not be an exact duplicate of #261148: menu_masks variable is empty (race condition), however the source of this bug is exactly the same as #307937: MYSQL Syntax error on installation with pre-filled tables (and #261148: menu_masks variable is empty (race condition)), therefor confirming duplicate status.

The browser issue might be a browser-side caching issue...

Let's fix this first in HEAD, then backport to released versions.

reaneyk’s picture

I'm not so sure it's browser specific. I've been using bash and Perl scripts to kick off an install with previous versions of Drupal and now I'm running into the same problem.

robbt’s picture

Wow, I'm having this exact problem as well, in both Firefox and Safari. I do get this error before the error everybody else is repeating.

Warning: Table 'database.system' doesn't exist query: SELECT filename FROM system WHERE name = 'content' AND type = 'module' in /home/www/drupal-6.4/includes/database.mysql.inc on line 128

Warning: include_once(/content.module) [function.include-once]: failed to open stream: No such file or directory in /home/www/drupal-6.4/sites/all/modules/content_taxonomy/content_taxonomy.install on line 6

Warning: include_once() [function.include]: Failed opening '/content.module' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/drupal-6.4/sites/all/modules/content_taxonomy/content_taxonomy.install on line 6

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/drupal-6.4/includes/database.mysql.inc:128) in /home/www/drupal-6.4/includes/bootstrap.inc on line 981

Warning: Cannot modify header information - headers already sent by (output started at /home/www/drupal-6.4/includes/database.mysql.inc:128) in /home/www/drupal-6.4/includes/bootstrap.inc on line 582

Warning: Cannot modify header information - headers already sent by (output started at /home/www/drupal-6.4/includes/database.mysql.inc:128) in /home/www/drupal-6.4/includes/bootstrap.inc on line 583

Warning: Cannot modify header information - headers already sent by (output started at /home/www/drupal-6.4/includes/database.mysql.inc:128) in /home/www/drupal-6.4/includes/bootstrap.inc on line 584

Warning: Cannot modify header information - headers already sent by (output started at /home/www/drupal-6.4/includes/database.mysql.inc:128) in /home/www/drupal-6.4/includes/bootstrap.inc on line 585

robbt’s picture

I figurted out what this was for me, it was most likely having too many modules under my sites/all/modules thus causing the script to time-out or not be able to properly add the scripts, or this was fixed in 6.5.
I tried to install without multisites without all of the modules and it worked flawlessly.

grendzy’s picture

Version: 6.4 » 6.6
Status: Closed (duplicate) » Active

This bug is still occurring for me on Drupal 6.6 (which has the patch from #261148: menu_masks variable is empty (race condition) applied), so I'm not so sure it's a duplicate.

I'm using a completely unmodified D6.6 copy, with no contrib modules, and an empty database. The error was present in both Safari and Firefox.

Eventually, refreshing install.php several times allowed the install process to finish.

alexanderpas’s picture

Status: Active » Postponed (maintainer needs more info)

could you please post the exact error message you're getting now...
do you use a pre-filled your settings.php? (no input database settings when installing)
what is your memory limit?
did you clean your cookies?

I currently am unable to replicate...

grendzy’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

alexanderpas, thanks for your reply! I think I know what caused the error. I had an underscore in my domain name, which causes Safari to refuse the session cookie. (Sorry, I didn't save the error - Do let me know if you think there's a real issue here, and I'll try to reproduce it so I can paste the full text.)

For now I'm going to assume that this is indeed resolved. Thanks!

CeramicWeasel’s picture

The error is as follows:

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 d:\Inetpub\wwwroot\drupal\includes\menu.inc on line 315.

I received this on a fresh install (default settings.ini), and repeatedly after I tweeked the settings.ini and made sure all the database info had been entered correctly.
My PHP memory limit was originally 8MB, then changed to 16MB with no success.
Cookies have been cleaned and database dropped and recreated before each retry. I've tried it in Firefox and IE6, with the same results.

The solution presented by chaosprime in http://drupal.org/node/247360 got me past the error, though it's still not finishing the install. It just stops on "Install site" with "Home" up the top of the page.

Obviously the issue is with $placeholders not being set.

Frank Steiner’s picture

I had the same problem. I was using Opera and it was not enough to enable cookies for my specific drupal server. I had to enable cookies in general, for all sites, for foreign domains, whatever. Just accepted every possible cookie. Then I dropped and recreated my drupal table in mysql. Then the installation went fine.

After the installation I could disable cookies in the global settings again (and just enable cookies for the drupal server in the per-site settings).

So it was definitely the cookies settings in the browser.

nikitas’s picture

Hi there . . .
well i m having the same problem . . . and while i was trying to make it work (drupal 6.8) with firefox 3.0.5 the wrong sql syntax kept showing up no matter what . . . so i opened chrome and run it again but now . . . i get PAGE NOT FOUND . . . ? and from firefox i m stucked at home/drupal page . . .
is this something or what? come on guys i spent hours reading about drupal vs joomla and i decided to go with drupal . . . but now i see strange problems . . . ( sorry about this but no one told that i would spent 2 days and about 10 hours working only with the installation process only plus i dont know if my test site will work afterwards at the real server!)
p.s i m runnig windows xp pro +sp3 with wamp 2 on it.and i m using the system32/etc/hosts file with
127.0.0.1 http://www.drupal.gt ( as for my c:\wamp\www\drupal test site ) plus the http-vhosts file from apache.
i have installed REMOVE COOKIES as an extension with firefox but still no luck!
oh sorry . . .
I wish to all a very very very Happy new Year.

vaobeheer’s picture

We had some same errors. We had used a script (openx advertisement) that causes the cookies to be used by drupal AND openx.
http://drupal.org/node/247039

Maybe this helps.

cmayberry’s picture

I am having problems with 6.9 I think are related to this. This is the error I get when I tryot upgrade from 5.12 to 6.9. A clean istall works fine but with the upgrade one I copy over the sites folder it throw this:

Warning: Unknown column 'serialized' in 'field list' query: SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'variables' in /export/home/users/wwwadmin/www-test/includes/database.mysql.inc on line 128

Warning: Unknown column 'serialized' in 'field list' query: UPDATE cache SET data = 'a:311:{s:13:\"theme_default\";s:9:\"andreas01\";s:13:\"filter_html_1\";i:1;s:18:\"node_options_forum\";a:1:{i:0;s:6:\"status\";}s:17:\"menu_primary_menu\";i:2;s:19:\"menu_secondary_menu\";i:2;s:15:\"install_profile\";s:7:\"default\";s:17:\"node_options_page\";a:1:{i:0;s:6:\"status\";}s:12:\"comment_page\";i:0;s:18:\"drupal_private_key\";s:64:\"fd0681f680a29248675065152298c8ed245aff8456f6d8522531217efd6dc0c0\";s:19:\"file_directory_temp\";s:4:\"/tmp\";s:13:\"image_updated\";i:1186074908;s:18:\"image_default_path\";s:6:\"images\";s:21:\"image_max_upload_size\";s:3:\"800\";s:11:\"image_sizes\";a:3:{s:9:\"_original\";a:5:{s:5:\"label\";s:8:\"Original\";s:5:\"width in /export/home/users/wwwadmin/www-test/includes/database.mysql.inc on line 128

Warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/bootstrap.inc on line 620

Warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/bootstrap.inc on line 621

Warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/bootstrap.inc on line 622

Warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/bootstrap.inc on line 623

Warning: Unknown column 'language' in 'where clause' query: SELECT src FROM url_alias WHERE dst = 'upgrade' AND language IN('en', '') ORDER BY language DESC in /export/home/users/wwwadmin/www-test/includes/database.mysql.inc on line 128

Site off-line

warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/common.inc on line 141.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 463.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 468.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 463.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 468.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 463.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 468.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 463.
warning: Invalid argument supplied for foreach() in /export/home/users/wwwadmin/www-test/includes/theme.inc on line 468.
warning: Cannot modify header information - headers already sent by (output started at /export/home/users/wwwadmin/www-test/includes/database.mysql.inc:128) in /export/home/users/wwwadmin/www-test/includes/common.inc on line 141.
user warning: Unknown column 'language' in 'where clause' query: SELECT src FROM url_alias WHERE dst = 'node' AND language IN('en', '') ORDER BY language DESC in /export/home/users/wwwadmin/www-test/includes/path.inc on line 80.
We're working on updates for the site. Please check out the updates later.

Please help

djflux’s picture

Version: 6.6 » 6.9

I was having the same problem with 6.9. It definitely appears to be cookie-related.

I usually install Drupal directly from the drupal.org source tarball, but this time I tried the Fedora 10 RPM. In /etc/httpd/conf.d/drupal.conf there is an option to enable security cookies:

php_flag session.cookie_secure on

The initial install from the Fedora package has this config line commented out. I thought I'd enable it in case I was going to use SSL/TLS later. Evidently this option cause issues with not only login on a non-SSL site, but also causes the menu_router installation issue. I commented out the line again, restarted my web server and the installation then proceeded normally.

Hope this helps someone in the future/fix this bug.

XP-Internet.com’s picture

I had the same problem on a fresh install in IE, which is set to ask me for authorising cookies. Reseting settings.php, wiping the whole database and installing again with Firefox (which accepts cookies) solved the problem.

I am using Drupal 6.10. Hope this helps.

blup’s picture

I'm having this same problem right now. I'm trying to do an upgrade through IE, all cookies erased, and I get this error. I'm kind of new to this, and I already have my website files and database backed up. If I were to install this on a fresh database, could i later load the info from my current database into it? It seems most people who solve the problem is through wiping their database clean. :S

binford2k’s picture

heh. My problem here was forgetting to enable cookies in my browser. Go me.

jmlavarenne’s picture

I solved the same problem as in the first post by manually changing the connection url in the setting page from mysqli to mysql.

David_Rothstein’s picture

It's still the case in Drupal 7 that if you don't have cookies enabled, the installer fails with similar errors (although not quite the same as the ones reported here for Drupal 6).

#791004: Installer does not warn the user that cookies must be enabled with the correct cookie domain (and fails when they aren't)

Since this is an old issue and it's hard to tell how many of the various problems here are related to cookies being disabled or not, I think it's best to use that new issue for the specific case of cookies not being correctly enabled.

Dave Sandilands’s picture

StatusFileSize
new53.96 KB
new40.91 KB
new60.05 KB

I had the same problem today in version 6.16 when doing a fresh install of a subdomain on a test pc (Win 7, XAMPP).

Using the experiences of those excellent people that had reported this problem before (many thanks to you all) I started to run through the possible solutions:
First of all I removed recently added modules (there were quite a few), deleted and recreated an empty database then ran the install - no change, same problem.
Second, I commented out $cookie_domain in settings.php, deleted and recreated an empty database then ran the install , which this time completed without any error.

However, I'm unconvinced that this is the source of the problem as I had created another subdomain less than a week ago without any problem at all. The only difference since then, apart from subdomain names, was the addition and update of a few modules in sites/all and the possibility that I used a different browser; this time I was using Flock, a variant of FireFox, I may have used FireFox the 1st time.

I checked the settings for Flock and there are cookies for both Drupal.org and my new local subdomain (see attached screenshots). To me, that means cookies are allowed (please correct me if I'm wrong), and , if so, I fail to see why commenting out $cookie_domain in settings.php should make a difference. The trouble is that it does, in this instance, so I obviously don't know much!

I hope this helps anyone that is looking into this and I would really like to know the result :)

pollard.tom’s picture

I was getting the same problem this morning on a fresh install of 6.16 with no added modules and without having made any changes to settings.php. (The $cookie_domain setting is commented out.) I'm just a newbie - I've been working through the examples in 'Using Drupal' and this problem popped up for me just today for the first time, on Chapter 9. In my case, dropping and recreating the database with a different name solved the problem.

pyliu8621’s picture

Version: 6.9 » 6.17

I was still getting into this problem. I am using Drupal 6.17:
IE8, MySQL:5.0.22, PHP:5.2.12, Apache:2.2.14. (Right, Windows OS)
I tried uncommenting the $cookie_domain and setting it to: "oa.local" which is one of my Appache domains.
And I set IE to accept cookie and recreate the database every time, but no luck, always in such issue.
Does anyone have a suggestion?

pyliu8621’s picture

I tried redoing with my Chrome browser. First I cleaned the cookies for Chrome, and then re-created the database, re-copied the Drupal directory into Apache hotdocs, then it works. Since I am still a newbie, I will try understand what happened with this issue later. It really frustrated me for a few hours. Hope this can help some others.

bob_hirnlego’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 /home/bob/public_html/metauploader/includes/menu.inc on line 315.<br>
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 /home/bob/public_html/metauploader/includes/menu.inc on line 315.

I'm having the same problem here with D6.17. Installation stops at the "Install site" step, 44 db tables installed.
Ubuntu, with MYSQL 5.1.37, PHP 5.2.10 and APACHE 2.2.12.
Using a fresh installation of Chrome (cookies enabled), fresh downloaded D6.17, a fresh database, no $cookie_domain set, everything just plain default!

bob_hirnlego’s picture

Resolved (for me) but don't know why: the date of my server was in the past. Updating with ntpdate resolved.

pyliu8621’s picture

Status: Closed (duplicate) » Needs work

Recently I installed the 2nd Drupal site, I was still getting into this problem. I am using Drupal 6.19:
Windows 7, E8/Firefox and a few other browsers, MySQL:5.0.22, PHP:5.2.12, Apache:2.2.14.
I tried uncommenting the $cookie_domain and setting it to: "oa.local" which is one of my Appache virtual hosts.
And I set IE to accept cookie and recreate the database every time, but no luck, always in such issue.
Only when I use chrome 5.0.375.127, it works.
So it does is related to cookie, however there are some other factors, please help or investigate. Thanks.

damien tournoud’s picture

Category: bug » support
David_Rothstein’s picture

Priority: Critical » Normal
Status: Needs work » Closed (duplicate)

This was previously marked duplicate, but the issue it was marked duplicate of already had a patch committed to Drupal 7.

Surely this is a duplicate of something, though :) I think #791004: Installer does not warn the user that cookies must be enabled with the correct cookie domain (and fails when they aren't) is the issue which has the most useful discussion.

DaiHadi’s picture

Title: cannot install drupal - menu_router error » clear installation
Version: 6.17 » 7.0
Assigned: Unassigned » DaiHadi
Category: support » bug
Priority: Normal » Major
Status: Closed (duplicate) » Fixed

It may be because of existing files, i deleted all installed files and then installed core again, also installed sites.php and settings.php, this fresh installation has no problem and site is up now. I think it was because menu module tries to find menu implementations and before complete installation this may broke process of building menu_router database table. so it will be empty and causes errors ...

grendzy’s picture

Title: clear installation » cannot install drupal - menu_router error
Version: 7.0 » 6.17
Assigned: DaiHadi » Unassigned
Category: bug » support
Priority: Major » Normal
Status: Fixed » Closed (duplicate)

Please don't reset the status / title of old issues.