RTC Release Blocker bug PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
10 Mar 2026

Pull Request resolves #47360 .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This pull request (PR) fixes the SQL error "Duplicate entry '14' for key 'acc_content_types.PRIMARY'" which happens when you update the CMS core from any version older than 6.1.0-beta1 to a 6.1.0-beta1 or 6.1.0-beta2 or a recent 6.1. nightly build and you have a 3rd party component which already use a record with type_id = 14 in the #__content_types database table.

For this purpose, this PR

  • disables the INSERT statement in the "6.1.0-2026-01-29.sql" update SQL scripts which causes the issue by specifying the type_id instead of using the auto-increment.
  • adds new update SQL scripts "6.1.0-2026-03-10.sql" to insert the new record in the right way, but only if a record with the same combination of type_title, type_alias and table doesn't exist yet.
    This allows to fix also broken updated 6.1.0-beta1 and 6.1.0-beta2 versions without creating duplicate entries.

Testing Instructions

It is not sufficient just to apply the patch with patchtester and use the database checker to fix the structure as that will not fix content.

You either have to run the SQL statement from the "6.1.0-2026-03-10.sql" script for your database type in phpMyAdmin after having applied the patch.

Or you have to use the patched update package or custom update site URL created by Drone for this PR.

The following 4 tests should be executed in the mentioned order to save you some work.

Test 1: Reproduce the issue

  1. On any version older than 6.1.0-beta1, install a 3rd party extension which adds records to the #__content_types database table, e.g. weblinks, or simulate that by adding such a record with type_id = 14 in phpMyAdmin.
  2. Update to a 6.1.0-beta1 or 6.1.0-beta2 or a recent 6.1. nightly build.

Result: See section "Actual result BEFORE applying this Pull Request" below.

Test 2: Test that this PR can fix the result of the previous test

  1. Still using the site from the previous test, logout from the administrator and close your browser window to make sure there is nothing cached in local storage.
    This is for mitigating a bug showing the error from the previous Test 1 even if with the next update here no error happens.
    I will write a new issue for that when I find the time and can reliably reproduce it.
  2. Login again to the administrator of the same site and go to the database check.
  3. Fix the issues in the database checker by using the "Update Structure" (aka "fix") button.
  4. Now update to the patched update package or custom update site URL created by Drone for this PR.

Result: See section "Expected result AFTER applying this Pull Request" below.

Test 3: Test that this PR solves the issue for updates from older versions than 6.1.0-beta1

  1. On any version older than 6.1.0-beta1, install a 3rd party extension which adds records to the #__content_types database table, e.g. weblinks, or simulate that by adding such a record with type_id = 14 in phpMyAdmin.
  2. Update to the patched update package or custom update site URL created by Drone for this PR to get the expected result.

Result: See section "Expected result AFTER applying this Pull Request" below.

Test 4: Test that this PR does not do harm when updating from 6.1.0-beta1 or 6.1.0-beta2 where the error did not happen.

Update from a 6.1.0-beta1 or 6.1.0-beta2 where the error mentioned in the issue did not happen (e.g. a new installation without any 3rd party extension) and the record in the #__content_types already exists to the patched update package or custom update site URL created by Drone for this PR to get the expected result.

Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

The database update fails with an SQL error Duplicate entry '14' for key '#__content_types.PRIMARY' in script "6.1.0-2026-01-29.sql".

The database checker then show errors as the later update SQL script have not run either:
Image

Expected result AFTER applying this Pull Request

Updating any version older than 6.1.0-beta1 works. The SQL error mentioned in the referred issue doesn't happen.

Updating a 6.1.0-beta1 or 6.1.0-beta2 where the issue has happened with the previous update adds the record in the #__content_types table if it doesn't exist yet.

Updating a 6.1.0-beta1 or 6.1.0-beta2 where the issue has not happened doesn't add the record in the #__content_types table again as that record already exists.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar richard67 richard67 - open - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Mar 2026
Category SQL Administration com_admin Postgresql
avatar richard67 richard67 - change - 10 Mar 2026
Labels Added: PR-6.1-dev
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
Title
[6.1] [WiP] Fix SQL error "Duplicate entry '14' for key 'acc_content_types.PRIMARY'" when updating to 6.1
[6.1] [WiP] Fix SQL error "Duplicate entry '14' for key '#__content_types.PRIMARY'" when updating to 6.1
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
Title
[6.1] [WiP] Fix SQL error "Duplicate entry '14' for key '#__content_types.PRIMARY'" when updating to 6.1
[6.1] Fix SQL error "Duplicate entry '14' for key '#__content_types.PRIMARY'" when updating to 6.1
avatar richard67 richard67 - edited - 10 Mar 2026
avatar richard67 richard67 - change - 10 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 10 Mar 2026
avatar dautrich dautrich - test_item - 11 Mar 2026 - Tested unsuccessfully
avatar dautrich
dautrich - comment - 11 Mar 2026

