You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to delete a computer from assets without any error but I found later in sql-errors.log a SQL error.
I don't think massive action context is relevant.
Relevant log output
Stacktrace found in sql-errors.log:
[2024-04-25 16:55:12] glpisqllog.ERROR: DBmysql::doQuery() in /srv/glpi/src/DBmysql.php line 403
*** MySQL query error:
SQL: UPDATE `glpi_databaseinstances` SET `items_id` = '0', `itemtype` = NULL, `date_mod` = '2024-04-25 16:55:10' WHERE `id` = '3'
Error: Column 'itemtype' cannot be null
Backtrace :
src/DBmysql.php:1503 DBmysql->doQuery()
src/CommonDBTM.php:689 DBmysql->update()
src/CommonDBTM.php:1698 CommonDBTM->updateInDB()
src/CommonDBTM.php:950 CommonDBTM->update()
src/CommonDBTM.php:797 CommonDBTM->cleanRelationData()
src/CommonDBTM.php:2100 CommonDBTM->deleteFromDB()
src/MassiveAction.php:1508 CommonDBTM->delete()
src/MassiveAction.php:1420 MassiveAction::processMassiveActionsForOneItemtype()
src/MassiveAction.php:1398 MassiveAction->processForSeveralItemtypes()
front/massiveaction.php:62 MassiveAction->process()
public/index.php:82 require()
{"user":"2@glpi-10-0-15","mem_usage":"2.113\", 4.63Mio)"}
Page URL
No response
Steps To reproduce
Import a computer with database instances
Delete it from assets
Your GLPI setup information
Informations sur le système, l'installation et la configuration
GLPI 10.0.15 ( => /srv/glpi)
Installation mode: TARBALL
Current language:fr_FR
Server
Operating system: Linux glpi-10-0-15 6.8.6-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Apr 13 15:14:23 UTC 2024 x86_64
PHP 8.2.18 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bz2, calendar,
ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli,
mysqlnd, openssl, pcre, pdo_mysql, posix, random, readline, session, shmop, sockets, sodium, standard, sysvmsg, sysvsem,
sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="300" memory_limit="1280M" post_max_size="1068M" safe_mode="" session.save_handler="files"
upload_max_filesize="1024M" disable_functions=""
Software: Apache/2.4.59 (Debian) (Apache/2.4.59 (Debian) Server at 192.168.2.15 Port 443
)
Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Server Software: Debian 12
Server Version: 10.11.6-MariaDB-0+deb12u1
Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: glpi@127.0.0.1/glpi
Host info: 127.0.0.1 via TCP/IP
PHP version (8.2.18) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.11.6) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /srv/glpi/files/_cache has been validated.
Write access to /srv/glpi/files/_cron has been validated.
Write access to /srv/glpi/files has been validated.
Write access to /srv/glpi/files/_dumps has been validated.
Write access to /srv/glpi/files/_graphs has been validated.
Write access to /srv/glpi/files/_lock has been validated.
Write access to /srv/glpi/files/_pictures has been validated.
Write access to /srv/glpi/files/_plugins has been validated.
Write access to /srv/glpi/files/_rss has been validated.
Write access to /srv/glpi/files/_sessions has been validated.
Write access to /srv/glpi/files/_tmp has been validated.
Write access to /srv/glpi/files/_uploads has been validated.
Web server root directory configuration seems safe.
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /srv/glpi/marketplace has been validated.
Access to timezone database (mysql) is not allowed.
htmlawed/htmlawed version 1.2.14 in (/srv/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/srv/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/srv/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.7.5 in (/srv/glpi/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/srv/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/srv/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/srv/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/srv/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/srv/glpi/vendor/sabre/http/lib)
sabre/uri in (/srv/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/srv/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/srv/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/srv/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/srv/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/srv/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/srv/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/srv/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/srv/glpi/vendor/symfony/console)
scssphp/scssphp in (/srv/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/srv/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/srv/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/srv/glpi/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/srv/glpi/vendor/ramsey/uuid/src)
psr/log in (/srv/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/srv/glpi/vendor/psr/simple-cache/src)
psr/cache in (/srv/glpi/vendor/psr/cache/src)
league/csv in (/srv/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/srv/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/srv/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/srv/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/srv/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/srv/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/srv/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/srv/glpi/vendor/symfony/cache)
html2text/html2text in (/srv/glpi/vendor/html2text/html2text/src)
symfony/css-selector in (/srv/glpi/vendor/symfony/css-selector)
symfony/dom-crawler in (/srv/glpi/vendor/symfony/dom-crawler)
twig/twig in (/srv/glpi/vendor/twig/twig/src)
twig/string-extra in (/srv/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (/srv/glpi/vendor/symfony/polyfill-php82)
league/oauth2-client in (/srv/glpi/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/srv/glpi/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/srv/glpi/vendor/thenetworg/oauth2-azure/src/Provider)
phpCas version 1.6.0 in (/usr/share/php/CAS/source)
trasher
changed the title
Found SQL error in sql-erros.log after computer deletion via massive action
Found SQL error in sql-erros.log after computer deletion
Apr 26, 2024
When creating a databse instance from the UI, without selecting any Item type/Item, the itemtype value stored in DB is 0. It whould probably be null in this case. Anyway, the problem is that this field is not nullable, but it should probably be nullable, as the value is not mandatory.
Not sure null is a correct solution. Having database instance back from inventory would probably create a new record; in that case, it may be better to remove instance when attached computer is purged.
That kind of case must probably be added in tests so we know hos it works.
Code of Conduct
Is there an existing issue for this?
Version
10.0.15
Bug description
I was able to delete a computer from assets without any error but I found later in sql-errors.log a SQL error.
I don't think massive action context is relevant.
Relevant log output
Page URL
No response
Steps To reproduce
Your GLPI setup information
Informations sur le système, l'installation et la configuration
Server
GLPI constants
Libraries
SQL replicas
Notifications
Plugins list
Anything else?
No response
The text was updated successfully, but these errors were encountered: