Entity transfer MySQL query error: Duplicate entry
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- [x] I have searched the existing issues
Version
11.0.0.BETA6
Bug description
Hello,
I'm encountering an error when trying to transfer some computers from the root entity to a sub-entity.
The error occurs when I perform the transfer with all items retained so that the data goes to the sub-entity.
I'm using version 11.0.0beta6
Relevant log output
[2025-07-09 12:19:01] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry 'Computer-39818-329651' for key 'glpi_items_softwareversions.unicity' (1062) in SQL query "UPDATE `glpi_items_softwareversions` SET `softwareversions_id` = '329651' WHERE `id` = '11666053'".
Backtrace :
./src/DBmysql.php:369
./src/DBmysql.php:1430 DBmysql->doQuery()
./src/Transfer.php:1744 DBmysql->update()
./src/Transfer.php:1304 Transfer->transferItemSoftwares()
./src/Transfer.php:250 Transfer->transferItem()
./front/transfer.action.php:51 Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:59 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197 Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70 Symfony\Component\HttpKernel\Kernel->handle()
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
No response
Anything else?
No response
Please try with latest beta, or even better the latest main branch nightly build.
I updated to the version available in the nightly build ( main-2cd342b.tar.gz ). I tried again and the same error persists when trying to transfer the asset.
[2025-07-09 14:15:55] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry 'Computer-39818-329651' for key 'glpi_items_softwareversions.unicity' (1062) in SQL query "UPDATE glpi_items_softwareversions SET softwareversions_id = '329651' WHERE id = '11666053'".
Backtrace :
./src/DBmysql.php:369
./src/DBmysql.php:1430 DBmysql->doQuery()
./src/Transfer.php:1744 DBmysql->update()
./src/Transfer.php:1304 Transfer->transferItemSoftwares()
./src/Transfer.php:250 Transfer->transferItem()
./front/transfer.action.php:51 Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:59 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197 Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70 Symfony\Component\HttpKernel\Kernel->handle()
OK, indeed the error is the same. Do you know if this error already exists with GLPI v10? It may be related to some existing data; maybe this is already broken with latest stable. In that case, we need to find a way to reproduce and add a specific case in our tests suite.
OK, indeed the error is the same. Do you know if this error already exists with GLPI v10? It may be related to some existing data; maybe this is already broken with latest stable. In that case, we need to find a way to reproduce and add a specific case in our tests suite.
I have never used version 10. Since I started using GLPI I have been using the development version GLPI.11, in fact this error started when I updated to beta version 6.
OK, indeed the error is the same. Do you know if this error already exists with GLPI v10? It may be related to some existing data; maybe this is already broken with latest stable. In that case, we need to find a way to reproduce and add a specific case in our tests suite.
I have never used version 10. Since I started using GLPI I have been using the development version GLPI.11, in fact this error started when I updated to beta version 6.
GLPI: 11.0.0-dev ( => /var/www/html/glpi) Installation mode: TARBALL Current language: pt_PT
An update. When enabled, the inventory runs fine if the software option is not selected. However, if I enable the software option, the server reaches almost 100% CPU utilization, but does not generate any errors. Perhaps the error is related.
I confirm the issue. I cloned a Computer I had with a ton of software (from GLPI Agent but that doesn't seem relevant) and then tried doing a "complete" transfer from the root entity to a child entity.
This issue already exists on 10.0 versions
I have a similar issue with tickets. Transferring between entities, similar to computers, also doesn't work. @cconard96, can you test it? Thanks
I have the same error when transferring a computer from a parent entity to a child entity. As a temporary workaround, I unchecked the “Keep software” option during the transfer so that it would work.
Same error
This looks like a pretty serious error. It seems that transferring objects between entities no longer works in version 11. It used to work in version 10.
I get this error:
[2025-11-12 18:11:41] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry 'Computer-30-7156' for key 'unicity' (1062) in SQL query "UPDATE `glpi_items_softwarever
sions` SET `softwareversions_id` = '7156' WHERE `id` = '15371'".
Backtrace :
./src/DBmysql.php:371
./src/DBmysql.php:1446DBmysql->doQuery()
./src/Transfer.php:1708DBmysql->update()
./src/Transfer.php:1271Transfer->transferItemSoftwares()
./src/Transfer.php:246Transfer->transferItem()
./front/transfer.action.php:51Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70Symfony\Component\HttpKernel\Kernel->handle()
How can I fix this issue?
#22019 should solve the issue. Take care of testing out of your productions environments.
#22019 should solve the issue. Take care of testing out of your productions environments.
Well, I've closed it; I'm not sure this is a correct fix. You'd probably better not use that change at all.
In another message sent, I saw that it was said the problem was apparently resolved, but after testing in a development environment, the same type of error persists.
The version I am currently using is: GLPI 12.0.0-dev - dev-e67b300.tar.gz
[2025-11-21 10:17:31] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry 'Computer-21883-223988' for key 'glpi_items_softwareversions.unicity' (1062) in SQL query "UPDATE glpi_items_softwareversions SET softwareversions_id = '223988' WHERE id = '5681976'".
Backtrace :
./src/DBmysql.php:371
./src/DBmysql.php:1446 DBmysql->doQuery()
./src/Transfer.php:1708 DBmysql->update()
./src/Transfer.php:1271 Transfer->transferItemSoftwares()
./src/Transfer.php:246 Transfer->transferItem()
./front/transfer.action.php:51 Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197 Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70 Symfony\Component\HttpKernel\Kernel->handle()
In another message sent, I saw that it was said the problem was apparently resolved, but after testing in a development environment, the same type of error persists.
This issue is not solved.
Hi, I confirm this too in GLPI 11.0.3 : When I transfer a ticket to another entity I get :
"POST /front/transfer.action.php HTTP/1.1" 200 39087 "https://glpi.domain/front/transfer.action.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36"
==> /var/log/glpi/php-errors.log <==
[2025-11-25 15:48:17] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry '23001-Ticket-66134--1' for key 'glpi_documents_items.unicity' (1062) in SQL query "UPDATE glpi_documents_items SET documents_id = '23001' WHERE id = '64748'".
Backtrace :
./src/DBmysql.php:371
./src/DBmysql.php:1446 DBmysql->doQuery()
./src/Transfer.php:2412 DBmysql->update()
./src/Transfer.php:1196 Transfer->transferDocuments()
./src/Transfer.php:246 Transfer->transferItem()
./front/transfer.action.php:51 Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197 Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70 Symfony\Component\HttpKernel\Kernel->handle()
It worked fine in GLPI 10 (I don't remember the subversion, but it was the latest)
Hoping it helps, hhanks in advance
We are having a similar issue when trying to transfer a ticket from entity A to entity B:
==> /var/log/glpi/php-errors.log <==
[2025-11-28 14:01:36] glpi.ERROR: *** Caught RuntimeException: MySQL query error: Duplicate entry '270-Ticket-252--1' for key 'unicity' (1062) in SQL query "UPDATE glpi_documents_items SET documents_id = '270' WHERE id = '687'".
Backtrace :
./src/DBmysql.php:371
./src/DBmysql.php:1446 DBmysql->doQuery()
./src/Transfer.php:2412 DBmysql->update()
./src/Transfer.php:1196 Transfer->transferDocuments()
./src/Transfer.php:246 Transfer->transferItem()
./front/transfer.action.php:51 Transfer->moveItems()
...Glpi/Controller/LegacyFileLoadController.php:64 require()
./vendor/symfony/http-kernel/HttpKernel.php:181 Glpi\Controller\LegacyFileLoadController->__invoke()
./vendor/symfony/http-kernel/HttpKernel.php:76 Symfony\Component\HttpKernel\HttpKernel->handleRaw()
./vendor/symfony/http-kernel/Kernel.php:197 Symfony\Component\HttpKernel\HttpKernel->handle()
./public/index.php:70 Symfony\Component\HttpKernel\Kernel->handle()
^C
**edit: Removing documents from the requester's follow-up allows the transfer of the ticket to work properly.
The problem is still present in version 11.0.4. I hope it will be resolved in the next milestone. I don't know how to fix it.
Update Now to 11.0.4 and confirm still
Yes, this issue is not solved, and still opened. I will be closed once resolved.