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.32k stars 1.29k forks source link

Large disk support #16844

Closed spilla-quinten closed 7 months ago

spilla-quinten commented 7 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.12

Bug description

I have some virtual machines in AWS EC2 running Debian 11 and 12 with an EFS mount, the OS sees the disk as 8.0 EB:

$ df -h
Filesystem                                 Size  Used Avail Use% Mounted on
udev                                       464M     0  464M   0% /dev
tmpfs                                       96M  900K   95M   1% /run
/dev/nvme0n1p1                              63G  6.4G   54G  11% /
tmpfs                                      477M     0  477M   0% /dev/shm
tmpfs                                      5.0M     0  5.0M   0% /run/lock
/dev/nvme0n1p15                            124M   12M  113M  10% /boot/efi
fs-xxxxxx.efs.eu-west-3.amazonaws.com:/    8.0E   10G  8.0E   1% /mnt/efs
tmpfs

Each time the glpi agent sends inventory data, I have the following error in the sql-errors.log:

[2024-03-28 09:51:12] glpisqllog.ERROR: DBmysql::doQuery() in /var/www/glpi10.example.com/src/DBmysql.php line 403
  *** MySQL query error:
  SQL: INSERT INTO `glpi_items_disks` (`device`, `filesystems_id`, `totalsize`, `freesize`, `name`, `mountpoint`, `is_dynamic`, `items_id`, `itemtype`, `entities_id`, `date_creation`, `date_mod`) VALUES ('fs-xxxxxx.efs.eu-west-3.amazonaws.com:/', '23', '8796093022207', '8796093016203', '/mnt/efs', '/mnt/efs', '1', '23', 'Computer', '0', '2024-03-28 09:51:11', '2024-03-28 09:51:11')
  Error: Out of range value for column 'totalsize' at row 1
  Backtrace :
  src/DBmysql.php:1380                               DBmysql->doQuery()
  src/CommonDBTM.php:729                             DBmysql->insert()
  src/CommonDBTM.php:1342                            CommonDBTM->addToDB()
  src/Inventory/Asset/Volume.php:191                 CommonDBTM->add()
  src/Inventory/Asset/MainAsset.php:1001             Glpi\Inventory\Asset\Volume->handle()
  src/Inventory/Asset/MainAsset.php:916              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src/RuleImportAsset.php:981                        Glpi\Inventory\Asset\MainAsset->rulepassed()
  src/Rule.php:1531                                  RuleImportAsset->executeActions()
  src/RuleCollection.php:1660                        Rule->process()
  src/Inventory/Asset/MainAsset.php:582              RuleCollection->processAllRules()
  src/Inventory/Inventory.php:724                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:355                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:364                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:90                       Glpi\Inventory\Request->inventory()
  src/Agent/Communication/AbstractRequest.php:332    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:269    Glpi\Agent\Communication\AbstractRequest->handleXMLRequest()
  front/inventory.php:95                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  plugins/glpiinventory/front/communication.php:72   include_once()
  plugins/glpiinventory/index.php:45                 include_once()
  {"user":"inventory@inventory01.example.com"}

Relevant log output

No response

Page URL

No response

Steps To reproduce

  1. in an AWS region, create an EFS filesystem
  2. in the same AWS region, create an EC2 VM with a Linux image (for example Debian 12) and mount the EFS filesystem as NFS
  3. confirm that the EFS size is reported as 8.0E with df -h
  4. install the glpi agent on the VM and point it to a glpi server
  5. let the agent run the Inventory task
  6. watch the sql-errors.log file in the glpi server for errors such as Out of range value for column 'totalsize' at row 1

Your GLPI setup information

<details><summary>Information about system installation & configuration</summary><pre>GLPI 10.0.12 ( => /var/www/glpi10.example.com)
Installation mode: TARBALL
Current language:en_US

</pre></details><details><summary>Server</summary><pre> 
Operating system: Linux inventory01.example.com 6.1.0-18-cloud-amd64 #​1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01)
  x86_64
PHP 8.2.7 fpm-fcgi (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bz2, calendar, cgi-fcgi, ctype, curl, date,
  dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, 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, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="300" memory_limit="256M" post_max_size="100M" safe_mode="" session.save_handler="files"
  upload_max_filesize="100M"
  disable_functions="pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,"

Software: nginx/1.22.1
  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Server Software: mariadb.org binary distribution
  Server Version: 10.11.7-MariaDB-1:10.11.7+maria~ubu2204
  Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  Parameters: glpi10@127.0.0.1:13306/glpi10db
  Host info: 127.0.0.1 via TCP/IP

PHP version (8.2.7) 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.7) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /mnt/glpi-files/_cache has been validated.
Write access to /mnt/glpi-files/_cron has been validated.
Write access to /mnt/glpi-files has been validated.
Write access to /mnt/glpi-files/_dumps has been validated.
Write access to /mnt/glpi-files/_graphs has been validated.
Write access to /mnt/glpi-files/_lock has been validated.
Write access to /mnt/glpi-files/_pictures has been validated.
Write access to /mnt/glpi-files/_plugins has been validated.
Write access to /mnt/glpi-files/_rss has been validated.
Write access to /mnt/glpi-files/_sessions has been validated.
Write access to /mnt/glpi-files/_tmp has been validated.
Write access to /mnt/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 /var/www/glpi10.example.com/marketplace has been validated.
Timezones seems loaded in database.

