Hello,

I just tried to upgrade the Durpal core from 6.15 to 6.16 and when running the update I received the following error message:

user warning: Table 'final.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'locale_cache_de' in D:\xampp\htdocs\includes\lock.inc on line 154.

How can I fix that?

Thanks,

Kirsten

CommentFileSizeAuthor
#14 6.10-6.16.pdf681.05 KBjozo.starosta
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yannickoo’s picture

Du musst einfach die update.php ausführen.

You have just to execute the update.php.

Transmitter’s picture

That's true, just found it after the update:

Update #6054

* CREATE TABLE {semaphore} ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Still .. a bit scary to get this error message during the update.
Ignoring it seems to be save, since the table has been created now.

Bye, Transmitter

Dave Reid’s picture

Status: Active » Fixed
klonos’s picture

Title: Updating from 6.15 user warning: Table 'semaphore' doesn't exist » Updating from 6.15
Priority: Critical » Normal

I still am getting the error after update.php has run!

Tried setting the site offline and manually running Update #6054 from system module drop-down list in update.php. Here's the errors it spat out:

    * user warning: Can't DROP 'src_language'; check that column/key exists query: ALTER TABLE url_alias DROP INDEX src_language in /var/www/mysite/includes/database.mysql-common.inc on line 448.
    * user warning: Can't DROP 'dst_language'; check that column/key exists query: ALTER TABLE url_alias DROP KEY dst_language in /var/www/mysite/includes/database.mysql-common.inc on line 417.
    * user warning: Duplicate key name 'src_language_pid' query: ALTER TABLE url_alias ADD INDEX src_language_pid (src, language, pid) in /var/www/mysite/includes/database.mysql-common.inc on line 434.
    * user warning: Duplicate key name 'dst_language_pid' query: ALTER TABLE url_alias ADD UNIQUE KEY dst_language_pid (dst, language, pid) in /var/www/mysite/includes/database.mysql-common.inc on line 403.

and the log:

The following queries were executed
system module
Update #6054

    * CREATE TABLE {semaphore} ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Update #6055

    * Failed: ALTER TABLE {url_alias} DROP INDEX src_language
    * Failed: ALTER TABLE {url_alias} DROP KEY dst_language
    * Failed: ALTER TABLE {url_alias} ADD INDEX src_language_pid (src, language, pid)
    * Failed: ALTER TABLE {url_alias} ADD UNIQUE KEY dst_language_pid (dst, language, pid)

Any ideas on could be wrong?

soul_discharge’s picture

Status: Fixed » Active

Same here I get the error when I attempt to change my display fields under cck.

sgabe’s picture

I get the error message about the missing table too, but the update in #6055 executed succesfully. After that everything seems to be fine.

jcisio’s picture

@KirstenLangholz @sgabe The first error messages are because you didn't put your site in maintenance mode when upgrading.

Errors in url_alias seem because the update.php ran twice and didn't detect it (db corruption?)

sgabe’s picture

Thanks, I was just testing on my localhost. With the proper update procedure it is all fine.

klonos’s picture

The site in my case was backed up (folders and mysql dump), set to offline mode then the upgrade. I went by-the-book, but still it happened.

bluecafe’s picture

I had the same error and found it irritating. After running update.php everthing seems to be ok though.

gpk’s picture

I've asked for a note about this to be added to the Drupal 6.16 release page.

#732546: Drupal 6.16 release page needs health warnings

The status of this issue can then be set to "by design".

[edit] The relevant info has been added to the Drupal 6.16 release page http://drupal.org/drupal-6.16. Leaving this issue open for now so people can find it...

mcarrera’s picture

Title: Updating from 6.15 » Updating from 6.15 user warning: Table 'semaphore' doesn't exist

I saw the same message. It shows only with locale.module enabled.
Gone after update.php

gpk’s picture

@12: which message? The one at #4?

jozo.starosta’s picture

FileSize
681.05 KB

I have, actually, tried to upgrade from Drupal 6.10 to Drupal 6.16
that means, the following upgrades had to applied:
6050
6051
6052
6053
6054
6055

Immediately after trying to run 6050 I got this message:

• An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
• An HTTP error 0 occurred. http://www.laurelfoundation.ca/update.php?id=3&op=do

When I click the "error page":

