Hi there,

I'm a complete newbie to version 7, but I've been using version 6 on a dozen or so sites for years. I've never seen anything like this, and no searches of this site, or the internet in general, has produced any helpful information. I'm hoping someone here has seen this.

Last night, I tried to install 7.8 clean on an empty directory and a new database (LAMP stack). All went well, until the 'database configuration' step, which failed with the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'capital_usadance.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/usad/capitalusadance.com/includes/lock.inc).

I've wiped bothe the db and the directory three times, starting from scratch, and it fails precisely the same way every time. Given that at least one of those attempts was at 3 AM in both my time and my host's time I'm pretty sure it's not a transient thing happening because of DB congestion or server load, but other than that, I have no idea what's going on.

Does this sound familiar to anyone else? Any thoughts would be greatly appreciated!

Comments

jaesperanza’s picture

Experiencing the same error. I'm replicating a Drupal 7.8 website to my local xampp. I've downloaded the folders and files by ftp and used Backup and Migrate for the database. Everytime I load the website, local machine's Apache seems to crash and the error. Since this seems to be a local machine issue at least from my end, I doubt this is due to server overload or congestion.

I'm trying to figure this out and will post if with any success...

andrea.cavattoni’s picture

Same here!

gridmark’s picture

Exact same message during the initial (clean) install of 7.8 on a Dreamhost shared server. Using "Standard" install profile with English language.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/user/drupal7.8/includes/lock.inc).

Additional error:

Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.semaphore' doesn't exist: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 14882723824e890a30105358.88342761 ) in lock_release_all() (line 269 of /home/user/drupal7.8/includes/lock.inc).

This occurs right after the database credentials are entered into install.php and the button is mashed, takes 2-3 minutes to process then comes back with the above error. Note: Tables are created inconsistently. Sometimes there's 14. Sometimes there's 12 created. Could this be some kind of goofy session timeout? It sure seems to take a long while to create some tables and throw a little bit of data in them from a .sql file.

Host details:

$ uname -a
Linux hostname 2.6.32.8-grsec-2.1.14-modsign-xeon-64 #2 SMP Sat Mar 13 00:42:43 PST 2010 x86_64 GNU/Linux
$ php --version
PHP 5.2.17 (cli) (built: Jun 28 2011 17:39:50)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

Dreamhost says it's running PHP 5.2.x FastCGI with "Extra Web Security (mod_security)" and "Page Speed Optimization" options enabled.

matthewv789’s picture

Clean install of Drupal 7.8 on a virtual machine with Centos 5.6 64-bit, with php 5.3.3 and MySQL 5.0.77 - same error as above reports.

Here is an additional PHP error that shows up with error reporting enabled and in the httpd error log:

Fatal error: require() [<a href='function.require'>function.require</a>]: Cannot redeclare class queryconditioninterface in /var/www/[drupal directory]/includes/database/database.inc on line 1741

Anyone have any ideas yet?

David_Rothstein’s picture

If you're seeing this error during install, the first time you try to visit the site (and if you've manually entered your database info in settings.php), then this is just due to a longstanding issue, #728702: Visiting index.php should redirect to install.php if settings.php already has database credentials but database is empty.. To work around it, simply visit install.php directly rather than relying on Drupal to redirect you there.

If you're seeing this later in the process (e.g. after filling out the database settings form and submitting it, as some people reported above), it sounds like some kind of server performance problem. The request may be timing out before the necessary database tables have been created. I think there was a previous issue about this too, so it could be reopened if a lot of people are actually experiencing this again on reasonable server setups.

matthewv789’s picture

Thanks. I tried that, and one of the errors goes away. But now I get this:

Fatal error: require() [<a href='function.require'>function.require</a>]: Cannot redeclare class databasetasks_mysql in /var/www/[drupaldir]/includes/database/database.inc on line 1741

When I re-copied my settings.php from default.settings.php, it let me go through the installation process until after choosing the installation profile and language (that is, at /install.php?profile=standard&locale=en), then gave the above error.

matthewv789’s picture

OK, for completeness sake, my additional problems were caused by having:
apc.include_once_override = 1

instead of:
apc.include_once_override = 0

in my php.ini.

Now working fine.

Dynomite00001’s picture

I'm trying to do a clean install on a host account with the following:
apache 2.2.23
php 5.4.11
mysql 5.5.28-cll
cpanel 11.34.1 (build 7)

I get the error after I click on save and continue on the database configuration step. I tried using 127.0.0.1 as the host as one other post tried but no luck.

Dynomite00001’s picture

This ended up being a performance issue with my host. Sounds like the installation script was not allowing enough time for the installation.

viadimezzo’s picture

I gave the same advice on another post.

Try to run install.php again.

If you have access to php.ini of the server you can change max_execution_time to max_execution_time = 120

christopher james francis rodgers’s picture

Re:
Drupal 7 - Download existing online-webhost site
originally created/maintained by webhost's
free Control-Panel 'automated script service', SimpleScripts;

& Now I am trying to run it locally on my computer
using 'Acquia Dev Desktop'.

My [Solution]: [1 Solution] Error: PDOException: SQLSTATE[42S02]: ... semaphore


All the best; intended.
-Chris (great-grandpa.com)
___
"The number one stated objective for Drupal is improving usability." ~Dries Buytaert *

ajaybhaskar’s picture

i have resolved this issue using these command through putty for mysql.

grant all privileges on 'db_name'.* to 'db_user_name'@'host_ip(website accessible ip)' identified by "db_pwd";

after running this command use a command for flush previleges.

FLUSH PRIVILEGES;

then restart mysql services using command.

and run your website i think it running perfectly.