I have been trying for days to get drupal installed on a Gentoo system arrggh. I seem to have two basic errors. Here's one from my apache error log:

PHP Fatal error: Call to undefined function field_attach_load() in /var/www/www.donbishop.cc/htdocs/includes/entity.inc on line 320, referer: http://www.donbishop.cc/install.php?profile=standard&locale=en

The other one is this:

Error message
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 0, 1; Array ( ) in menu_get_item() (line 443 of /var/www/www.donbishop.cc/htdocs/includes/menu.inc).

I have been through the oher bug reports, but I can't seem to move past this point. I have dropped the database and reinstalled drupala number of times.

Here's the setup:
davies htdocs # emerge -pv apache drupal php mysql

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] www-servers/apache-2.2.16 USE="ssl -debug -doc -ldap (-selinux) -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB
[ebuild R ] dev-db/mysql-5.1.51 USE="community perl ssl -big-tables -cluster (-debug) -embedded -extraengine -latin1 -max-idx-128 -minimal -pbxt -profiling (-selinux) -static -test -xtradb" 0 kB
[ebuild R ] dev-lang/php-5.3.5 USE="apache2 berkdb bzip2 cli crypt ctype curl fileinfo filter ftp gd gdbm hash iconv imap ipv6 json mhash mysql mysqli nls odbc pdo phar posix readline session simplexml sqlite sqlite3 ssl tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter xsl zip zlib -adabas -bcmath -birdstep -calendar -cdb -cgi -cjk -curlwrappers -db2 -dbmaker -debug -doc -embed -empress -empress-bcs -enchant -esoob -exif -firebird -flatfile -fpm -frontbase -gd-external -gmp -inifile -interbase -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysqlnd -oci8 -oci8-instant-client -pcntl -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets -solid -spell -suhosin -sybase-ct -sysvipc -threads -tidy -wddx -xpm" 0 kB
[ebuild R ] www-apps/drupal-7.0 USE="vhosts" 0 kB

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB

Please note that the php pcre use flag is enabled by default.

CommentFileSizeAuthor
#3 debug01.txt399.18 KBcapt.frito

Comments

capt.frito’s picture

Category: support » bug
berdir’s picture

Why is it that weird stuff like this so often happens with Gentoo... ? ;)

I think the second error is a follow-up issue not the source of this problem.

About the other one, can you add "debug_print_backtrace(); exit;" above line 320 in entity.inc to see where this is coming from?

capt.frito’s picture

StatusFileSize
new399.18 KB

Okay, to reproduce the error, I had to uninstall everything (again). I get through the database configure page ("set up database" step) that asks me for the database prefix name (which I set as "drupal_"), and when I click "save and continue" I got this error:

Error message
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 0, 1; Array ( ) in menu_get_item() (line 443 of /var/www/www.donbishop.cc/htdocs/includes/menu.inc).

(I double-checked the MySQL database and it had 32 tables created, all with the "drupal_" prefix, so that seemed to go okay...)

Then I clicked on "Skip to main Content" at the top of the error page, and I just got the same error again. So I clicked on the browser back button and returned to the database configuration page/database set up step (as you would expect). I clicked "save and continue again, but this time progressed to the "Configure Site" page pointing to the "> configure site" step. I entered the site name ("Clearinghouse"), an email address (dbishop@donbishop.cc), the site maintenance user name is the same as the mysql username to create the database, and the password I used is the same too. The server country is USA and the timezone is NY. then I clicked "save and continue" again. (the two check boxes were left default/checked).

Then I got the output in the attached debug01.txt file.

Sorry about the Gentoo thing, it became part of me a long, long time ago. I am considering switching to Funtoo if that makes it any better :-)

berdir’s picture

32 tables is certainly not enough, we do have a few more.

Re-starting after a failing install is also nothing that is expected to work.

Really no need to try anything after the initial PDOException, everything after that is a follow-up error.

Not sure what is causing it, is it possible that you have cookies disabled?

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

