glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.1k stars 1.27k forks source link

[GLPI 10] Error update Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/glpi/test/src/DBmysqlIterator.php at line 588 #15767

Open zekuraz opened 11 months ago

zekuraz commented 11 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.7

Bug description

Hello ! When i try update glpi 10.0.7 to 10.0.10, i have this error

Capture d’écran du 2023-10-12 15-02-44

I have the same error when i try update glpi 10.0.7 to 10.0.8

Relevant log output

[2023-10-12 14:45:06] glpiphplog.CRITICAL:   *** Uncaught Exception RuntimeException: Empty IN are not allowed in /var/www/glpi/test/src/DBmysqlIterator.php at line 588
  Backtrace :
  src/DBmysqlIterator.php:559                        DBmysqlIterator->analyseCriterion()
  src/DBmysqlIterator.php:550                        DBmysqlIterator->analyseCrit()
  src/DBmysqlIterator.php:543                        DBmysqlIterator->analyseCrit()
  src/DBmysqlIterator.php:314                        DBmysqlIterator->analyseCrit()
  src/DBmysqlIterator.php:111                        DBmysqlIterator->buildQuery()
  src/DBmysql.php:1078                               DBmysqlIterator->execute()
  src/DBmysql.php:660                                DBmysql->request()
  ...agnostic/DatabaseSchemaIntegrityChecker.php:311 DBmysql->listTables()
  src/Update.php:179                                 Glpi\System\Diagnostic\DatabaseSchemaIntegrityChecker->checkCompleteSchema()
  src/Update.php:357                                 Update->checkSchemaIntegrity()
  install/update.php:143                             Update->doUpdates()
  install/update.php:252                             doUpdateDb()

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

GLPI 10.0.7 Installation mode: TARBALL Current language:fr_FR

Operating system: Linux test 5.10.0-25-amd64 #1 SMP Debian 5.10.191-1 (2023-08-16) x86_64 PHP 7.4.33 fpm-fcgi (Core, FFI, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apc, apcu, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, http, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcre, pdo_mysql, posix, propro, raphf, readline, session, shmop, soap, sockets, sodium, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib) Setup: max_execution_time="30" memory_limit="512M" post_max_size="64M" safe_mode="" session.save_handler="files" upload_max_filesize="64M" Software: Apache/2.4.56 (Debian) (Apache/2.4.56 (Debian) Server at support.test.net Port 80 ) Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0 Server Software: Debian 11 Server Version: 10.5.19-MariaDB-0+deb11u2-log Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: root@localhost/glpi Host info: Localhost via UNIX socket