• user warning: Table 'laurel314.laurel_semaphore' doesn't exist query: SELECT expire, value FROM laurel_semaphore WHERE name = 'menu_rebuild' in /home/9/d/c/2753/2753/public_html/includes/lock.inc on line 154.
• user warning: Table 'laurel314.laurel_semaphore' doesn't exist query: SELECT expire, value FROM laurel_semaphore WHERE name = 'menu_rebuild' in /home/9/d/c/2753/2753/public_html/includes/lock.inc on line 154.
The update process was aborted prematurely while running update #6050 in system.module. All errors have been logged. You may need to check the watchdog database table manually.

The "transcript" of the whole sequence of steps is in the attachment.

What went wrong?
How can I upgrade from 6.10 to 6.16?

Thanks

RobLoach’s picture

Priority: Normal » Critical

Confirmed....

  • user warning: Table 'semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'menu_rebuild' in includes/lock.inc on line 154.
  • user warning: Table 'semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'menu_rebuild' in includes/lock.inc on line 154.

The update process was aborted prematurely while running update #6054 in system.module. All errors have been logged.

Not sure why it gives that error, when system_update_6054() creates the table... Maybe the menu system attempts to invoke the semaphore before the update takes place?

gpk’s picture

update.php is known to show the user warning about table semaphore, until it is created. See #251792-229: Implement a locking framework for long operations.

In #14 the problem seems to be that http://api.drupal.org/api/function/system_update_6050/6 failed, and the warning about semaphore will then be seen the next time Drupal tries to do a menu rebuild. In #15 it seems to be the creation of the semaphore table that failed...

Gábor Hojtsy’s picture

Any Drupal core update should include running update.php. For those of you who say the error was "irritating", etc. you should just follow the upgrade procedure for Drupal. Use maintenance mode to minimize the number of people who will see any errors before the database is updated and then run update.php as soon as possible. When you change the code, it expects the new database structure, but you need to ensure it actually gets that by running update.php.

Looks like the only outstanding issue is jozo.starosta's. @jozo, we'd actually be much more informed, if you could supply us with data from the end of your watchdog log. As @gpk pointed out, the actual issue might as well be right before the update run or in the update function, and not necessarily reported on the screen. Because the semaphore was not yet created, we should expect the semaphore errors. Other errors were logged though as the message indicates, so we should look at the logs.

davyvdb’s picture

You get the error when you are using locale. To run update.php safely, disable locale module first, run update.php, enable locale again and run update.php again.

Gábor Hojtsy’s picture

It is safe to run update.php without disabling locale module, these errors do not make running update.php less safe.

davyvdb’s picture

It didn't run here. I got a blank page after pressing "continue".

gpk’s picture

@20: any errors reported either in Drupal's watchdog or (more likely perhaps .. could have been a memory limit problem) in your webserver's error log?

klonos’s picture

Trying to disable the locale module (of course I went through the process of disabling all those that depend on it first) and then run update.php. Here's what I got:

    * user warning: Table 'semaphore' already exists query: CREATE TABLE semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /var/www/mysite/includes/database.inc on line 550.
    * user warning: Can't DROP 'src_language'; check that column/key exists query: ALTER TABLE url_alias DROP INDEX src_language in /var/www/mysite/includes/database.mysql-common.inc on line 448.
    * user warning: Can't DROP 'dst_language'; check that column/key exists query: ALTER TABLE url_alias DROP KEY dst_language in /var/www/mysite/includes/database.mysql-common.inc on line 417.
    * user warning: Duplicate key name 'src_language_pid' query: ALTER TABLE url_alias ADD INDEX src_language_pid (src, language, pid) in /var/www/mysite/includes/database.mysql-common.inc on line 434.
    * user warning: Duplicate key name 'dst_language_pid' query: ALTER TABLE url_alias ADD UNIQUE KEY dst_language_pid (dst, language, pid) in /var/www/mysite/includes/database.mysql-common.inc on line 403.

and the log:

The following queries were executed
system module
Update #6054

    * Failed: CREATE TABLE {semaphore} ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Update #6055

    * Failed: ALTER TABLE {url_alias} DROP INDEX src_language
    * Failed: ALTER TABLE {url_alias} DROP KEY dst_language
    * Failed: ALTER TABLE {url_alias} ADD INDEX src_language_pid (src, language, pid)
    * Failed: ALTER TABLE {url_alias} ADD UNIQUE KEY dst_language_pid (dst, language, pid)

I agree that disabling the locale module (and all other contributed modules) is an extra step that could help in general, but this time disabling it didn't solve the issue... at least not for me.

Gábor Hojtsy’s picture

Title: Updating from 6.15 » Updating from 6.15 user warning: Table 'semaphore' doesn't exist
Priority: Normal » Critical

Well, the message tells you the table already exists, so these update functions already ran. I don't know how it could happen that system version numbers were not updated (but these operations are not transactional or atomic unfortunately). @klonos: does update.php still offer these updates, or it says no updates to run anymore now?

klonos’s picture

@ Gábor: nope, updates were not offered after initial first run of update.php (with the errors shown in #4). I was though trying to run updates 6054 and 6055 manually since 6055 reported failure and I couldn't possibly know if I should ignore it or not.

I know that errors in #22 report that the db table already exists (I am not a complete newbie), but still I couldn't know if I should ignore previous failure error messages or not. It seems to be going well so far and no errors came up, but I can't tell if they eventually will.

I think I might have located the cause of this issue (for me at least)... You see, I was using the patch in post #146 from #269877: path_set_alias() doesn't account for same alias in different languages and the one from post #77 in #358315: drupal_lookup_path() not respects alias' order in my D6.15 setup before the upgrade to 6.16 [sidenote: I applied them manually].

Now, in #358315: drupal_lookup_path() not respects alias' order there was already:

+function system_update_6054() {
+  $ret = array();
+  db_drop_index($ret, 'url_alias', 'src_language');
+  db_drop_unique_key($ret, 'url_alias', 'dst_language');
+  db_add_index($ret, 'url_alias', 'src_language_pid', array('src', 'language', 'pid'));
+  db_add_unique_key($ret, 'url_alias', 'dst_language_pid', array('dst', 'language', 'pid'));
+  return $ret;
+}

... that runs system db update 6054 as you can see. I knew that I've seen that number before somewhere!

In the meantime, #358315: drupal_lookup_path() not respects alias' order was committed to 6.16 and my guess is that update.php tried to re-run 6054(?). If so, shouldn't it skip it?

Anyways... as I've already said above, I am not sure if that was the cause of it all... just guessing here. Has anyone else here with the same issue had applied any of the patches I mention as well?

OutOfCtrl’s picture

I have the same problem here, without applying any patch

I've upgraded to v6.16 and then I couldn't access the administration interface (blanc, my Apache server doesn't display PHP errors, and I haven't access to the log file) and on the frontend I've got the error about semaphore

Since the backoffice wasn't accessible so I used to run manually update.php
Now the errors doesn't appear on the front no more, but I'm still unable to access the admin interface

Through update.php I applied manually system updates 6045 then 6055, but it still doesn't work (in the meanwhile, I've got several errors about src-language...)

klonos’s picture

btw, my php memory limit couldn't possibly be an issue, since it was set to 256mb.

brisbanett’s picture

user warning: Table XXXXXXXXXX_drpl1.semaphore' doesn't exist query: SELECT expire, value FROM

semaphore WHERE name = 'menu_rebuild' in /home/tenergy0/public_html/includes/lock.inc on line 154.

tried replaceing my old includes folder and changed to this:

warning: include_once(ad.module) [function.include-once]: failed to open stream: No such file or directory in

/home/XXXXXXXXX/public_html/includes/theme.inc on line 613.
warning: include_once() [function.include]: Failed opening 'ad.module' for inclusion

