Hi. On almost every page hit or drush command, I see this error:
INSERT INTO "SEMAPHORE" (name, value, expire) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2) e: SQLSTATE[HY000]: General error: 1 OCIStmtExecute: ORA-00001: unique constraint (VIC.PK_SEMAPHORE) violated
followed by
PHP Fatal error: Ignoring exception from DatabaseTransaction::__destruct() while an exception is already active (Uncaught PDOException in /var/www/vic2/includes/database/oracle/database.inc on line 183) in /var/www/vic2/includes/lock.inc on line 153
This error stops execution. Sometimes this will end up with me in a bad state. For example, I tried to add a field to a content type. It had created the field_data_field_* table. It had inserted into the field_config table, but it had not inserted into field_config_instance.
If I delete everything from the semaphore table, Drupal will work as expected for a little while, but break again soon, with no apparent pattern, and start reporting this error on every page until I again delete from the semaphore table.
In every instance I've found, the semaphore's name was :cache.
Comments
Comment #1
mobragauk commentedSame here. Does anybody have any suggestion? Thanks.
"I cleared the SEMAPHORE table, which had one entry in it, from cron. Once cleared it, the table repopulated with a similar cron entry, but the error above has ceased. This may not be a permanent fix, we'll need to keep an eye on it. (from Rob Green)"
Comment #2
robgreen commentedAlso experiencing the same problem, as mentioned in the comment above clearing the SEMAPHORE table temporarily resolved the issue but it returns fairly quickly.
Comment #3
galaxor commentedIt turns out the problem I had was simply due to the fact that I had updated drupal core and had not run update.php. *doh*. The update I was missing was the one that created the semaphore table.
Comment #4
robgreen commentedWe've updated to 7.10 and successfully run update.php on our side and yet we are still receiving the error on every page request, did you make any additional changes whilst / after upgrading?
Comment #5
aaaristo commentedComment #6
aaaristo commentedComment #7
Renee S commentedI'm getting this as well. Mine reads:
oracle[3639]: error query: INSERT INTO "SEMAPHORE" (name, value, expire) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2) e: SQLSTATE[HY000]: General error: 1 OCIStmtExecute: ORA-00001: unique constraint (HPO.PK_SEMAPHORE) violated
(/var/tmp/PDO_OCI-1.0/oci_statement.c:142) args: Array
(
)
Comment #8
brianV commentedReinette:
We need more info.
What were you doing when the bug occured? Can you reproduce it reliably?
Comment #9
hbblogger commentedI have been trying to transfer a Drupal 7.14 site from WAMP to my server (which is and Apache server) for 3 days now!
I get:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'n1accomm_inno.dr_semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home2/n1accomm/public_html/innomarknew/includes/lock.inc).- seems similar to the problem above.
I know that I can clear the error by running the install.php but that seems to defeat the object because it resets information from the imported database (this process effectively resets the modules to the basic set). If I re-install the missing modules, I can see the conten in the database but there is nothing on the web site.
This is a crucial part of the web development process but I d not seem to be able to get it right.
It may help if someone can tell me what the semaphore table actually does in the scheme of things!
Can anyone help?
Comment #10
brianV commentedhoutbayblogger:
Are you using Oracle? If not, you are in the wrong issue queue.
Essentially, the semaphore table is used to protect processes that can only be executing by a single php thread at a time. For instance, cron, or a menu rebuild.
When one of these processes start, they check for an entry in the semaphore table, and set one if it does't exist. If it does, they don't start. When they are finished, they clear the entry from the semaphore table.
Comment #11
hbblogger commentedHi Brian,
Thanks for your quick response.
I'm sorry for going in to the wrong queue, but I am fairly desperate at this stage and the error looked suspiciously similar implying that your original issue may not be unique to Oracle.
As it happens, my semaphore table does exist and has no entries.
I will try to find a solution elsewhere.
Cheers
Paul
Comment #12
Renee S commentedAs near as I can tell, it happens intermittently, and only then when I run cron or visit admin pages (but not always). Had a problem with this error showing up and at the same time, the block configuration was wiped out. Correlation, but not clear what happened. I'm setting up a test site now to see if I can reproduce it more reliably.
Comment #13
Renee S commentedConfirmed, it happens whenever I hit
/admin
/admin/config
/admin/config/system
/admin/config/development
... none of the other top-level admin pages (content, appearance, etc)
Comment #14
Renee S commentedComment #15
gumpdotfr commentedSame here. I have nothing to do with Oracle and came here looking for answers for the same Error.
So I'll follow Paul #11 Posted by houtbayblogger on June 3, 2012 at 4:50am
wherever he goes to find the answer...
And you could do the same.
Cheers.
Comment #16
bohartD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
Everyone can apply the patches/suggestions above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!