PHP version (7.4.33) is supported.PHP version (7.4.33) is supported. Sessions configuration is OK.Sessions configuration is OK. Allocated memory is sufficient.Allocated memory is sufficient. mysqli extension is installed.mysqli extension is installed. Following extensions are installed: dom, fileinfo, json, simplexml.Following extensions are installed: dom, fileinfo, json, simplexml. curl extension is installed.curl extension is installed. gd extension is installed.gd extension is installed. intl extension is installed.intl extension is installed. libxml extension is installed.libxml extension is installed. zlib extension is installed.zlib extension is installed. The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present. Database engine version (10.5.19) is supported.Database engine version (10.5.19) is supported. No files from previous GLPI version detected.No files from previous GLPI version detected. The log file has been created successfully.The log file has been created successfully. Write access to /var/www/glpi/test/files/_cache has been validated. Write access to /var/www/glpi/test/config has been validated. Write access to /var/www/glpi/test/files/_cron has been validated. Write access to /var/www/glpi/test/files has been validated. Write access to /var/www/glpi/test/files/_dumps has been validated. Write access to /var/www/glpi/test/files/_graphs has been validated. Write access to /var/www/glpi/test/files/_lock has been validated. Write access to /var/www/glpi/test/files/_pictures has been validated. Write access to /var/www/glpi/test/files/_plugins has been validated. Write access to /var/www/glpi/test/files/_rss has been validated. Write access to /var/www/glpi/test/files/_sessions has been validated. Write access to /var/www/glpi/test/files/_tmp has been validated. Write access to /var/www/glpi/test/files/_uploads has been validated.Write access to /var/www/glpi/test/files/_cache has been validated. Write access to /var/www/glpi/test/config has been validated. Write access to /var/www/glpi/test/files/_cron has been validated. Write access to /var/www/glpi/test/files has been validated. Write access to /var/www/glpi/test/files/_dumps has been validated. Write access to /var/www/glpi/test/files/_graphs has been validated. Write access to /var/www/glpi/test/files/_lock has been validated. Write access to /var/www/glpi/test/files/_pictures has been validated. Write access to /var/www/glpi/test/files/_plugins has been validated. Write access to /var/www/glpi/test/files/_rss has been validated. Write access to /var/www/glpi/test/files/_sessions has been validated. Write access to /var/www/glpi/test/files/_tmp has been validated. Write access to /var/www/glpi/test/files/_uploads has been validated. For security reasons, SELinux mode should be Enforcing.For security reasons, SELinux mode should be Enforcing. PHP 7.4 official support has ended. An upgrade to a more recent PHP version is recommended.PHP 7.4 official support has ended. An upgrade to a more recent PHP version is recommended. Web server root directory configuration is not safe as it permits access to non-public files. See installation documentation for more details.Web server root directory configuration is not safe as it permits access to non-public files. See installation documentation for more details. The following directories should be placed outside "/var/www/glpi/test": ‣ "/var/glpi/test/glpi/test" ("GLPI_VAR_DIR") ‣ "/var/www/glpi/test/config" ("GLPI_CONFIG_DIR") You can ignore this suggestion if your web server root directory is "/var/www/glpi/test/public".The following directories should be placed outside "/var/www/glpi/test": ‣ "/var/www/glpi/test/files" ("GLPI_VAR_DIR") ‣ "/var/www/glpi/test/config" ("GLPI_CONFIG_DIR") You can ignore this suggestion if your web server root directory is "/var/glpi/test/DSIO/public". PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values. OS and PHP are relying on 64 bits integers.OS and PHP are relying on 64 bits integers. exif extension is installed.exif extension is installed. ldap extension is installed.ldap extension is installed. openssl extension is installed.openssl extension is installed. Following extensions are installed: bz2, Phar, zip.Following extensions are installed: bz2, Phar, zip. Zend OPcache extension is installed.Zend OPcache extension is installed. Following extensions are installed: ctype, iconv, mbstring, sodium.Following extensions are installed: ctype, iconv, mbstring, sodium. Write access to /var/www/glpi/test/marketplace has been validated.Write access to /var/www/glpi/test/marketplace has been validated. Timezones seems loaded in database.Timezones seems loaded in database.

Anything else?

No response

cedric-anne commented 10 months ago

Hi,

Unless the install/mysql/glpi-empy.sql file is corrupted, this error is not supposed to happen. It can also be an issue with aregex evaluation in PHP. Do you have something else in the error log ?

~However, #15791 should fix this.~ However, #15791 should hide this error, but not fix the main issue.

trasher commented 10 months ago

Extra note: PHP 7.4 support has been entirely dropped from a while; you really should consider upgrading.

zekuraz commented 10 months ago

@cedric-anne Hi, here are all the logs I have :

migration_to_10.0.8.log

0 seconde for "Traitement en cours..." @ 2023-10-12 14:34:44 [@test]
4 secondes for "Add new configurations / user preferences" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_computervirtualmachines" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_networkequipments" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Migration de données - glpi_displaypreferences" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_changes" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_users" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_networkportfiberchannels" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_problems" @ 2023-10-12 14:34:44 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_computervirtualmachines" @ 2023-10-12 14:34:45 [@test]
1 seconde for "Changement de la structure de la base de données - glpi_networkequipments" @ 2023-10-12 14:34:45 [@test]
0 seconde for "Valeur de configuration ajoutée pour use_flat_dropdowntree_on_search_result (core)." @ 2023-10-12 14:34:45 [@test]
0 seconde for "Traitement terminé." @ 2023-10-12 14:45:00 [@test]
0 seconde for "Traitement en cours..." @ 2023-10-12 14:45:03 [@test]
3 secondes for "Add new configurations / user preferences" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_computervirtualmachines" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_networkequipments" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Migration de données - glpi_displaypreferences" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_changes" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_users" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_networkportfiberchannels" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_problems" @ 2023-10-12 14:45:03 [@test]
0 seconde for "Changement de la structure de la base de données - glpi_computervirtualmachines" @ 2023-10-12 14:45:05 [@test]
2 secondes for "Changement de la structure de la base de données - glpi_networkequipments" @ 2023-10-12 14:45:05 [@test]
0 seconde for "Valeur de configuration ajoutée pour use_flat_dropdowntree_on_search_result (core)." @ 2023-10-12 14:45:05 [@test]
0 seconde for "Traitement terminé." @

php-errors.log

[2023-10-12 13:33:05] glpiphplog.WARNING:   *** PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpis/test/src/DbUtils.php at line 2099
  Backtrace :
  src/DbUtils.php:2099                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/CommonDBConnexity.php:127                      CommonDBTM->delete()
  src/CommonDBTM.php:986                             CommonDBConnexity->cleanDBonItemDelete()
  src/NetworkPort.php:540                            CommonDBTM->deleteChildrenAndRelationsFromDb()
  src/CommonDBTM.php:783                             NetworkPort->cleanDBonPurge()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  ...ce/ocsinventoryng/inc/networkport.class.php:502 CommonDBTM->delete()
  ...etplace/ocsinventoryng/inc/device.class.php:545 PluginOcsinventoryngNetworkPort::importNetwork()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1330 PluginOcsinventoryngDevice::updateDevices()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()

[2023-10-12 13:33:05] glpiphplog.WARNING:   *** PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpis/test/src/DbUtils.php at line 2099
  Backtrace :
  src/DbUtils.php:2099                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/CommonDBConnexity.php:127                      CommonDBTM->delete()
  src/CommonDBTM.php:986                             CommonDBConnexity->cleanDBonItemDelete()
  src/NetworkPort.php:540                            CommonDBTM->deleteChildrenAndRelationsFromDb()
  src/CommonDBTM.php:783                             NetworkPort->cleanDBonPurge()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  ...ce/ocsinventoryng/inc/networkport.class.php:502 CommonDBTM->delete()
  ...etplace/ocsinventoryng/inc/device.class.php:545 PluginOcsinventoryngNetworkPort::importNetwork()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1330 PluginOcsinventoryngDevice::updateDevices()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()

[2023-10-12 13:33:05] glpiphplog.WARNING:   *** PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpis/test/src/DbUtils.php at line 2099
  Backtrace :
  src/DbUtils.php:2099                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  ...ce/ocsinventoryng/inc/networkport.class.php:502 CommonDBTM->delete()
  ...etplace/ocsinventoryng/inc/device.class.php:545 PluginOcsinventoryngNetworkPort::importNetwork()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1330 PluginOcsinventoryngDevice::updateDevices()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()

sql-errors.log

  [2023-10-06 07:29:50] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '43908', '2023-10-06 07:29:50')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test"} 
[2023-10-06 07:29:50] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '81970', '2023-10-06 07:29:50')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test","mem_usage":"0.002\", 4.72Mio)"} 
[2023-10-06 07:41:28] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:je suis sous les flous 
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1964', 'Computer', '35', '112', '5', '1', 'VPY37-JBJJX-T2KB3-Y2WTW-VX9KP', '00371-OEM-9045926-96408', '1', '0', '0', '0', '2023-10-06 07:41:27', '2023-10-06 07:41:27')
  Error: Duplicate entry '1964-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"277@test"} 
