By Paul_83uk on
Hi all please help,
In my log i am getting hundreds maybe even thousands of duplicate entry errors I will paste a few of them they are all related to the theme engine. I am running a custom theme called redwood. all other default themes are not enabled.
Duplicate entry 'themes/engines/theme_editor/theme_editor_engine.engine' for key 1 query: INSERT INTO system (name, type, filename, status, throttle, bootstrap) VALUES ('theme_editor_engine', 'theme_engine', 'themes/engines/theme_editor/theme_editor_engine.engine', 1, 0, 0) in /usr/local/drupal/drupal/includes/database.mysql.inc on line 121.
Duplicate entry 'themes/bluemarine/page.tpl.php' for key 1 query: INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('bluemarine', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'themes/bluemarine/page.tpl.php', 0, 0, 0) in /usr/local/drupal/drupal/includes/database.mysql.inc on line 121.
Duplicate entry 'themes/chameleon/marvin/style.css' for key 1 query: INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('marvin', 'themes/chameleon/chameleon.theme', 'theme', 'themes/chameleon/marvin/style.css', 0, 0, 0) in /usr/local/drupal/drupal/includes/database.mysql.inc on line 121.
Duplicate entry 'themes/chameleon/marvin/style.css' for key 1 query: INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('marvin', 'themes/chameleon/chameleon.theme', 'theme', 'themes/chameleon/marvin/style.css', 0, 0, 0) in /usr/local/drupal/drupal/includes/database.mysql.inc on line 121.
Please help,
Paul
Comments
Duplicate entry themes
I was having the same problem in 6.2 and could not find a solution in the posts. Today, I went to Admin / Site building / Themes and noticed that my default theme was no longer selected as enabled. Weired or bug? Got me. So far, so good with it re-enabled.
yeah - i just updated to
yeah - i just updated to drupal 6.12 and had the errors. Went to themes page and my Zen theme was default but not enabled. So far so good now...
many duplicate entry errors
i have been having a similar list of multiple duplicate entries, nothing about them suggested the theme though. i found a differance between my global and theme specific settings and changed them to match. this seems to have solved it, however i ran cron, changed them back and ran cron in order to recreate the issue and nothing, the errors are not back so i think it is strange. my errors listed line 2353 of menu.inc and i use zen classic theme on drupal 6.2. i will write back if it happens again.
more info
here is a copy of errors, a small portion anyway. now it seems to appear on the first page after i make a change to something, taxonomy, menu, etc. and then not again until another change, this is tolerable but seems to be a bug none the less. before now it was on every page.
user warning: Duplicate entry 'comment_subscribe' for key 1 query: INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, fit, number_parts, tab_parent, tab_root, title, title_callback, title_arguments, type, block_callback, description, position, weight, file) VALUES ('comment_subscribe', '', '', 'user_access', 'a:1:{i:0;i:1;}', 'comment_subscribe_page', 'a:0:{}', 1, 1, '', 'comment_subscribe', 'Comment Subscribe', 't', '', 4, '', '', '', 0, '') in /home/content/d/e/s/designanddraft/html/govbyus/includes/menu.inc on line 2353.
user warning: Duplicate entry 'wiki' for key 1 query: INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, fit, number_parts, tab_parent, tab_root, title, title_callback, title_arguments, type, block_callback, description, position, weight, file) VALUES ('wiki', '', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'wikitools_handle_request', 'a:0:{}', 1, 1, '', 'wiki', '', 't', '', 4, '', '', '', 0, '') in /home/content/d/e/s/designanddraft/html/govbyus/includes/menu.inc on line 2353.
user warning: Duplicate entry 'node' for key 1 query: INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, fit, number_parts, tab_parent, tab_root, title, title_callback, title_arguments, type, block_callback, description, position, weight, file) VALUES ('node', '', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'node_page_default', 'a:0:{}', 1, 1, '', 'node', 'Content', 't', '', 4, '', '', '', 0, '') in /home/content/d/e/s/designanddraft/html/govbyus/includes/menu.inc on line 2353.
user warning: Duplicate entry 'image_attach' for key 1 query: INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, fit, number_parts, tab_parent, tab_root, title, title_callback, title_arguments, type, block_callback, description, position, weight, file) VALUES ('image_attach', '', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'image_attach_view_image', 'a:0:{}', 1, 1, '', 'image_attach', 'Image Attachment View', 't', '', 4, '', '', '', 0, '') in /home/content/d/e/s/designanddraft/html/govbyus/includes/menu.inc on line 2353.
I have seen this too
Hi Paul,
We are plagued by this as well. I think the root cause is heavy traffic and database table locking. What happens:
Request #1 spawn this theme assessment build-- loads the directory tree into the application's memory (the bigger the tree, the longer the load).
Request #2 does the same unaware that the re-build in underway
Request #1 adds a record (INSERT)
Request #2 tries the same because it has the directory and that list is LARGE (we have34+ themes and dozens of files so directory traversal is a minefield).
Request #2 spawns an exception that causes a bump in the road.
(Requests #3-#50 are in the same boat as #2).
My workaround is a modification to system.module (ca. line 983):
This does rely on MySQL 5 and the existence of the ON DUPLICATE KEY functionality. So, it will blow database engine neutrality but at least the site will stay up.
All the best,
Mike
I have the same problem
I get this problem on two different installs of drupal 6.
Antnio
My fix
// db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d) ON DUPLICATE KEY UPDATE filename='%s'", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0, $theme->filename);
In file system.module
Should this be put in?
Should this fix be put into the core Drupal 6.10? It is dependent on Mysql 5 is the only issue.
function: function system_theme_data()
The command: db_query("DELETE FROM {system} WHERE type = 'theme'") does not appear to work. Since the insert happens and the info is still in there. One solution may be to put these into an atomic operation (transaction) which is only in InnoDB...
The problem seems to happen with long running cron.php and users are updating stuff on the site.
The bigger question: Why are we deleting and inserting so often to begin with?
Bill
db_lock() ?
Maybe there should be a db_lock between the 2 statements?
this worked for me Drupal 6.16
So far, the PHP log is showing no more duplicates. but where is this coming from? I had skinr module installed at one point but uninstalled it. This is an updated site from 5.22. In my Drupal 6.16 in system.module it is line 822.
Same problem
Intermittently get warnings of the following form.
When they happen, I get many at one time, all of this same form-- one warning per theme.
Same problem with Drupal 6.10
I'm was getting the Duplicate entry... for key 1 error on every page of my site for each theme. As suggested a couple times in this thread, I ran cron.php again and the problem seems to have gone away.
Got the same issue in Drupal
Got the same issue in Drupal 6.12. Usually get 5-10 of these theme errors at a time. Most of them appear to come at/around midnight.
Cron
Does it happen when cron.php runs?
Manually running
Manually running example.com/cron.php fixed it for me. Had the issue on several installs - all of them went away.
I think here are two
I think here are two different errors mixed. The original (from Paul_83uk - August 21, 2007 - 05:31) says "... keeps crashing the server ...".
The error occurs in /usr/local/drupal/drupal/includes/database.mysql.inc on line 121.
The later error messages/warnings are related to includes/menu.inc and to modules/system/system.module.
Thats why I think you should google a bit more for your error and post to the other issues around here.
For the system.module issue (on line 821.) you may post to this issue: #477550: "User warning: Duplicate entry ... " ... Themes
Other posts:
http://drupal.org/node/367966
http://drupal.org/node/251693
Problem appears to occur when a theme requires updating
Just had this problem.
1) Using Drupal 6.12 with theme Acquia Marina.
2) Had a status of required updating.
3) Acquia Marina and all core themes came up with the duplicate error message
4) Dowloaded the latest version of Acquia Marina and installed
5) All error messages have gone away and web site running wonderfully
Appears to be a MySQL error with the warning that a latest version needs to be downloaded.
cron.php fixed it for me.
cron.php fixed it for me.
Keeps happening all the time
It is happening several times a day now and for a lot of users. This is becoming critical.
Ditto
Same here -- I've got a site that's in offline mode (still under development) and it still happens frequently for me.
Related posts
Same issue in drupal 6.15
Subscribing
I maybe should mark this as duplicate :
See #147000: Rewrite module_rebuild_cache() and system_theme_data() and #307756: Backport of #147000: Unify and rewrite module_rebuild_cache() and system_theme_data()
But this is still not fixed in drupal 6 as far as I understand this.
I had the same problem, none
I had the same problem, none of the above methods work so i did the following in the system.module on line 822, i'm not sure how it will affect the site but it got rid of the problem, mine was caused by flushing cache--> using some sort of ajax query (in my case uc_out_of_stock module) and then redirecting to any page on my site showed the error, can anyone tell me how the following change will affect the site?
Changed:
db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
}
To
db_query("REPLACE INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
}
same error in my site also
i am using drupal 6.22.can anyone help us to remove this error?
I'm using 6.22 and I'm seeing
I'm using 6.22 and I'm seeing the same error.
run update
Hi
Try to run update.php, but first you need to set $update_free_access to TRUE in your settings.php file.
Strony www Bydgoszcz