(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/XXXXXXX /public_html/includes/theme.inc on line

613.

ran cron and then this:

warning: include_once(ad_html.module) [function.include-once]: failed to open stream: No such file or

directory in /home/XXXXXXXX/public_html/includes/theme.inc on line 613.
warning: include_once() [function.include]: Failed opening 'ad_html.module' for inclusion

(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/XXXXXXXXXX/public_html/includes/theme.inc on line

613.

Ran update.php

And everything worked!!!!!! I am always so scared of updating modules that I always move folder by folder to

see what exactly collapsed.

Also when updated to 6.16 i got the white screen with fatal error (didnt record sorry) but I found that the only module I couldnt update was the filter module. It crashed my site. I may try it again now that all else is working.

keiths281’s picture

I tried upgrading from 6.15 to 6.16 and had the same problem.

So what is the answer?

Before anyone ventures to respond, take into consideration:
Yes, I went by the book and followed all the usual steps for upgrading (site offline, turn off contributed modules, set to basic theme, etc. etc.)
Yes, I ran upgrade.php. ---It was after running upgrade.php that I saw the error report about semphore table missing.
Locale module was not running.
The website works apparently normally even with the faulty upgrade.
There is no semaphore table in the database now.

Any suggestions?

Raytracer’s picture

Same steps as keiths281 but my site is not working anymore.

Lost url aliases and is not displaying the nodes with the custom theme I had.
It displays the content in a weird blue background.

Edit: I am having the same problem even if I update after a fresh 6.15 install with no content and no extra themes, modules etc.

    * user warning: Table 'drupal.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'menu_rebuild' in G:\WORK\www\htdocs\drupal_single_clean\includes\lock.inc on line 154.
    * user warning: Table 'drupal.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'menu_rebuild' in G:\WORK\www\htdocs\drupal_single_clean\includes\lock.inc on line 154.

and the queries

    * ALTER TABLE {url_alias} DROP INDEX src_language
    * ALTER TABLE {url_alias} DROP KEY dst_language
    * ALTER TABLE {url_alias} ADD INDEX src_language_pid (src, language, pid)
    * ALTER TABLE {url_alias} ADD UNIQUE KEY dst_language_pid (dst, language, pid)

With a help from a friend who is much better than me in this stuff I've run this query first for the db in phpmyadmin

CREATE TABLE semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Which run ok and after that I tried the first query drupal update tried to run and phpmyadmin returned this msg:
"#1091 - Can't DROP 'src_language'; check that column/key exists"

But if I run drupal update again it finishes without errors and it seems to work ok.
Can anyone confirm that this way everything is gonna be ok?

Anonymous’s picture

I just want to chime in that maybe its a browser problem. I get these same errors and cannot proceed if i use Chrome, but the updates install just fine w/ no errors when I use Firefox.

Hope this helps.

klonos’s picture

I had those errors (they are now somehow gone!) and was using firefox though. So, I doubt it being a browser issue. At least not a Chrome specific issue, since I've had it with firefox.

sgabe’s picture

Taking back my previous comment, I got the warnings every time but the update process is successfull, and after that it seems to be fine...

frednwright’s picture

Confirmed

I have the same error.

Upgrading from Drupal 6.15 to 6.16

not using Locale Module

Followed proper procedures when running update.php

thegeekunleashed’s picture

As an experienced Drupal admin I was stumped on this. Your solution worked. Nice work!

CREATE TABLE semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

It did blow away my Forums which was set to appear on the home page but considering the alternative this was a tolerable inconvenience to repair the Forums

klonos’s picture

@thegeekunleashed: to whom are you referring when you say that their solution worked for you? Which post number?

kribby’s picture

In addition to the semaphore error, I lost all my URL aliases - even before running update.php.

AdrianB’s picture

Subscribing.

sk33lz’s picture

I was able to fix the problem I was having by using Firefox instead of Chrome to update my site. I was also stuck at #28 up to that point.

Gábor Hojtsy’s picture

Wow, a screenshot of Chrome when trying to run the updates would be valuable. Looks like it does not let you start the process for some reason when this error happens.

klonos’s picture

@Gábor: Just to make it clear this is not Chrome specific. I've had this issue with firefox too (3.6.x and 3.7.x versions on Windows).

b3liev3’s picture

Read the comment from @gpk #11

peezy’s picture

Check your admin theme settings. I got the error and realized that I accidentally had a non-core administrative theme set. Changed admin theme to Garland, ran update.php, and no more errors.

brisbanett’s picture

So the information I gave about upgrading everything except the includes filter folder doesnt help?

That is the folder that caused the probs.... for me.

bryancasler’s picture

I'm still unclear on what I need to do to resolve this issue.

Just for the record I disabled all non core modules, put the site in maintenance mode and ran update.php in Firefox 3.6

I upgraded from D6.15 to D6.16

This problem has killed my ability to administer my site. Many of the admin links just default to the page I'm already looking at, and other ones just aren't showing up anymore, especially in the admin menu bar created by the "Administration Menu" module.

I've read over the comments several times, but I am really having difficulty finding the concrete steps needed to rid this issue. Would someone please take a moment to help me out with this.

bryancasler’s picture

Thanks to HedgeMage and dekita in the #drupal-support chatroom for their 2am support call :) This is now fixed for me.

My Solution
1. Make a backup of your database incase this doesn't work for you.
2. Run update.php
3. Click "Continue"
4. Find "system module" and select "6054". *There should also be 6055, but that's not what you want*
5. Scroll to the bottom and click "Update"
6. I got a few errors but dekita said "those errors are ok, probably just that the update has already run for those, can't drop because already dropped, duplicate key because key already added, so no prob"
-Screen shot of step 6 for reference- http://i40.tinypic.com/x1yrt2.jpg

After a five minute quick check it looks as if this has solved all my problems.

REF: http://api.drupal.org/api/function/system_update_6054/6

phunster’s picture

I tried to implement this solution except neither 6054 or 6055 appear in the dropdown although they both appear in the system.install file. I am stumped!

I had applied the update to 6.16 with Upgrade.txt open and followed every step meticulously. I've cleared the Drupal cache and my browser cache (Firefox 3.5.8) all to no avail.

alexandreracine’s picture

@Gábor : Just to let you know that I had my site in maintenance mode, for the first time ever :) , and still had the error. Nevertheless, upgrading did correct the issue, and everything seems fine for now.

YK85’s picture

subscribing - experiencing the same issue

mhm’s picture

I have a variation of this issue -- I get the same error message, but I can still administer my site, but it is somehow still at version 6.15. I've tried three times now, all with the same result.

syturvy’s picture

I have the same error messages.

Table 'xxxxx.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'locale_cache_es' in /var/www/html/includes/lock.inc on line 154.

I followed Transmitter's advice and reverted to Update #6054. Now it seems to work fine.

gilcpd’s picture

I had a problem after upgrading too...

After running the update.php and the semaphore table was added then I re-enabled contrib modules, now the front page that was overwritten by Panels won't load... it doesn't even give me an error... is just a "Connection Interrupted: The connection to the server was reset while the page was loading".

If I reset the front page to "/node" then it loads, also now I get messages very often saying that a script is unresponsive (the javascripts on the optimized folder), its not on all pages but every so often it shows... at least in 4 out of 10 pages browsed.

gilcpd’s picture

Never mind I created another panel as a front page and now its ok :)

klonos’s picture

I am one of the lucky ones to have resolved this issue (by chance, because I've tried a lot of different things).

I am amazed though of the amount of people still coming in for this very same issue. The fact that there isn't some sort of distinct note next to the D6.16 download link, only makes it worse.

I know that there is some kind of mention to this issue in the 'Important update notes' section, but that is at the very bottom of the download page. Even worse... people end up here after searching for any issue related to terms like 'drupal', 'semaphore' and 'table'. Instead of having this issue linked or the above mentioned terms in bold, the only thing emphasized there is the new includes/lock.inc file. How does that help people (or warn them in the first place)?

- There should be a bold-styled note next to the D6.16 download link. I suggest 'Known critical upgrade issue' as a title.
- This issue and its title should be mentioned there as a critical known issue. Like so:

#732024: Updating from 6.1 user warning: Table 'semaphore' doesn't exist

- It should be made clear that no actual fix is found yet, but that people are working on it.
- Also make it clear that it concerns either upgrading from previous setups or restoring db backups equal-to/older-than D6.15 and not fresh D6.16 installations.

guigui_nyc’s picture

Solution #45 fixed my problem:
run update.php, select system module "6054" and it will create the missing table.

mkrkarthi’s picture

I am also having the same error in one of my sites.
I am maintaining three drupal sites, two of them does not cause any problems, but one site displays the above said error(#29) while updating.

Also, now I am not able to run cron, when I tried to run cron manually, it displays contact page information(without theme) with the following error in last line:

Call to undefined function contact_site_page() in /home/user/public_html/includes/common.inc(1695) : eval()'d code on line 17

When tried to update again as said in #45 I am getting the following error in update page

user warning: Table 'db_name.dr_semaphore' doesn't exist query: SELECT expire, value FROM dr_semaphore WHERE name = 'menu_rebuild' in /home/user/public_html/site/includes/lock.inc on line 154.
user warning: Table 'db_name.dr_semaphore' doesn't exist query: SELECT expire, value FROM dr_semaphore WHERE name = 'menu_rebuild' in /home/user/public_html/site/includes/lock.inc on line 154.
An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
An HTTP error 406 occurred. http://www.mysite.com/update.php?id=4&op=do
chawl’s picture

subs

mdlueck’s picture

I ran into this upgrading from 5.22 to 6.16.

Previously I had upgraded sites from the latest D5 -> D6 without this error.

I have never seen this on a D6 site, and i have gone through several 6.15 -> 6.16 upgrades.

The suggestion to re-run update.php did one more update, and that update went cleanly. fffeeewww....

yanyan729’s picture

I got the same problem here

I was updating from 6.15 to 6. 16 then received the same error as many of us are experiencing.

I ran update but this time selected module 6054 then it gave me the error message again.

I ran update again for the 3rd time but this time I left the the system module: to "No updates available"

No errors received thereafter.

mkrkarthi’s picture

Component: mysql database » cron system

Today, I ran the update.php again no error message is displayed.

But, still I am not able to run cron. When run the cron the following message displayed:

Call to undefined function contact_site_page() in /home/user/public_html/includes/common.inc(1695) : eval()'d code on line 17

Error log says:
Cron run exceeded the time limit and was aborted.

Any solution?

gpk’s picture

Component: cron system » mysql database

@59: your cron problem is possibly unrelated. I suspect the situation is something like this: you have a node with PHP input format that invokes contact_site_page(), but contact module is not enabled. search_cron() is perhaps trying to reindex this node. Or maybe another module loading the node. Either way, loading the node runs the PHP filter on the invalid PHP code, causing the error messages.

mkrkarthi’s picture

Yes, I am using the php script in contact page

<?php
  require_once drupal_get_path('module', 'contact') .'/contact.pages.inc';
  print drupal_get_form('contact_mail_page');
?>

I removed the code & module tried again, same error appears

I also tried many times by removing code and clearing catches, but still the same error appears

gpk’s picture

@61: since your current problem appears unrelated to original problem reported in this issue I suggest opening a new issue or forum topic to continue discussion of your problem.

mkrkarthi’s picture

Thanks gpk,

Now, I disabled the search and search404 plugins, again tried to run the cron no error displayed.

If I enabled the search module, not able to run cron..

Is there any solution to solve this?

New issue thread created here : http://drupal.org/node/751330

gpk’s picture

@63: This issue is for discussion of problems with the {semaphore} table. Please open a new issue to discuss your problem with search module and cron.

http://drupal.org/node/add/project-issue/drupal

Claari’s picture

Tagging. I have the same issue receiving the Semaphore table missing....versions 6054 and 6055 are not available via update.php

j0nathan’s picture

subscribing

clau_bolson’s picture

I had the same error about semaphore missing when trying to update from 6.14 to 6.16 using Firefox 3.5. Then i saw that everyone was reporting FF here, so I tried the update in Internet Explorer (7) and it worked! No more errors!
I manually created the table before, so I guess it was a cache issue.

Francewhoa’s picture

Same here. The following fix it for me. Go to update.php
Then run the script. Thanks Yvier6 :)

If above doesn't work clear your browser's cache.
Then clear your Drupal cache. To do so go to /admin/settings/performance
Scroll all the way down the page.
Click on Clear cached data button.
Then go to update.php.
Then go to update.php to run it again just in case.

gpascucci’s picture

I tried using the query posted in #29 and found the the index 'expire' did not exist.

I am using postgres 8.4

For some reason the INDEX expire does not exist or could not be created. Which is possibly why the table semaphore could not be created.

I'm wondering if I should create the index expire separately.

Synthmax’s picture

"CREATE TABLE" metioned in #36 Is a SQL command, you can run it from the terminal or myPhpAdmin.

Worked for me Thanks

klonos’s picture

...you probably meant #34 and not #36

:P

Jetson’s picture

can i ask a dumb question - how do you run update.php?

thanks

Jetson’s picture

can i ask a dumb question - how do you run update.php?

thanks

klonos’s picture

@Jetson: in case you haven't already figured this one out yourself... browse to http://your.site.net/update.php and follow the instructions there (replace the your.site.net with your actual site or ip used). For more info, take a look here:

http://drupal.org/upgrade/running-update-php

PS: There is no such thing as a 'dump question', but do try and remember next time that google is your friend and so is the search box at the top of this page ;)