[2023-10-06 07:56:00] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1990', 'Computer', '35', '112', '5', '1', '74T2M-DKDBC-788W3-H689G-6P6GT', '00371-OEM-8992671-00008', '1', '0', '0', '0', '2023-10-06 07:55:59', '2023-10-06 07:55:59')
  Error: Duplicate entry '1990-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"318@test"} 
[2023-10-09 09:26:04] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1964', 'Computer', '35', '112', '5', '1', 'VPY37-JBJJX-T2KB3-Y2WTW-VX9KP', '00371-OEM-9045926-96408', '1', '0', '0', '0', '2023-10-09 09:26:04', '2023-10-09 09:26:04')
  Error: Duplicate entry '1964-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"8@test"} 
[2023-10-09 10:20:09] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1990', 'Computer', '35', '112', '5', '1', '74T2M-DKDBC-788W3-H689G-6P6GT', '00371-OEM-8992671-00008', '1', '0', '0', '0', '2023-10-09 10:20:09', '2023-10-09 10:20:09')
  Error: Duplicate entry '1990-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"8@test"} 
[2023-10-09 15:43:53] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '43908', '2023-10-09 15:43:53')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test"} 
[2023-10-09 15:43:53] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '81970', '2023-10-09 15:43:53')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test","mem_usage":"0.002\", 5.18Mio)"} 
[2023-10-10 07:22:21] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '43908', '2023-10-10 07:22:21')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test"} 
[2023-10-10 07:22:21] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '81970', '2023-10-10 07:22:21')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"277@test","mem_usage":"0.005\", 4.75Mio)"} 
[2023-10-10 08:30:38] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: SELECT `glpi_peripherals`.*, '' AS `transname`, '' AS `transcomment` FROM `glpi_peripherals` WHERE `glpi_peripherals`.`id` = 'J'avais changé les batteries fin 2017.
Voir ticket - ID 25684

Bonne journée,
Christian.'
  Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'avais changé les batteries fin 2017.
Voir ticket - ID 25684

Bonne journ...' at line 1
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Dropdown.php:543                               DBmysql->request()
  src/Log.php:180                                    Dropdown::getDropdownName()
  src/CommonDBTM.php:694                             Log::constructHistory()
  src/CommonDBTM.php:1672                            CommonDBTM->updateInDB()
  front/infocom.form.php:69                          CommonDBTM->update()
  {"user":"7@test"} 
[2023-10-10 15:42:44] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '45555', '2023-10-10 15:42:44')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"8@test"} 
[2023-10-10 15:42:44] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '83906', '2023-10-10 15:42:44')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"8@test","mem_usage":"0.002\", 5.02Mio)"} 
[2023-10-10 15:42:45] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1964', 'Computer', '35', '112', '5', '1', 'VPY37-JBJJX-T2KB3-Y2WTW-VX9KP', '00371-OEM-9045926-96408', '1', '0', '0', '0', '2023-10-10 15:42:45', '2023-10-10 15:42:45')
  Error: Duplicate entry '1964-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"8@test"} 
[2023-10-10 16:44:14] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '45557', '2023-10-10 16:44:14')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"8@test"} 
[2023-10-10 16:44:14] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '83907', '2023-10-10 16:44:14')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"8@test","mem_usage":"0.002\", 5.14Mio)"} 
[2023-10-11 08:34:57] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1993', 'Computer', '91', '522', '920', '0', NULL, NULL, '1', '0', '0', '0', '2023-10-11 08:34:55', '2023-10-11 08:34:55')
  Error: Duplicate entry '1993-Computer-91-0' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"9@test"} 
