You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2025-03-05 10:26:28

WebGreg
Member
Registered: 2020-02-27
Posts: 771

[10.0.17] Massive action and trashbin - getFromDBByCrit

Hi.

I'm trying to clear the trash for unmanaged devices - when there are more than 500, I get the message "The action you have requested is not allowed". Reducing it to 250 deletes it, but it throws up errors.


Can anyone confirm the problem or suggest how to solve it?

1. Go to Assets > Unmanaged assets.
2. Move about 1000 devices to the trash (definitely more than 250).
3. Click the "show the trashbin" option.
4. Select 500 rows.
5. Actions > Delete permanently button.
6. The message appears: "The action you have requested is not allowed".
7. Select 250 rows.
8. Actions > Delete permanently button.
9. It will delete it, but with an error. Below is a small excerpt from the entire series:

PHP User Warning (512): getFromDBByCrit expects to get one result, 16 found in query "SELECT 'id' FROM 'glpi_networkports_networkports' WHERE ('glpi_networkports_networkports','networkports_id_1' = '107052' OR 'glpi_networkports_networkports'.'networkports_id_2' = '107052')". in /var/www/html/glpi/src/CommonDBTM.php at line 394.

Last edited by WebGreg (2025-03-06 13:51:11)


--
GLPI 10.0.18
GLPI-Inventory 1.5.0
Ubuntu Server 20.04 LTS

Offline

#2 2025-03-05 23:27:37

WebGreg
Member
Registered: 2020-02-27
Posts: 771

Re: [10.0.17] Massive action and trashbin - getFromDBByCrit

After updating to 10.0.18 it does not display the error from the frontend, but in the php-errors.log file:


[2025-03-05 22:31:43] glpiphplog.WARNING:   *** PHP User Warning (512): getFromDBByCrit expects to get one result, 2 found in query "SELECT `id` FROM `glpi_networkports_networkports` WHERE (`glpi_networkports_networkports`.`networkports_id_1` = '133125' OR `glpi_networkports_networkports`.`networkports_id_2` = '133>
  Backtrace :
  src/CommonDBTM.php:394                             trigger_error()
  src/NetworkPort_NetworkPort.php:62                 CommonDBTM->getFromDBByCrit()
  src/NetworkPort_NetworkPort.php:80                 NetworkPort_NetworkPort->getFromDBForNetworkPort()
  src/NetworkPort.php:569                            NetworkPort_NetworkPort->getOppositeContact()
  marketplace/glpiinventory/hook.php:888             NetworkPort->getContact()
  src/Plugin.php:1713                                plugin_item_purge_glpiinventory()
  src/CommonDBTM.php:2119                            Plugin::doHook()
  src/CommonDBConnexity.php:128                      CommonDBTM->delete()
  src/CommonDBTM.php:1004                            CommonDBConnexity->cleanDBonItemDelete()
  src/NetworkPort.php:540                            CommonDBTM->deleteChildrenAndRelationsFromDb()
  src/CommonDBTM.php:793                             NetworkPort->cleanDBonPurge()
  src/CommonDBTM.php:2112                            CommonDBTM->deleteFromDB()
  src/CommonDBConnexity.php:128                      CommonDBTM->delete()
  src/CommonDBTM.php:1004                            CommonDBConnexity->cleanDBonItemDelete()
  src/CommonDBTM.php:1141                            CommonDBTM->deleteChildrenAndRelationsFromDb()
  src/CommonDBTM.php:799                             CommonDBTM->cleanRelationTable()
  src/CommonDBTM.php:2112                            CommonDBTM->deleteFromDB()
  src/MassiveAction.php:1513                         CommonDBTM->delete()
  src/MassiveAction.php:1425                         MassiveAction::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1403                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:62                         MassiveAction->process()
  public/index.php:82                                require()


[2025-03-05 22:10:45] glpiphplog.WARNING:   *** PHP User Warning (512): getFromDBByCrit expects to get one result, 2 found in query "SELECT `id` FROM `glpi_networkports_networkports` WHERE (`glpi_networkports_networkports`.`networkports_id_1` = '119452' OR `glpi_networkports_networkports`.`networkports_id_2` = '119>
[2025-03-05 22:10:45] glpiphplog.WARNING:   *** PHP User Warning (512): getFromDBByCrit expects to get one result, 3 found in query "SELECT `id` FROM `glpi_networkports_networkports` WHERE (`glpi_networkports_networkports`.`networkports_id_1` = '119452' OR `glpi_networkports_networkports`.`networkports_id_2` = '119>
[2025-03-05 22:11:12] glpiphplog.WARNING:   *** PHP User Warning (512): getFromDBByCrit expects to get one result, 2 found in query "SELECT `id` FROM `glpi_networkports_networkports` WHERE (`glpi_networkports_networkports`.`networkports_id_1` = '121840' OR `glpi_networkports_networkports`.`networkports_id_2` = '121>

Last edited by WebGreg (2025-03-05 23:39:24)


--
GLPI 10.0.18
GLPI-Inventory 1.5.0
Ubuntu Server 20.04 LTS

Offline

#3 2025-03-06 09:36:52

lordbat
Member
From: Spain
Registered: 2016-02-12
Posts: 188

Re: [10.0.17] Massive action and trashbin - getFromDBByCrit

WebGreg wrote:

Hi.

I'm trying to clear the trash for unmanaged devices - when there are more than 500, I get the message "The action you have requested is not allowed". Reducing it to 250 deletes it, but it throws up errors.


Can anyone confirm the problem or suggest how to solve it?

1. Go to Assets > Unmanaged assets.
2. Move about 1000 devices to the trash (definitely more than 250).
3. Click the "show the trashbin" option.
4. Select 500 rows.
5. Actions > Delete permanently button.
6. The message appears: "The action you have requested is not allowed".
7. Select 250 rows.
8. Actions > Delete permanently button.
9. It will delete it, but with an error. Below is a small excerpt from the entire series:

PHP User Warning (512): getFromDBByCrit expects to get one result, 16 found in query "SELECT 'id' FROM 'glpi_networkports_networkports' WHERE ('glpi_networkports_networkports','networkports_id_1' = '107052' OR 'glpi_networkports_networkports'.'networkports_id_2' = '107052')". in /var/www/html/glpi/src/CommonDBTM.php at line 394.


You can edit the max-input-vars limit in php.ini  https://www.php.net/manual/en/info.conf … input-vars


Related issues:
https://github.com/glpi-project/glpi/issues/17730
https://github.com/glpi-project/glpi/issues/14863


Regards!!

Last edited by lordbat (2025-03-06 09:38:19)


You can mark this thread as [Solved] in the subject of your thread. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
############################################################

Offline

#4 2025-03-06 13:25:05

WebGreg
Member
Registered: 2020-02-27
Posts: 771

Re: [10.0.17] Massive action and trashbin - getFromDBByCrit

Hi @lordbat You rock! Thank you smile

I am left with only one error: PHP User Warning (512): Missing required intl PHP extension in /var/www/html/glpi/src/Session.php at line 800


Edit. It doesn't quite work.

max_input_vars = 5000

The error does not appear but I can delete a maximum of 2000 at a time.

Last edited by WebGreg (2025-03-06 13:53:57)


--
GLPI 10.0.18
GLPI-Inventory 1.5.0
Ubuntu Server 20.04 LTS

Offline

Board footer

Powered by FluxBB