I'm using Joomla 3.9.14 Release and am no longer able to add new articles or extensions. The original installation was 3.7.x on which I recently encountered this problem.

On the main administrator page, under Maintenance, I get:

Joomla is up to date


Unknown extensions...

When I click on the latter, I get a page saying:

An error has occurred. 1062 Duplicate entry '0' for key 'PRIMARY'

Components -> Joomla Update yields the same error.

Saving an article shows:

Error Save failed with the following error: Duplicate entry '0' for key 'PRIMARY'

When I attempt to install a plugin, e.g. 'CookieHint', either through Web or through Package upload, I get:

Duplicate entry '0' for key 'PRIMARY'
Error installing plugin

When enabling Debug mode in Global Configuration, I get following trace when clicking "Unknown extensions..." again:

An error has occurred.
1062 Duplicate entry '0' for key 'PRIMARY'
Call stack
#   Function    Location
1   ()  JROOT\libraries\joomla\database\driver\mysqli.php:665
2   JDatabaseDriverMysqli->execute()    JROOT\libraries\joomla\database\driver.php:1421
3   JDatabaseDriver->insertObject() JROOT\libraries\src\Table\Table.php:805
4   Joomla\CMS\Table\Table->store() JROOT\libraries\src\Updater\Updater.php:177
5   Joomla\CMS\Updater\Updater->findUpdates()   JROOT\administrator\components\com_installer\models\update.php:258
6   InstallerModelUpdate->findUpdates() JROOT\administrator\components\com_installer\controllers\update.php:102
7   InstallerControllerUpdate->find()   JROOT\libraries\src\MVC\Controller\BaseController.php:710
8   Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\administrator\components\com_installer\installer.php:19
9   require_once()  JROOT\libraries\src\Component\ComponentHelper.php:402
10  Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT\libraries\src\Component\ComponentHelper.php:377
11  Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:101
12  Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:159
13  Joomla\CMS\Application\AdministratorApplication->doExecute()    JROOT\libraries\src\Application\CMSApplication.php:196
14  Joomla\CMS\Application\CMSApplication->execute()    JROOT\administrator\index.php:51

What I tried:

  • System -> Clear Cache & Clear Expired Cache: OK
  • Update Joomla to the latest release: OK
  • Extensions -> Manage -> Database -> Fix: yields Database table structure is up to date.
  • Extensions -> Manage -> Update Sites -> Rebuild: yields Update sites have been rebuilt from manifest files.
  • Extensions -> Languages -> Install Languages: succesfully updated to

The Joomla site that I'm using is pretty standard (few articles only, no plugins/extensions, I manually added IIRC except for a language pack).

My PHP version is 7.3.4 (on Windows NT S057 6.3 build 9600 (Windows Server 2012 R2 Datacenter Edition) AMD64). Using protostar as template.

Any idea what I can try next and/or how to debug further?

  • What PHP version? What template do you use? If you turn development mode on in Global configuration, is there any additional error message?
    – Zollie
    Commented Jan 8, 2020 at 9:37
  • @Zollie: thanks for the pointers, added some more info.
    – SaeX
    Commented Jan 8, 2020 at 10:52
  • Some table has no autoincrement on ID (maybe caused by corrupt installation or database) What the table is you can detect after enabling system debug. Commented Jan 8, 2020 at 11:46
  • @ArturStępień: I've enabled system debug (see output in my post) but it's not pointing to a certain table. How can I pinpoint?
    – SaeX
    Commented Jan 8, 2020 at 11:50
  • @SaeX Table name is #__updates. You can try this modify query ALTER TABLE k96qw_updates MODIFY update_id int(11) NOT NULL AUTO_INCREMENT; just remember to change table prefix. If that doesn't help you can change the current autoincrement value for this table in for example phpMyAdmin (set it to highest of existing values +1). Commented Jan 8, 2020 at 15:09

1 Answer 1


In my case, I couldn't save, edit or create a new article.

The table schema for #__ucm_history (for some unknown reason) was not set to auto-increment the version_id. The version_id column values started at 0 and remained 0 with every newly attempted insert.

If this is/was your situation, you could:

  1. Back up your site
  2. Login into your hosting account
  3. Navigate to Databases
  4. Select your Joomla Database
  5. Look for that table #_ucm_history
  6. Change the version_id of the first entry to the highest id in the table
  7. Under table structure click on change for this field version_id
  8. Check the auto-increment option
  9. Reload your site and try the failed action again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.