Jetson’s picture

thanks for the reply - sometime the easiest, most general questions are hardest to find answers to using search!

thegeekunleashed’s picture

I apologize first for not making reference to the genius who provided the correct solution. I thought I did however provide the solution in my reply.

Second I apologize for not responding to your question but the alias to my Drupal forum email was broken and I didn't realize it until now so I had not received any notification of your reply to me.

I manage over 400 Drupal websites. On every upgrade I have done to 6.16 the solution is as follows without fail:

CREATE TABLE semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

I do not recall the person who provided this solution but I can almost guarantee to anyone that it will resolve your error every time.

The problem is that the table just needs to be rebuilt.

mdlueck’s picture

But there seems to be something wrong with the DB logic in 6.16 that should be fixed... and not require people to have an update fail, rerun update.php, etc... all of the time. That should be just a temp workaround.

Do you agree?

Gabriel R.’s picture

I tried applying the steps described at #45, but I am afraid there are other issues:

4. Find "system module" and select "6054". *There should also be 6055, but that's not what you want*

The list of available updates for system.module stops at 6051. I checked system.install, and the functions there go up to system_update_6055() so it looks like some sort of caching problem.

My upgrade went from 6.13 straight to 6.16. Could this be it?

d.grechishkin’s picture

Thanks. It fixed the problem.