I have tested this item 🔴 unsuccessfully on ff76b0b

### Test 1 - Successful

  • Installed a fresh J6.0.3 called 'Site1'
  • Installed extension Weblinks 5.0.0
  • Checked #__content_types: Weblinks took type_ids 10000 and 10001 (not 14 as expected)
  • Changed type_id for Weblinks in #__content_types from 10000 to 14
  • Updated to J6.1.0_beta2
  • Got the error as of issue #47360
  • Database check shows 2 errors
  • Went to "Maintenance: Database" and clicked "Update Structure", which seemed to work as expected

Update log:

2026-03-11T07:21:58+00:00 INFO 127.0.0.1 update Test logging
2026-03-11T07:21:58+00:00 INFO 127.0.0.1 update Uploading update file
2026-03-11T07:22:03+00:00 INFO 127.0.0.1 update File [ROOT]\tmp\juBC45.tmp downloaded.
2026-03-11T07:22:03+00:00 INFO 127.0.0.1 update Starting installation of new version.
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update Finalising installation.
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update Start of SQL updates.
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update The current database version (schema) is 6.0.1-2025-10-29.
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2025-10-30. Query text: UPDATE #__mail_templates SET params = '{"tags":["messages","message","date",.
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2025-11-29. Query text: INSERT INTO #__extensions (name, type, element, folder, client_id, . 2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2026-01-29. Query text: INSERT INTO #__content_types (type_id, type_title, type_alias, table`, .
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update JInstaller: :Install: Error SQL Duplicate entry '14' for key 'b2k3s_content_types.PRIMARY'
2026-03-11T07:23:03+00:00 INFO 127.0.0.1 update End of SQL updates - INCOMPLETE.
2026-03-11T07:23:03+00:00 WARNING 127.0.0.1 jerror JInstaller: :Install: Error SQL Duplicate entry '14' for key 'b2k3s_content_types.PRIMARY'
2026-03-11T07:23:03+00:00 ERROR 127.0.0.1 update An error has occurred while running "installer::parseSchemaUpdates". Code: 0. Message: installer::parseSchemaUpdates finished with "false" result..
2026-03-11T07:23:04+00:00 INFO 127.0.0.1 update Cleaning up after installation.
2026-03-11T07:23:04+00:00 INFO 127.0.0.1 update Update to version 6.1.0-beta2 is complete.

Test 2 - Unsuccesful

  • Still on Site1, used button "Update structure" on "Maintenance: Database"
  • No more database errors shown
  • Downloaded PR update package (Joomla_6.1.0-beta3-dev+pr.47361-Development-Update_Package.zip)
  • Used that package to update Site1
  • Received an update error (s. PR47361_Test_2_Update_Error.jpg)
  • Went to Maintenance: Database; there was one error (s. PR47361_Test_2_Maintenance_Database.jpg)
  • Clicked "Update Structure", which seemed to work as expected
  • joomla_update.php didn't show errors
  • Checked #__content_types: New module with type_alias = com_modules.module got type_id 10002
grafik PR47361_Test_2_Update_Error.jpg grafik PR47361_Test_2_Maintenance_Database.jpg

Update log:

2026-03-11T07:40:31+00:00 INFO 127.0.0.1 update Test logging
2026-03-11T07:40:31+00:00 INFO 127.0.0.1 update Uploading update file
2026-03-11T07:40:35+00:00 INFO 127.0.0.1 update File [ROOT]\tmp\juB89B.tmp downloaded.
2026-03-11T07:40:36+00:00 INFO 127.0.0.1 update Starting installation of new version.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Finalising installation.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Start of SQL updates.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update The current database version (schema) is 6.1.0-2026-02-06.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2026-03-07. Query text: UPDATE #__extensions SET params = JSON_REPLACE(params, '$.html_height' .
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2026-03-07. Query text: UPDATE #__extensions SET params = JSON_REPLACE(params, '$.html_width' ,.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Ran query from file 6.1.0-2026-03-10. Query text: INSERT INTO #__content_types (type_title, type_alias, table, rules, `f.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update End of SQL updates.
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Uninstalling extensions
2026-03-11T07:41:35+00:00 INFO 127.0.0.1 update Deleting removed files and folders.
2026-03-11T07:41:37+00:00 INFO 127.0.0.1 update Cleaning up after installation.
2026-03-11T07:41:37+00:00 INFO 127.0.0.1 update Update to version 6.1.0-beta3-dev+pr.47361 is complete.

Test 3 - Successful

  • Installed a fresh J6.0.3 called "PR-Test"
  • Installed extension Weblinks 5.0.0
  • Checked #__content_types: Weblinks took type_ids 10000 and 10001 (not 14 as expected)
  • Changed type_id for Weblinks in #__content_types from 10000 to 14 and from 10001 to 15
  • Updated "PR-Test" with update package (Joomla_6.1.0-beta3-dev+pr.47361-Development-Update_Package.zip)
  • Update installed without issue
  • New entry in #__content_types gets type_id 10002 (+1 compared to original and unaltered Type_id)
  • No errors in joomla_update.php

Test 4 - Successful

  • Installed Joomla_6.1.0-beta2-Beta-Full_Package.zip as "PR-Test"
  • Used phpMyAdmin to verify that the new content type with type_id = 14 had been created
  • Updated "PR-Test" with update package (Joomla_6.1.0-beta3-dev+pr.47361-Development-Update_Package.zip)
  • Checked #__content_types: No addtional content type has been created

Testing Environment

  • Windows 11 with Laragon 6.0
  • PHP 8.3.6
  • MySQL 8.0.30

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47361.
avatar richard67
richard67 - comment - 11 Mar 2026

@dautrich Which problems are shown for the 2nd tests if you hover over the "One problem" button of the database check?

avatar dautrich
dautrich - comment - 11 Mar 2026

@richard67 Sorry, but I didn't backup Site1 in that state, but did an "Update Structure" (as mentioned).

avatar dautrich
dautrich - comment - 11 Mar 2026

@richard67 Should have hovered over the button, but didn't. Next time ....

avatar richard67
richard67 - comment - 11 Mar 2026

@dautrich When you use a patched package or custom update URL created by Dronew for a PR, you always get one database error about the CMS version not matching. This is normal. The log of test 2 shows that all SQL updates were executed successfully. The type_id = 10002 is also expected as that is the autoincrement value set for that column after the core records have been installed.

What remains is the parsing error of the schema updates.

Can it be that the database checker was not reloaded after the update so it still had the buffered error from the previous test 1?

I have to check that later.

avatar conseilgouz conseilgouz - test_item - 11 Mar 2026 - Tested unsuccessfully
avatar conseilgouz
conseilgouz - comment - 11 Mar 2026

I have tested this item 🔴 unsuccessfully on ff76b0b

Laragon 8.4.0, Apache 2.4.62, PHP 8.5.2, MySQL 8.4.3
Joomla 6.0.3 site

Test 1 : successfull

  • Update Joomla 6.0.3 site to Joomla 6.1.0 beta 2
    -> shows expected error : Duplicate entry '14' for key '#__content_types.PRIMARY'

Test 2 : almost successfull

  • On test 1 site, click on fix database, Joomla DB shows no more error
  • update site using drone update packing (including PR 47361):

Update error message and database shows one error, but update log file says it's OK and content_types table contains the com_modules.module record as last record of this table.

pr47361_test_2_1 pr47361_test_2_2

Test 3 : successfull
On a Joomla 6.0.3 site with Weblinks/Route66, update site using drone update packing (including PR 47361) :

  • update OK,
  • content_types table contains the com_modules.module record as last record of this table.

Test 4 : successfull
On a new Joomla 6.0.3 site (no extension), update site using drone update packing (including PR 47361)

  • update OK,
  • content_types table contains the com_modules.module record as last record of this table.

Thank you for this PR,

Pascal


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

avatar richard67
richard67 - comment - 11 Mar 2026

The error shown in the database checker about not matching CMS version after an update to a patched package created by Drone is normal.

The reason is that these patched packages do not contain the patched version number in the "libraries/src/Version.php" file, they only have their patched version in the "administrator/manifests/files/joomla.xml" file.

So that's a known issue not related to this PR, and it happens always with these patched packages for pull requests.

What remains is that the parsing of the SQL update scripts returns false.

I have to investigate that.

avatar richard67
richard67 - comment - 11 Mar 2026

Test 4 : successfull
On a new Joomla 6.0.3 site (no extension), update site using drone update packing (including PR 47361)

@conseilgouz As my testing instructions fir Test 4 say, you shall update from a 6.1.0-beta1 or 6.1.0-beta2, not from 6.0.3.

Not related to the issue with the parseSchemaUpdates result, but can you report back if you have done Test 4 with a 6.0.3 like you wrote, or if that was just a typo?

avatar conseilgouz
conseilgouz - comment - 11 Mar 2026

Sorry, I messed up for test 4 and I checked that on a new Joomla 6.0.3 site.
I'll redo this test as soon as possible.

avatar richard67
richard67 - comment - 11 Mar 2026

@dautrich @conseilgouz Regarding the installer::parseSchemaUpdates finished with "false" result error shown in Test 2, could you try the following:

  1. Start again from the beginning with Test 1.
  2. Before continuing with Test 2, log out from the administrator, close the browser windows (or clear the cache) and log in again.

Does it still happen?

To me it looks as if the error from test 1 is cached somewhere, as the logfile from @dautrich 's Test 1 shows that error, which is excepted for that test.

The log from Test 2 shows no error.

So to me it seems it is still the result from Test 1.

avatar conseilgouz
conseilgouz - comment - 11 Mar 2026

Hi,
Test 4 on a new Joomla 6.1.0 beta 1 OK :

  • record 14 has been created,
  • no error message in joomla_update.php
  • one problem in "maintenance database" due to version mistmatch.
pr47361_test_4
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47361.
avatar richard67
richard67 - comment - 11 Mar 2026

one problem in "maintenance database" due to version mistmatch.

@conseilgouz As said before, that is normal when using the patched packages created by Drone for PRs.

So to me your Test 4 seems to be successful.

Remains the issue with the error installer::parseSchemaUpdates finished with "false" result in Test 2.

Could you try if that also happens when logging out and closing browser after Test 1 and before Test 2?

That would be really helpful.

Thanks in advance, and thanks for testing so far.

avatar conseilgouz
conseilgouz - comment - 11 Mar 2026

Test 2 : OK
After Test 1, I closed my browser.
I started it again and, in my admin, I purged the cache.
On test 1 site, I clicked on fix database, Joomla DB shows no more error
After updating site using drone update packing (including PR 47361): no error

avatar conseilgouz conseilgouz - test_item - 11 Mar 2026 - Tested successfully
avatar conseilgouz
conseilgouz - comment - 11 Mar 2026

I have tested this item ✅ successfully on ff76b0b

In test 2, you need to close your browser and start it again before performing database fix and site update.


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

avatar richard67
richard67 - comment - 11 Mar 2026

I have tested this item ✅ successfully on ff76b0bIn test 2, you need to close your browser an start it again before performing database fix and site update.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47361.

@conseilgouz Thanks a lot. Seems we have a bug with cached results of SQL updates. I will create a new issue for that when I find the time, very likely on weekend.

@dautrich Could you also test it that way?

avatar dautrich
dautrich - comment - 11 Mar 2026

@richard67 Is it sufficient to repeat Test 2. And if this part is okay, to post a green test result?

avatar richard67
richard67 - comment - 11 Mar 2026

@richard67 Is it sufficient to repeat Test 2. And if this part is okay, to post a green test result?

@dautrich Repeat Test 1 to have the right starting condition for Test 2, and between these tests log out and close browser to be sure the local storage is empty.

avatar dautrich dautrich - test_item - 12 Mar 2026 - Tested successfully
avatar dautrich
dautrich - comment - 12 Mar 2026

I have tested this item ✅ successfully on ff76b0b

I repeated tests 1 and 2. As for your advice, I closed my browser after test1 and reopened before test2. Everything worked smoothly: No update errors, update log okay, #__content_types incremented correctly, just 1 database error (because of inconsistent CMS versions between installed version and Drone update package).


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

avatar richard67 richard67 - change - 12 Mar 2026
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 12 Mar 2026

RTC


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

avatar richard67 richard67 - change - 12 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 12 Mar 2026
avatar richard67 richard67 - change - 12 Mar 2026
The description was changed
avatar richard67 richard67 - edited - 12 Mar 2026
avatar HLeithner HLeithner - close - 12 Mar 2026
avatar HLeithner HLeithner - merge - 12 Mar 2026
avatar HLeithner HLeithner - change - 12 Mar 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-03-12 15:45:45
Closed_By HLeithner
Labels Added: RTC Release Blocker bug
avatar HLeithner
HLeithner - comment - 12 Mar 2026

thanks

Add a Comment

Login with GitHub to post a comment