capt.frito’s picture

Cookies disabled in the browser used for configuring? I have two cookies set from the site: one is named 'has_js' and one named 'SSESS1660827e4542886536c7bd5e2d7e892e'.

Are there any special permissions that need to be on the files and or directories on the server side for cookies or for the site files? Is there a problem with any of the configuration data I've entered? Is it expected to use the same user/pxwd for the admin and for the myql user that is set up when the database is created, or should they be different?

I have mediawiki installed on this machine (and several others) -- a very complex LAMP content management system of sorts in its own right -- and I have never had any real problems, even through version upgrades from 1.05 through 1.16.2 (nor have I ever had to create the databases by hand or had configs get wiped out).

I'm hoping that this is just something simple like permissions or something like that... Any other suggestions?

capt.frito’s picture

Okay, I'm getting the feeling that this has to do with the fact that the server is sitting in a DMZ. As I mentioned I have mediawiki (which relies on cookies) running on the same box without issues, and I have tried to configure the Drupal site (after removing the failed install again) using a browser on the same subnet (machine also in the DMZ network) but that didn't work. So next I will try to configure it from a browser running on the same machine. Does this sound sensible?

(I am thinking that the cookies are not surviving the NATing and I'll need to learn/use some apache reverse proxy kung fu. If I was familiar with it I'd just do it, but this seems ripe for problems if the server isn't bullet proof, and this is just a test server so I'd like to be sure before I do a lot of apache push-ups.)

berdir’s picture

Might be, is worth a try.

capt.frito’s picture

Okay, well, I tried to configure drupal completely from within the server, and the same basic error. Always creates the same 32 database tables (in alphabetical order) ending with users, user_roles, and variables. This machine is in a DMZ but the address is *not* NAT'd from within the DMZ (bind runs internally and answers name queries accordingly). MySQL and Apache are on the same machine (as is now X and Firefox from which I've tried to configure drupal).

Any other ideas? Any way I can check the cookie theory out o know for sure where it's breaking, if indeed it's a cookie issue?

capt.frito’s picture

Status: Active » Fixed

Okay, problem resolved (finally). Here's what happened: Apache wasn't set up for SSL for this particular vhost so 'session.cookie_secure' in php.ini needed to be commented out and apache had to be restarted. There were tow php.ini's with this set, '/etc/php/apache2-php5.3/php.ini' and '/etc/php/cli-php5.3/php.ini' (Gentoo)

I hope someone will benefit from this :-)

berdir’s picture

Interesting. Can you please also post that information to the issue I mentioned in #4. Maybe we at least document that somewhere or maybe there is even a way to programmatically check it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

driki_’s picture

Status: Closed (fixed) » Active

Got the same problem here, with drupal-7.8.

After install : got 32 tables in the database and the error.
I applied the patch @catch that fitted the information given by debug_print_backtrace.
At any try I did'nt saw the "blue bar page" with the ongoing install.

Then
Got only 31 tables in database, and get redirected to a page not found on without seeing any confirmation message of the install.
Same here, no "blue bar page"

server is running php 5.2.6.dfsg.1-1+lenny9

I'll try to investigate a little further and give info here.

Edit : cookies are enabled

driki_’s picture

Status: Active » Closed (fixed)

I finally figured that this was a varnish enabled server and after setting a 'pass' on the url for the install everything went well, so I am closing that issue again.
I guess this was a cookie issue as mentionned in #4

chrisnovak’s picture

I was helping someone setup Drupal 7.1.2, and started getting this error. I realized he had PHP 5.2.1.7 installed. After installing 5.3, everything worked great. Just wanted to add this comment in case someone else runs into this issue.

royce.williams’s picture

I have researched this and related issues - it is often referred to as "The 31 Tables Problem", because it interrupts the table creation process before all 73 or so tables are loaded. See this comment for a semi-exhaustive list of things that have helped people work through this issue. If your fix does not appear in my list, contact me and I will add it to the comment.