amclin’s picture

I ran into this same problem where I was getting various error messages about the semaphore table not existing. What led me to it was that it was preventing me from configuring or removing any new CCK fields I created (pre-existing CCK fields worked fine).

I had followed the recommended update procedure (site into maintenance mode before uploading any files and running update.php) to update from 6.15 to 6.16. I don't recall which browser I used, but it was either FF 3.6 or Chrome.

I was able to fix my problem by rerunning system update 6054 from update.php.

yareckon’s picture

indeed... seems like the below commit added support for locking to the drupal core menu_rebuild function....
http://drupalcode.org/viewvc/drupal/drupal/includes/menu.inc?r1=1.255.2....

Funny thing is that that locking needs the semaphore table, which only recently was created...

AND.... upgrading drupal requires calling menu rebuild often

SO.....

If you are upgrading drupal from an earlier version... you need this table, early on in the process... which you won't get until late in the process.....

you can't update a database using code that assumes it has already been upgraded...

sounds like a parallel function needs to be implemented for legacy support that doesn't use locking

yareckon’s picture

a thought... perhaps someone can implement a file based locking as a fallback if the semaphore table is not available.. that way the upgrade code could continue to use locking, but when the code is upgraded the feature would be there even before the db upgrades run.

visualnotion’s picture

This worked to get my install fixed:

  1. I ran the SQL command that thegeekunleashed mentioned in #34.
  2. Commented out my changes to the Rewrite rules in the .htaccess file.
  3. Ran update.php

It is worth noting that I cleared the cache a couple of times, but I didn't notice a change until I changed the .htaccess file.

daltonparsons’s picture

#76 is the ticket. Thanks

Marc Bijl’s picture

Subscribing.

Had the same error message when running update.php

user warning: Table 'marcnot_database.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'locale_cache_nl' in /usr/home/marcnot/domains/newoceanstravelogue.com/public_html/includes/lock.inc on line 154.

However, after running update.php the table seems to be created and errors are gone... Does it mean everything is allright now? Scary...

gpk’s picture

Yes.

From http://drupal.org/drupal-6.16

Update.php will display warnings of the non-existent semaphore table, until after the updates are run.

[edit - corrected link above]

mdlueck’s picture

@gpk #86

Your link 404's. I suppose that quote was from some Drupal instructions page. In that case, very rude that they would leave the 6.16 code upgrade in such a situation knowingly! >:-|

gpk’s picture

Ah, the URL filter messed up over the trailing colon (since removed).

> leave the 6.16 code upgrade in such a situation knowingly
Without re-architecting the upgrade process it's probably unavoidable :P !!

Marc Bijl’s picture

@gpk #86

Thanks very much!
This makes things clear ;)

Cheers, mate!

simoncritchell’s picture

upgrading from6.15to6.16 same problem but impossible to run upd
simoncritchell - May 12, 2010 - 04:28
new

impossible to run update.php.... must i kill the site and start it all again from scratch or is there a way to run the update.php ?

the site seems all up to date and running have a few twist in i18n module regarding mutilanguage but still..

how ever it will not run the update it comes to a page a long page full of php codes..

this is the message i get ,, seems similar to what every one is experiencing:

user warning: Table 'blackbikehostel.semaphore' doesn't exist query: SELECT expire, value FROM semaphore WHERE name = 'locale_cache_it' in /home/blackbikehostel/www/includes/lock.inc on line 154.

well i'de like to run the update before deciding to start it all again from scratch..
please help me , i could even givce out admin access and quote the time spent on the site.... i should sending out newsletter but i am still trying to fix the site.. terrible situation.
cheers simon

Tran’s picture

So, what the hell is the fix here?

TuWebO’s picture

I think that different people got different solutions... But for me what happened was:

  1. I place the site in off-line mode and then I upgrade from Drupal 6.15 to 6.16 with all my custom modules enabled (I didn´t follow the upgrade instructions and I forgot to disable them):

    - CCK 6.x-2.6
    - ImageCache 6.1-1.6
    - GMap 6.x-1.x-dev
    - Location 6.x-3.1-rc1
    - Multilanguage 6.x-1.2
    - Lightbox 6.x-1.9
    - Mimedetect 6.x-1.2
    - Mollom 6.x-1.13
    - Taxonomy breadcrumb 6.x-1.0
    - Taxonomy redirect 6.x-1.3
    - Token 6.x-1.12
    - Token actions 6.x-1.12
    - Transliteration 6.x-2.1
    - Google Analytics 6.x-2.2
    - Tagadelic 6.x-1.2
    - Views 6.x-2.8

  2. I typed www.mysite.com/update.php and then I got the semaphore error, then I didn´t pressed the "continue" button because I was scared.
  3. I typed www.mysite.com/admin directly in the browser and I went to admin modules and then I disabled all custom modules (before running the update)
  4. Then I typed again www.mysite.com/update.php and I got the semaphore error again, but this time I pressed the "continue" button as the #86 link said
  5. I enabled again all the custom modules
  6. And I run the update.php again, this time I didn´t got the error
  7. I made a little test, and it looks like everything is working fine... so far
  8. 5 minutes later I am writing this coment

