I've been getting "Warning: Duplicate entry" errors quite often. They're not always the same, so not sure I should post one here (and they're as long as 13 pages when pasted into a text doc, yikes), but they seem to be a database-related issue. Is there a module you would recommend for diagnosing database errors like this and fixing them? Or any other thoughts?

Comments

mm167’s picture

are u using only the core modules, or any non-core modules, or any 3rd party modules?

cog.rusty’s picture

It would definitely help to post a dozen of those error messages, the first ones, and also to describe one specific case where this happens, what is the URL, what you are doing etc. That could help locate the problem.

fumbling’s picture

Thanks. Here are a few lines. Note that I've seen this error again with entirely different content though, so really not sure. I haven't touched Core, although I certainly have a lot of contributed modules in sites/all/modules, one of which I'm guessing is the problem. Thanks again for helping me out here:

•	user warning: Duplicate entry 'admin/advanced_help' 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 ('admin/advanced_help', '', '', 'user_access', 'a:1:{i:0;s:24:\"view advanced help index\";}', 'advanced_help_index_page', 'a:0:{}', 3, 2, '', 'admin/advanced_help', 'Advanced help', 't', '', 6, '', '', '', 9, '') in /var/www/html/includes/menu.inc on line 2385.

•	user warning: Duplicate entry 'autotag/autocomplete' 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 ('autotag/autocomplete', '', '', 'user_access', 'a:1:{i:0;s:19:\"create node content\";}', 'autotag_autocomplete', 'a:0:{}', 3, 2, '', 'autotag/autocomplete', 'Autocomplete autotag thingumy', 't', '', 4, '', '', '', 0, '') in /var/www/html/includes/menu.inc on line 2385.
dman’s picture

Yeah, well reading the error is the first step in diagnosis - so knowing what table was being accessed at the time and the query involved would be sorta invaluable.
Just one or two lines would be enough...

In general - with the paucity of information available - "duplicate entry" is usually a symptom of the 'sequences' table getting out of sync - which is usually caused by partial migrations or unsyncronized restores from backups.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

cog.rusty’s picture

Or, in the case of Drupal 6 it may be a wrong autoincrement value in some tables.

brisath’s picture

I seem to be getting the same duplicate entry errors, lots of them.

zaphod4269’s picture

I just updated a bunch of modules and ran update.php. I get 42 pages of "user warning: duplicate entry...."

here's the first few... The site seems to work OK despite all the warnings. Should I just ignore them?

• user warning: Duplicate entry 'admin/store/help' 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 ('admin/store/help', '', '', 'user_access', 'a:1:{i:0;s:16:\"administer store\";}', 'uc_store_ubercart_help', 'a:0:{}', 7, 3, '', 'admin/store/help', 'Help', 't', '', 6, '', 'Links to get help!', '', 10, 'modules/ubercart/uc_store/uc_store.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/settings/imageapi' 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 ('admin/settings/imageapi', '', '', 'user_access', 'a:1:{i:0;s:19:\"administer imageapi\";}', 'drupal_get_form', 'a:1:{i:0;s:17:\"imageapi_settings\";}', 7, 3, '', 'admin/settings/imageapi', 'ImageAPI', 't', '', 6, '', 'Configure ImageAPI.', '', 0, '') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/build/imagecache' 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 ('admin/build/imagecache', '', '', 'user_access', 'a:1:{i:0;s:21:\"administer imagecache\";}', 'imagecache_ui_preset_overview', 'a:0:{}', 7, 3, '', 'admin/build/imagecache', 'ImageCache', 't', '', 6, '', 'Administer imagecache presets and actions.', '', 0, 'modules/imagecache/imagecache_ui.pages.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/settings/logging' 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 ('admin/settings/logging', '', '', 'user_access', 'a:1:{i:0;s:29:\"administer site configuration\";}', 'system_logging_overview', 'a:0:{}', 7, 3, '', 'admin/settings/logging', 'Logging and alerts', 't', '', 6, '', 'Settings for logging and alerts modules. Various modules can route Drupal\'s system events to different destination, such as syslog, database, email, ...etc.', '', 0, 'modules/system/system.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'cart/checkout/complete' 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 ('cart/checkout/complete', '', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'uc_cart_checkout_complete', 'a:0:{}', 7, 3, '', 'cart/checkout/complete', 'Order complete', 't', '', 4, '', 'Display information upon completion of an order.', '', 0, 'modules/ubercart/uc_cart/uc_cart.pages.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/store/products' 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 ('admin/store/products', '', '', 'user_access', 'a:1:{i:0;s:19:\"administer products\";}', 'uc_product_administration', 'a:0:{}', 7, 3, '', 'admin/store/products', 'Products', 't', '', 6, '', 'Administer products, classes, and more.', '', -2, 'modules/ubercart/uc_product/uc_product.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/reports/dblog' 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 ('admin/reports/dblog', '', '', 'user_access', 'a:1:{i:0;s:19:\"access site reports\";}', 'dblog_overview', 'a:0:{}', 7, 3, '', 'admin/reports/dblog', 'Recent log entries', 't', '', 6, '', 'View events that have recently been logged.', '', -1, 'modules/dblog/dblog.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/store/reports' 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 ('admin/store/reports', '', '', 'user_access', 'a:1:{i:0;s:18:\"view store reports\";}', 'uc_store_reports', 'a:0:{}', 7, 3, '', 'admin/store/reports', 'Reports', 't', '', 6, '', 'Browse various store reports.', '', 2, 'modules/ubercart/uc_store/uc_store.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'cart/checkout/review' 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 ('cart/checkout/review', '', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'uc_cart_checkout_review', 'a:0:{}', 7, 3, '', 'cart/checkout/review', 'Review order', 't', '', 4, '', 'Review an order before final submission.', '', 0, 'modules/ubercart/uc_cart/uc_cart.pages.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/reports/status' 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 ('admin/reports/status', '', '', 'user_access', 'a:1:{i:0;s:29:\"administer site configuration\";}', 'system_status', 'a:0:{}', 7, 3, '', 'admin/reports/status', 'Status report', 't', '', 6, '', 'Get a status report about your site\'s operation and any detected problems.', '', 10, 'modules/system/system.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'taxonomy/term/%' 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 ('taxonomy/term/%', 'a:1:{i:2;N;}', '', 'user_access', 'a:1:{i:0;s:14:\"access content\";}', 'taxonomy_term_page', 'a:1:{i:0;i:2;}', 6, 3, '', 'taxonomy/term/%', 'Taxonomy term', 't', '', 4, '', '', '', 0, 'modules/taxonomy/taxonomy.pages.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'devel/theme/registry'0:
• 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 ('devel/theme/registry', '', '', 'user_access', 'a:1:{i:0;s:24:\"access devel information\";}', 'devel_theme_registry', 'a:0:{}', 7, 3, '', 'devel/theme/registry', 'Theme registry', 't', '', 6, '', 'View a list of available theme functions across the whole site.', '', 0, '') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/build/path' 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 ('admin/build/path', '', '', 'user_access', 'a:1:{i:0;s:22:\"administer url aliases\";}', 'path_admin_overview', 'a:0:{}', 7, 3, '', 'admin/build/path', 'URL aliases', 't', '', 6, '', 'Change your site\'s URL paths by aliasing them.', '', 0, 'modules/path/path.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/help/block' 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 ('admin/help/block', '', '', 'user_access', 'a:1:{i:0;s:27:\"access administration pages\";}', 'help_page', 'a:1:{i:0;i:2;}', 7, 3, '', 'admin/help/block', 'block', 't', '', 4, '', '', '', 0, 'modules/help/help.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/help/brilliant_gallery' 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 ('admin/help/brilliant_gallery', '', '', 'user_access', 'a:1:{i:0;s:27:\"access administration pages\";}', 'help_page', 'a:1:{i:0;i:2;}', 7, 3, '', 'admin/help/brilliant_gallery', 'brilliant_gallery', 't', '', 4, '', '', '', 0, 'modules/help/help.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/help/color' 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 ('admin/help/color', '', '', 'user_access', 'a:1:{i:0;s:27:\"access administration pages\";}', 'help_page', 'a:1:{i:0;i:2;}', 7, 3, '', 'admin/help/color', 'color', 't', '', 4, '', '', '', 0, 'modules/help/help.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/help/contact' 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 ('admin/help/contact', '', '', 'user_access', 'a:1:{i:0;s:27:\"access administration pages\";}', 'help_page', 'a:1:{i:0;i:2;}', 7, 3, '', 'admin/help/contact', 'contact', 't', '', 4, '', '', '', 0, 'modules/help/help.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.

andrenoronha’s picture

I uploaded and set up the Invite module today and got this warning messenger...

is there something i could do manually in myphp admin..? or any other idea?

Witch’s picture

subscribe

zapscribbles’s picture

I get them all the time, but mainly when saving a content type, creating a new content type, or saving changes to the modules page. Usually it times ("Maximum execution time reached") and the next page I go to displays the huge lsit of these errors.

Ideas?

cog.rusty’s picture

The obvious thing to try is to increase PHP's max_execution_time value. (See http://php.net/manual/en/info.configuration.php#ini.max-execution-time.)

You can do that
- either globally in php.ini (max_execution_time = 60), if you have access to that file,
- or for your site's directory in the .htaccess file (php_value max_execution_time 60),
- or specifically for Drupal in the sites/default/settings.php file (ini_set('max_execution_time', 60);).

zapscribbles’s picture

Thanks cog.rusty,

I had increased it to 120 and have now increased it to 240. I havent been doing much admin work on it over xmas so will look out for this happening next time and see if it actually reaches 240 seconds. If so there must be something else going on, as I would suspect 4 minutes is ages for any page load, right?

jsheppard’s picture

I am performing a complete new site rebuild from scratch and am getting these errors when enabling modules for the first time in site/build/modules.

I've checked my PHP settings as you've noted here and they already are:

max_execution_time = 9000 ; Maximum execution time of each script, in seconds
max_input_time = 9000 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (32MB)

I would think this would be enough to prevent an issue like this (though I could be wrong).

Any other recommendations?

Thank you in advance,

John Sheppard

TimG1’s picture

I'm getting this error now and again too. I'm developing on a new environment that has MySQL 5.1.31 and strict mode on. This is causing some other errors too. I've ran across this article...

http://www.palantir.net/blog/beware-mysql-51-my-son

I don't know if this has anything to do with these particular errors at all. I just know I haven't seen these errors until developing in this new environment. Someone with some more expertise please feel free to pipe in here.

I'm trying to see if the admins will switch to MySQL 5.0 to see if that will do the trick. I'll report back if it works...

-Tim

aamin’s picture

I am also getting the same errors (Lots and Lots of them). Any suggestions?

Witch’s picture

Update to the latest offical Drupal release!
This issue is already fixed!

Sevigny’s picture

user warning: Duplicate entry 'admin/store/help' 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 ('admin/store/help', '', '', 'user_access', 'a:1:{i:0;s:16:\"administer store\";}', 'uc_store_ubercart_help', 'a:0:{}', 7, 3, '', 'admin/store/help', 'Help', 't', '', 6, '', 'Links to get help!', '', 10, 'modules/ubercart/uc_store/uc_store.admin.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/settings/imageapi' 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 ('admin/settings/imageapi', '', '', 'user_access', 'a:1:{i:0;s:19:\"administer imageapi\";}', 'drupal_get_form', 'a:1:{i:0;s:17:\"imageapi_settings\";}', 7, 3, '', 'admin/settings/imageapi', 'ImageAPI', 't', '', 6, '', 'Configure ImageAPI.', '', 0, '') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/build/imagecache' 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 ('admin/build/imagecache', '', '', 'user_access', 'a:1:{i:0;s:21:\"administer imagecache\";}', 'imagecache_ui_preset_overview', 'a:0:{}', 7, 3, '', 'admin/build/imagecache', 'ImageCache', 't', '', 6, '', 'Administer imagecache presets and actions.', '', 0, 'modules/imagecache/imagecache_ui.pages.inc') in /home/content/g/l/a/glassshack/html/includes/menu.inc on line 2423.
• user warning: Duplicate entry 'admin/settings/logging' 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 ('admin/settings/logging', '', '',

Yeah this work

rickh’s picture

Has there been any progress on this issue?

I am still getting a lot of these error messages. I then run cron and they disappear for a while, but then come back in a couple of hours.

Any help will be great. The site is also running very slow

Rick