</pre></details><details><summary>GLPI constants</summary><pre> 
GLPI_ROOT: "/var/www/glpi10.example.com"
GLPI_CONFIG_DIR: "/etc/glpi/"
GLPI_VAR_DIR: "/mnt/glpi-files"
GLPI_LOG_DIR: "/var/log/glpi"
GLPI_MARKETPLACE_DIR: "/var/www/glpi10.example.com/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_EXPIRES: "7200"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\\/\\/[^@:]+(\\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "TARBALL"
GLPI_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_TEXT_MAXSIZE: "4000"
GLPI_DOC_DIR: "/mnt/glpi-files"
GLPI_CACHE_DIR: "/mnt/glpi-files/_cache"
GLPI_CRON_DIR: "/mnt/glpi-files/_cron"
GLPI_DUMP_DIR: "/mnt/glpi-files/_dumps"
GLPI_GRAPH_DIR: "/mnt/glpi-files/_graphs"
GLPI_LOCAL_I18N_DIR: "/mnt/glpi-files/_locales"
GLPI_LOCK_DIR: "/mnt/glpi-files/_lock"
GLPI_PICTURE_DIR: "/mnt/glpi-files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/mnt/glpi-files/_plugins"
GLPI_RSS_DIR: "/mnt/glpi-files/_rss"
GLPI_SESSION_DIR: "/mnt/glpi-files/_sessions"
GLPI_TMP_DIR: "/mnt/glpi-files/_tmp"
GLPI_UPLOAD_DIR: "/mnt/glpi-files/_uploads"
GLPI_INVENTORY_DIR: "/mnt/glpi-files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "/var/www/glpi10.example.com/locales"
GLPI_VERSION: "10.0.12"
GLPI_SCHEMA_VERSION: "10.0.12@b902ef5f5da967c1a9d0826ee8a7dce07d57cf3d"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.4.0"
GLPI_YEAR: "2024"

</pre></details><details><summary>Libraries</summary><pre> 
htmlawed/htmlawed version 1.2.14 in (/var/www/glpi10.example.com/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/var/www/glpi10.example.com/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/var/www/glpi10.example.com/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.6.2 in (/var/www/glpi10.example.com/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/var/www/glpi10.example.com/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/glpi10.example.com/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/glpi10.example.com/vendor/iamcal/lib_autolink)
sabre/dav in (/var/www/glpi10.example.com/vendor/sabre/dav/lib/DAV)
sabre/http in (/var/www/glpi10.example.com/vendor/sabre/http/lib)
sabre/uri in (/var/www/glpi10.example.com/vendor/sabre/uri/lib)
sabre/vobject in (/var/www/glpi10.example.com/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/var/www/glpi10.example.com/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/var/www/glpi10.example.com/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/var/www/glpi10.example.com/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/glpi10.example.com/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/var/www/glpi10.example.com/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/var/www/glpi10.example.com/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/glpi10.example.com/vendor/symfony/console)
scssphp/scssphp in (/var/www/glpi10.example.com/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/var/www/glpi10.example.com/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/var/www/glpi10.example.com/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/var/www/glpi10.example.com/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/var/www/glpi10.example.com/vendor/ramsey/uuid/src)
psr/log in (/var/www/glpi10.example.com/vendor/psr/log/Psr/Log)
psr/simple-cache in (/var/www/glpi10.example.com/vendor/psr/simple-cache/src)
psr/cache in (/var/www/glpi10.example.com/vendor/psr/cache/src)
league/csv in (/var/www/glpi10.example.com/vendor/league/csv/src)
mexitek/phpcolors in (/var/www/glpi10.example.com/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/var/www/glpi10.example.com/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/var/www/glpi10.example.com/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/var/www/glpi10.example.com/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/var/www/glpi10.example.com/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/var/www/glpi10.example.com/vendor/paragonie/sodium_compat/src)
symfony/cache in (/var/www/glpi10.example.com/vendor/symfony/cache)
html2text/html2text in (/var/www/glpi10.example.com/vendor/html2text/html2text/src)
symfony/css-selector in (/var/www/glpi10.example.com/vendor/symfony/css-selector)
symfony/dom-crawler in (/var/www/glpi10.example.com/vendor/symfony/dom-crawler)
twig/twig in (/var/www/glpi10.example.com/vendor/twig/twig/src)
twig/string-extra in (/var/www/glpi10.example.com/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 (/var/www/glpi10.example.com/vendor/symfony/polyfill-php82)
league/oauth2-client in (/var/www/glpi10.example.com/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/var/www/glpi10.example.com/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/var/www/glpi10.example.com/vendor/thenetworg/oauth2-azure/src/Provider)

</pre></details><details><summary>SQL replicas</summary><pre> 
Not active

</pre></details><details><summary>Notifications</summary><pre> 
Way of sending emails: PHP

</pre></details><details><summary>Plugins list</summary><pre> 
  glpiinventory        Name: GLPI Inventory                 Version: 1.3.5      State: Enabled                                 
    Install Method: Manual
  phpsaml              Name: PHP SAML                       Version: 1.3.0      State: Enabled                                 
    Install Method: Manual

</pre></details>

Anything else?

No response

trasher commented 7 months ago

Try if you reproduce with latest version, and if you do, please provide an inventory file we can use to reproduce.

spilla-quinten commented 7 months ago

@trasher I plan to upgrade in the next couple of days, in the meantime I can confirm that the following SQL statements have solved the immediate issue:

alter table glpi_items_disks modify column totalsize bigint unsigned;
alter table glpi_items_disks modify column freesize bigint unsigned;

After executing those 2 SQL statements I no longer have the errors in the sql-errors.log file, and the GLPI web interface correctly show the EFS mount with a total size of 8192 TB.

trasher commented 7 months ago

OK, so that's not been changed in latest releases.