[2023-10-11 09:03:13] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'Ticket', '44189', '2023-10-11 09:03:13')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:382                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"12@test"} 
[2023-10-11 09:03:13] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_pendingreasons_items` (`pendingreasons_id`, `followup_frequency`, `followups_before_resolution`, `itemtype`, `items_id`, `last_bump_date`) VALUES (NULL, '0', '0', 'TicketTask', '80353', '2023-10-11 09:03:13')
  Error: Column 'pendingreasons_id' cannot be null
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  src/PendingReason_Item.php:100                     CommonDBTM->add()
  src/PendingReason_Item.php:387                     PendingReason_Item::createForItem()
  src/CommonITILTask.php:388                         PendingReason_Item::handleTimelineEdits()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  front/commonitiltask.form.php:94                   CommonDBTM->update()
  front/tickettask.form.php:39                       include()
  {"user":"12@test","mem_usage":"0.002\", 12.65Mio)"} 
[2023-10-11 09:35:33] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_operatingsystems` (`items_id`, `itemtype`, `operatingsystems_id`, `operatingsystemversions_id`, `operatingsystemservicepacks_id`, `operatingsystemarchitectures_id`, `license_number`, `licenseid`, `is_dynamic`, `is_deleted`, `entities_id`, `is_recursive`, `date_creation`, `date_mod`) VALUES ('1964', 'Computer', '35', '112', '5', '1', 'VPY37-JBJJX-T2KB3-Y2WTW-VX9KP', '00371-OEM-9045926-96408', '1', '0', '0', '0', '2023-10-11 09:35:33', '2023-10-11 09:35:33')
  Error: Duplicate entry '1964-Computer-35-1' for key 'unicity'
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:722                             DBmysql->insert()
  src/CommonDBTM.php:1317                            CommonDBTM->addToDB()
  marketplace/ocsinventoryng/inc/os.class.php:224    CommonDBTM->add()
  ...ce/ocsinventoryng/inc/ocsprocess.class.php:1284 PluginOcsinventoryngOS::updateComputerOS()
  ...ace/ocsinventoryng/inc/ocsserver.class.php:2962 PluginOcsinventoryngOcsProcess::synchronizeComputer()
  src/CronTask.php:1018                              PluginOcsinventoryngOcsServer::cronocsng()
  front/cron.php:63                                  CronTask::launch()
  {"user":"9@test"} 
[2023-10-11 11:20:09] glpisqllog.ERROR: DBmysql::query() in /var/www/glpis/test/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: UPDATE `glpi_planningrecalls` SET `when` = DATE_SUB('NULL', INTERVAL `before_time` SECOND) WHERE `itemtype` = 'TicketTask' AND `items_id` = '83792'
  Error: Incorrect datetime value: 'NULL'
  Backtrace :
  src/DBmysql.php:1439                               
  src/PlanningRecall.php:241                         DBmysql->update()
  src/CommonITILTask.php:375                         PlanningRecall::managePlanningUpdates()
  src/CommonDBTM.php:1718                            CommonITILTask->post_updateItem()
  src/CommonITILTask.php:1899                        CommonDBTM->update()
  front/commonitiltask.form.php:108                  CommonITILTask->unplan()
  front/tickettask.form.php:39                       include()
  {"user":"277@test"} 
cedric-anne commented 10 months ago

Nothing is related to the issue itself. I really have no idea how to reproduce this.

zekuraz commented 10 months ago

when I apply the modification you made to "src/System/Diagnostic/DatabaseSchemaIntegrityChecker.php", I now get this message

Capture d’écran du 2023-10-17 14-26-35

the result of the request "php bin/console database:check_schema_integrity" chech_schema_integrity.zip

cedric-anne commented 10 months ago

What is the content of your install/mysql/glpi-empty.sql file? Is this file readable by the apache user?

zekuraz commented 10 months ago

This is my install/mysql/glpi-empty.sql glpi-empty.zip

cedric-anne commented 10 months ago

This file looks OK. Really, I do not understand what is the issue.

zekuraz commented 10 months ago

I have to manually delete the tables listed in the result of "php bin/console database:check_schema_integrity" ?

cedric-anne commented 10 months ago

No, check is broken on your specific GLPI installation. I do not know why, but you should just ignore it.