No Code Attached Yet bug
avatar conseilgouz
conseilgouz
10 Mar 2026

What happened?

At the end of 6.1.0 beta 2 update, an error message is displayed anf joomla_update.php file contains
Install: erreur SQL Duplicate entry '14' for key 'acc_content_types.PRIMARY'

Version

6.1

Expected result

Joomla 6.1.0 beta 2 update OK

Actual result

Joomla 6.1.0 beta 2 update error

System Information

PHP 8.5.2
Laragon

Additional Comments

In administrator/components/com_admin/sql/updates/mysql/6.1.0-2026-01-29.sql, a new record in _content_types table is added with id 14.
If you have installed WebLinks or some other components (Route66 for example), they have added records in this table, so id 14 is not available anymore.

avatar conseilgouz conseilgouz - open - 10 Mar 2026
avatar joomla-cms-bot joomla-cms-bot - change - 10 Mar 2026
Labels Added: No Code Attached Yet bug
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Mar 2026
avatar conseilgouz conseilgouz - change - 10 Mar 2026
The description was changed
avatar conseilgouz conseilgouz - edited - 10 Mar 2026
avatar conseilgouz conseilgouz - change - 10 Mar 2026
Title
[6.1.0 beta 1] Install: erreur SQL Duplicate entry '14' for key '_content_types.PRIMARY'
[6.1.0 beta 2] Install: erreur SQL Duplicate entry '14' for key '_content_types.PRIMARY'
avatar conseilgouz conseilgouz - edited - 10 Mar 2026
avatar conseilgouz conseilgouz - change - 10 Mar 2026
The description was changed
avatar conseilgouz conseilgouz - edited - 10 Mar 2026
avatar conseilgouz conseilgouz - change - 10 Mar 2026
The description was changed
avatar conseilgouz conseilgouz - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
Title
[6.1.0 beta 2] Install: erreur SQL Duplicate entry '14' for key '_content_types.PRIMARY'
[6.1] Install: erreur SQL Duplicate entry '14' for key '_content_types.PRIMARY'
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
Labels Added: Release Blocker
avatar richard67 richard67 - labeled - 10 Mar 2026
avatar brianteeman
brianteeman - comment - 10 Mar 2026

Good spot. Thank you

avatar Harsh63870
Harsh63870 - comment - 10 Mar 2026

I can pick this up if nobody is working on it yet.
From the description it looks like the problem comes from administrator/components/com_admin/sql/updates/mysql/6.1.0-2026-01-29.sql inserting into _content_types with a hard-coded id = 14, which can already be used by WebLinks or 3rd-party extensions.

My plan would be to change the update script so it doesn’t rely on a fixed id for the new core content type (let the table’s auto-increment handle the primary key, while keeping the type_alias/type_title etc. unique), and make sure the corresponding insert for other database types (e.g. PostgreSQL) is adjusted the same way. I’ll also test the update both on a clean 6.1 install and on one with extra content types present (e.g. WebLinks) to confirm there’s no duplicate key error.

Please let me know if someone is already preparing a fix or if there is a preferred convention for core content type IDs that I should follow.

avatar ChristineWk
ChristineWk - comment - 10 Mar 2026

This was also reported in the Joomla! forum.de.
Perhaps the screenshot will help and can be opened.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47360.
avatar ChristineWk
ChristineWk - comment - 10 Mar 2026

At the moment problem with the image. sorry.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47360.

avatar ChristineWk
ChristineWk - comment - 10 Mar 2026
Image
avatar richard67
richard67 - comment - 10 Mar 2026

I can pick this up if nobody is working on it yet. From the description it looks like the problem comes from administrator/components/com_admin/sql/updates/mysql/6.1.0-2026-01-29.sql inserting into _content_types with a hard-coded id = 14, which can already be used by WebLinks or 3rd-party extensions.

My plan would be to change the update script so it doesn’t rely on a fixed id for the new core content type (let the table’s auto-increment handle the primary key, while keeping the type_alias/type_title etc. unique), and make sure the corresponding insert for other database types (e.g. PostgreSQL) is adjusted the same way. I’ll also test the update both on a clean 6.1 install and on one with extra content types present (e.g. WebLinks) to confirm there’s no duplicate key error.

Please let me know if someone is already preparing a fix or if there is a preferred convention for core content type IDs that I should follow.

@Harsh63870 In general you are right, but it would not be sufficient to change the existing "6.1.0-2026-01-29.sql" scripts (for mysql and also for postgresql), as that would not fix any 6.1.0-beta2 or earlier 6.1.0-beta or -alpha version. It would need to comment out the statement in the existing script and provide a new one with the right schema version in its name which inserts the record without the hard-coded id, but only if the record does not exist yet.

As our database updates can be a tricky thing, I would prefer to do that.

avatar richard67
richard67 - comment - 10 Mar 2026

@ChristineWk The database issue shown in your screenshot of the database check is expected as the update failed with the previous script, so this one did not run.

avatar krishnagandhicode
krishnagandhicode - comment - 10 Mar 2026

I have been testing this on a local laragn env j6.1-dev.

I can confirm that manually inserting a record at ID 14 - simulating a 3rd-party extension causes the update script to fatally crash with SQL Error (1062): Duplicate entry '14' for key 'PRIMARY'.

Image

also I tried removing the hardcoded type_id and the 14 value from the INSERT statement allows the database to correctly auto-increment to the next available ID (in my case, it jumped to 10,000 and so on - maybe due to a previous failed insert attempt) but it worked.

Image

I agree with @richard67 that a defensive script is the way to handle this for existing 6.1 installs.

avatar Harsh63870
Harsh63870 - comment - 10 Mar 2026

Thanks for the explanation, @richard67.
That makes sense regarding the existing 6.1.0 beta/alpha installs and the need for a new schema version plus conditional insert. I’ll leave this one to you and will look for other issues without a PR yet where I can help.

avatar richard67
richard67 - comment - 10 Mar 2026

PR is in preparation. Will be ready soon.

avatar richard67
richard67 - comment - 10 Mar 2026

PR is ready. See #47361 . Please test all 4 test cases, not only if the issue is fixed.

avatar alikon alikon - change - 13 Mar 2026
Status New Closed
Closed_Date 0000-00-00 00:00:00 2026-03-13 07:35:57
Closed_By alikon
avatar alikon alikon - close - 13 Mar 2026
avatar alikon
alikon - comment - 13 Mar 2026

#47361 merged so i close the issue here

avatar richard67 richard67 - change - 13 Mar 2026
Labels Removed: Release Blocker
avatar richard67 richard67 - unlabeled - 13 Mar 2026

Add a Comment

Login with GitHub to post a comment