For me it looks like the link in the #86 comment worked!
So thank you!

momper’s picture

same problem + subscribe

momper’s picture

+ question: since march there is no "save" solution: is this problem not taken seriously by the core developers?

gpk’s picture

@94: The safe solution is the usual upgrade method, i.e. something like
- log in as user 1
- put site in maintenance mode
- take DB backupo
- update the codebase to 6.16 [this temporarily puts the site into an inconsistent state, in that the codebase expects the {semaphore} table to exists, but it will only be created when update.php is run. This is why you get the error messages]
- run update.php, ignoring the PHP error message you will see
- when update.php has run the PHP error messages go away
- put site back online

mdlueck’s picture

@gpk #86

Since there is documented in the 6.16 update, per #86, acknowledgment that the 6.16 update will do this, then I do not foresee the developers taking out this sharp spot.

linuxpimp’s picture

Title: Updating from 6.1 user warning: Table 'semaphore' doesn't exist » Updating from 6.15 user warning: Table 'semaphore' doesn't exist
Version: 6.1 » 6.16
Status: Closed (fixed) » Active

#76 worked for me too. Thank you.

wireless router comparison

yareckon’s picture

A note in the release notes for 6.16 does not help the folks upgrading from all past versions of drupal to all future versions of drupal (who will never read 6.16 release notes) to get over this speedbump in the continuous drupal upgrade path. This is like saying "before 6.16 you used to have to run update.php once to upgrade drupal, but ever since that version, you now have to run it twice and ignore the errors in between." Kind of silly.

I know the number of sites that were built before the semaphore table existed will slowly go down over time, but this issue is both a current critical problem for folks doing automation of drupal upgrades (see aegir), and an illustration of why using a control structure in the database as a dependency for upgrading the database itself is not a good idea. Database upgrades should depend on external datastructures, if any.

dargente’s picture

Title: Updating from 6.15 user warning: Table 'semaphore' doesn't exist » Updating from 6.1 user warning: Table 'semaphore' doesn't exist
Version: 6.16 » 6.1
Status: Active » Fixed

what #76 said

CREATE TABLE semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

created the table and problem is fixed
thx

jackhutton’s picture

how do i run this code:
in the php my admin? thanks.

update - I copied the code from #76 and ran that in php my admin SQL and it ran fine.
thank you..!

Status: Fixed » Closed (fixed)

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

nattyweb’s picture

Brilliant - #76 worked for me. Thank you to thegeekunleashed for nice, clear advice.

schasoli’s picture

Thanx to #76

my standard installation likes "drupal_semaphore" instead of "semaphore". It may help other beginners

CREATE TABLE drupal_semaphore ( `name` VARCHAR(255) NOT NULL DEFAULT '', `value` VARCHAR(255) NOT NULL DEFAULT '', `expire` DOUBLE NOT NULL, PRIMARY KEY (name), INDEX expire (expire) )

TanvirAhmad’s picture

Title: Updating from 6.15 user warning: Table 'semaphore' doesn't exist » Updating from 6.1 user warning: Table 'semaphore' doesn't exist
Version: 6.16 » 6.1
Status: Active » Closed (fixed)

Some times update.php works for this, some time dont. In my case it worked.

bourgeoy’s picture

flushing my cache, running update.php for #6054 and then re-running it for #6055 solved the errors for me.

digibrill’s picture

#76 fixed the error for me, but now I have a WSOD. Don't know if related. I will update if I find any answers.

digibrill’s picture

I had yet another field to add, this time to the sessions table. But now I am getting a page with my logo and this:

www2
Error
The website encountered an unexpected error. Please try again later.

I am able to access the DB with phpMyAdmin and made sure the user was granted all privileges. Any suggestions?

thanks

dkl4’s picture

Component: mysql database » ajax system
Issue summary: View changes

This error is encountered when updating Drupal 6.13 to 6.16. Running "drush updatedb" will fix it.

System 6054 Add semaphore table.