Support

Admin Tools

#40446 23000, 1062, Duplicate entry '1-1-com-admintools-' for key 'idx_client_id_parent_id_alias_language'

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.3.2
PHP version
8.2
Admin Tools version
7.4.8

Latest post by herby1961 on Tuesday, 19 March 2024 09:00 CDT

herby1961

Hello,

after installing the latest version of akeeba admintools i get the messages in the following screenshot.

23000, 1062, Duplicate entry '1-1-com-admintools-' for key 'idx_client_id_parent_id_alias_language'

Error building Administrator Menus.

Installation of the package was successful.

It looks like the installation is ok, but the menu cannot build because of a duplicate entry. I looked in the _menu table but find only entrys for the akeeba_backup. no entries for admintools. can you provide me with information which table can have this duplicate entry?

regards

Herbert

nicholas
Akeeba Staff
Manager

This index is part of the #__menu table. This table is updated by Joomla®'s core code when an extension is installed or updated. Please keep in mind that during the installation and the update of an extension it is always core Joomla! code managed by the Joomla! project which executes. Us third party extension developers have no say or control over that code, and no option to use something different (the latter on pain of being expelled from the Joomla! Extensions Directory™).

We can try to help Joomla! get its act together.

There is an item on this table with the following attributes:

  • menutype: main
  • link: index.php?option=com_admintools
  • type: component
  • client_id: 1

Find it, and delete it.

Then go to System, Manage, Extensions and search for Admin Tools. There will be an extension with its Type set to Package. Select it and click on Uninstall.

If and only if there was no package extension, check if there is an extension with the Type set to Component and its name set to "Admin Tools for Joomla!". Select it and click on Uninstall.

Now retry installing Admin Tools. I believe it should install without further issues.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

herby1961

Hello Nicholas,

there is no entry in the __menu table for Admin Tools. After uninstall and reinstall the package i get the same error. But now with the initial configuration of the admin tools i have the URL for the Dashboard of Admin Tools. I saved this and have now a workaround to access the GUI. Admin Tools looks like run ok. I will check now with Joomla Support why i dont get the dashboard link not in the components menu and why the systems says duplicate entry as there is no entry in the menu table.

regards

Herbert

nicholas
Akeeba Staff
Manager

I do not think that the Joomla support channels will help you any since it's mostly end users, not developers, answering posts in there. It's not even the brightest people. I have seen all sorts of idiotic responses, always blaming third party extension developers for things that are blatantly obvious core Joomla! or hosting issues. 

The message you get from MySQL is very specific. There is a problem with the index idx_client_id_parent_id_alias_language. The values in the index are client_id 1, parent_id 1, alias com_admintools, and language is empty. How do I know? The values of the index are separated by dashes in the error message. Do you have another existing record like that? If you do, delete it.

The other problem might be the name of the index which does not have the table naming prefix of your site's tables. If you have two or more sets of core Joomla! tables in your database, e.g. a second site, tables from an old installation, even bak_ prefixed tables you are likely to have a problem with those old tables and their index (since the name is not unique across Joomla! installations). Does it sound like it's the case?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

herby1961

Hello Nicholas,

Thanks for your answer. With this hints i found that i had an other instance of tables. I checked the xx__menu table of this instance and also found no entry that points to admintools. Then i deleted all the tables with this prefix that is not more in use. Then tried to reinstall admin tools and get the same errors. It looks like that in the table there are no entries for admintool but for some reason the index is broken and in the index there are entries for admin tools. So i think solution is to rebuild the index before reinstall the admintools. 

I found in the mariadb documentation that it can be done with alter Table.

To delete index:

alter Table xx__menu drop index idx_client_id_parent_id_alias_language 

To rebuild Index:

alter Table xx__menu add index idx_client_id_parent_id_alias_language unique client_id, parent_id, alias, language

As i am not really familiar with databases and sql can you double check before i do this?

regards

Herbert 

nicholas
Akeeba Staff
Manager

The correct SQL would be as follows:

ALTER TABLE `#__menu` DROP KEY `idx_client_id_parent_id_alias_language`;
ALTER TABLE `#__menu` ADD UNIQUE KEY `idx_client_id_parent_id_alias_language` (`client_id`,`parent_id`,`alias`(100),`language`);

Replace #__ with the prefix of your tables, including the underscore.

The UNIQUE keyword is important. This is not just a regular index, it's a unique key, meaning that no two rows can have an identical key. This is what was causing us problems to begin with.

If all else fails, let me know. I can make the ticket private, ask you for connection details, and check this myself.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

herby1961

Hello Nicholas,

Thank you for your help. Building the index new solved the problem. 

regards

Herbert

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!