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

Wrong location set by entity rules #15575

Closed shinsen26 closed 11 months ago

shinsen26 commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.9 (glpi inventory 1.2.3)

Bug description

I'm currently managing 4,1k computers with GLPIInventory plugin

The location field is managed by the rules (If CIDR matches, it put the location i've choose) I don't know why when agents give to the GLPI server their inventory, sometimes the user "inventory" create a new location with the name = the ID of the location it must set

Exemple : DB ID 212 = LocA DB ID 213 = LocB

If the CIDR matches for LocB the user "inventory" create the location named "213" with the DB ID 214 https://ibb.co/ZGjw3tm

At the begin of 2023 i had the same issue and the fix #12778 worked until now It's the exact same issue than #12651

Relevant log output

I see nothing on logs, tell me what is needed

Page URL

No response

Steps To reproduce

  1. Make some entity rules for set location with CIDR
  2. Wait for some agents to give the inventory to server
  3. Check locations page if new locations is created

Your GLPI setup information

GLPI 10.0.9 (/glpi => /srv/www/htdocs/glpi) Installation mode: TARBALL Current language:fr_FR

Operating system: Linux gcav840 5.3.18-150300.59.106-default #1 SMP Mon Dec 12 13:16:24 UTC 2022 (774239c) x86_64 PHP 7.4.33 apache2handler (Core, PDO, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bz2, ctype, curl, date, dom, exif, fileinfo, filter, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, session, sodium, sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, zip, zlib) Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="2M" Software: Apache () Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Server Software: MariaDB package Server Version: 10.5.17-MariaDB Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: admindb_glpi@localhost/db_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, filter, libxml, json, simplexml, xmlreader, xmlwriter.Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter. curl extension is installed.curl extension is installed. gd extension is installed.gd extension is installed. intl extension is installed.intl 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.17) is supported.Database engine version (10.5.17) 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 /srv/www/htdocs/glpi/files/_cache has been validated. Write access to /srv/www/htdocs/glpi/config has been validated. Write access to /srv/www/htdocs/glpi/files/_cron has been validated. Write access to /srv/www/htdocs/glpi/files has been validated. Write access to /srv/www/htdocs/glpi/files/_dumps has been validated. Write access to /srv/www/htdocs/glpi/files/_graphs has been validated. Write access to /srv/www/htdocs/glpi/files/_lock has been validated. Write access to /srv/www/htdocs/glpi/files/_pictures has been validated. Write access to /srv/www/htdocs/glpi/files/_plugins has been validated. Write access to /srv/www/htdocs/glpi/files/_rss has been validated. Write access to /srv/www/htdocs/glpi/files/_sessions has been validated. Write access to /srv/www/htdocs/glpi/files/_tmp has been validated. Write access to /srv/www/htdocs/glpi/files/_uploads has been validated.Write access to /srv/www/htdocs/glpi/files/_cache has been validated. Write access to /srv/www/htdocs/glpi/config has been validated. Write access to /srv/www/htdocs/glpi/files/_cron has been validated. Write access to /srv/www/htdocs/glpi/files has been validated. Write access to /srv/www/htdocs/glpi/files/_dumps has been validated. Write access to /srv/www/htdocs/glpi/files/_graphs has been validated. Write access to /srv/www/htdocs/glpi/files/_lock has been validated. Write access to /srv/www/htdocs/glpi/files/_pictures has been validated. Write access to /srv/www/htdocs/glpi/files/_plugins has been validated. Write access to /srv/www/htdocs/glpi/files/_rss has been validated. Write access to /srv/www/htdocs/glpi/files/_sessions has been validated. Write access to /srv/www/htdocs/glpi/files/_tmp has been validated. Write access to /srv/www/htdocs/glpi/files/_uploads has been validated. 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 "/srv/www/htdocs/glpi": ‣ "/srv/www/htdocs/glpi/files" ("GLPI_VAR_DIR") ‣ "/srv/www/htdocs/glpi/config" ("GLPI_CONFIG_DIR") You can ignore this suggestion if your web server root directory is "/srv/www/htdocs/glpi/public".The following directories should be placed outside "/srv/www/htdocs/glpi": ‣ "/srv/www/htdocs/glpi/files" ("GLPI_VAR_DIR") ‣ "/srv/www/htdocs/glpi/config" ("GLPI_CONFIG_DIR") You can ignore this suggestion if your web server root directory is "/srv/www/htdocs/glpi/public". Sessions configuration is secured.Sessions configuration is secured. 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, zip. Following extensions are not present: Phar.Following extensions are installed: bz2, zip. Following extensions are not present: Phar. 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 /srv/www/htdocs/glpi/marketplace has been validated.Write access to /srv/www/htdocs/glpi/marketplace has been validated. Timezones seems loaded in database.Timezones seems loaded in database.

GLPI_ROOT: "/srv/www/htdocs/glpi" GLPI_CONFIG_DIR: "/srv/www/htdocs/glpi/config" GLPI_VAR_DIR: "/srv/www/htdocs/glpi/files" GLPI_MARKETPLACE_DIR: "/srv/www/htdocs/glpi/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_DOC_DIR: "/srv/www/htdocs/glpi/files" GLPI_CACHE_DIR: "/srv/www/htdocs/glpi/files/_cache" GLPI_CRON_DIR: "/srv/www/htdocs/glpi/files/_cron" GLPI_DUMP_DIR: "/srv/www/htdocs/glpi/files/_dumps" GLPI_GRAPH_DIR: "/srv/www/htdocs/glpi/files/_graphs" GLPI_LOCAL_I18N_DIR: "/srv/www/htdocs/glpi/files/_locales" GLPI_LOCK_DIR: "/srv/www/htdocs/glpi/files/_lock" GLPI_LOG_DIR: "/srv/www/htdocs/glpi/files/_log" GLPI_PICTURE_DIR: "/srv/www/htdocs/glpi/files/_pictures" GLPI_PLUGIN_DOC_DIR: "/srv/www/htdocs/glpi/files/_plugins" GLPI_RSS_DIR: "/srv/www/htdocs/glpi/files/_rss" GLPI_SESSION_DIR: "/srv/www/htdocs/glpi/files/_sessions" GLPI_TMP_DIR: "/srv/www/htdocs/glpi/files/_tmp" GLPI_UPLOAD_DIR: "/srv/www/htdocs/glpi/files/_uploads" GLPI_INVENTORY_DIR: "/srv/www/htdocs/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: "/srv/www/htdocs/glpi/locales" GLPI_VERSION: "10.0.9" GLPI_SCHEMA_VERSION: "10.0.9@77fc44668eaae89b61d95fe606d20d93d66110cd" GLPI_MARKETPLACE_PRERELEASES: false GLPI_MIN_PHP: "7.4.0" GLPI_MAX_PHP: "8.3.0" GLPI_YEAR: "2023"

htmlawed/htmlawed version 1.2.14 in (/srv/www/htdocs/glpi/vendor/htmlawed/htmlawed) phpmailer/phpmailer version 6.8.0 in (/srv/www/htdocs/glpi/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.8 in (/srv/www/htdocs/glpi/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.6.2 in (/srv/www/htdocs/glpi/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/srv/www/htdocs/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/srv/www/htdocs/glpi/vendor/true/punycode/src) iamcal/lib_autolink in (/srv/www/htdocs/glpi/vendor/iamcal/lib_autolink) sabre/dav in (/srv/www/htdocs/glpi/vendor/sabre/dav/lib/DAV) sabre/http in (/srv/www/htdocs/glpi/vendor/sabre/http/lib) sabre/uri in (/srv/www/htdocs/glpi/vendor/sabre/uri/lib) sabre/vobject in (/srv/www/htdocs/glpi/vendor/sabre/vobject/lib) laminas/laminas-i18n in (/srv/www/htdocs/glpi/vendor/laminas/laminas-i18n/src) laminas/laminas-servicemanager in (/srv/www/htdocs/glpi/vendor/laminas/laminas-servicemanager/src) monolog/monolog in (/srv/www/htdocs/glpi/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/srv/www/htdocs/glpi/vendor/sebastian/diff/src) donatj/phpuseragentparser in (/srv/www/htdocs/glpi/vendor/donatj/phpuseragentparser/src/UserAgent) elvanto/litemoji in (/srv/www/htdocs/glpi/vendor/elvanto/litemoji/src) symfony/console in (/srv/www/htdocs/glpi/vendor/symfony/console) scssphp/scssphp in (/srv/www/htdocs/glpi/vendor/scssphp/scssphp/src) laminas/laminas-mail in (/srv/www/htdocs/glpi/vendor/laminas/laminas-mail/src/Protocol) laminas/laminas-mime in (/srv/www/htdocs/glpi/vendor/laminas/laminas-mime/src) rlanvin/php-rrule in (/srv/www/htdocs/glpi/vendor/rlanvin/php-rrule/src) blueimp/jquery-file-upload in (/srv/www/htdocs/glpi/vendor/blueimp/jquery-file-upload/server/php) ramsey/uuid in (/srv/www/htdocs/glpi/vendor/ramsey/uuid/src) psr/log in (/srv/www/htdocs/glpi/vendor/psr/log/Psr/Log) psr/simple-cache in (/srv/www/htdocs/glpi/vendor/psr/simple-cache/src) psr/cache in (/srv/www/htdocs/glpi/vendor/psr/cache/src) league/csv in (/srv/www/htdocs/glpi/vendor/league/csv/src) mexitek/phpcolors in (/srv/www/htdocs/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors) guzzlehttp/guzzle in (/srv/www/htdocs/glpi/vendor/guzzlehttp/guzzle/src) guzzlehttp/psr7 in (/srv/www/htdocs/glpi/vendor/guzzlehttp/psr7/src) glpi-project/inventory_format in (/srv/www/htdocs/glpi/vendor/glpi-project/inventory_format/lib/php) wapmorgan/unified-archive in (/srv/www/htdocs/glpi/vendor/wapmorgan/unified-archive/src) paragonie/sodium_compat in (/srv/www/htdocs/glpi/vendor/paragonie/sodium_compat/src) symfony/cache in (/srv/www/htdocs/glpi/vendor/symfony/cache) html2text/html2text in (/srv/www/htdocs/glpi/vendor/html2text/html2text/src) symfony/css-selector in (/srv/www/htdocs/glpi/vendor/symfony/css-selector) symfony/dom-crawler in (/srv/www/htdocs/glpi/vendor/symfony/dom-crawler) twig/twig in (/srv/www/htdocs/glpi/vendor/twig/twig/src) twig/string-extra in (/srv/www/htdocs/glpi/vendor/twig/string-extra) symfony/polyfill-ctype not found symfony/polyfill-iconv not found symfony/polyfill-mbstring not found symfony/polyfill-php80 in (/srv/www/htdocs/glpi/vendor/symfony/polyfill-php80) symfony/polyfill-php81 in (/srv/www/htdocs/glpi/vendor/symfony/polyfill-php81) symfony/polyfill-php82 in (/srv/www/htdocs/glpi/vendor/symfony/polyfill-php82) league/oauth2-client in (/srv/www/htdocs/glpi/vendor/league/oauth2-client/src/Provider) league/oauth2-google in (/srv/www/htdocs/glpi/vendor/league/oauth2-google/src/Provider) thenetworg/oauth2-azure in (/srv/www/htdocs/glpi/vendor/thenetworg/oauth2-azure/src/Provider)

Plugins list

datainjection Name: Data Injection Version: 2.12.0 State: Installed / not activated Install Method: Manual archimap Name: Diagrammes Version: 3.2.17 State: Installed / not activated Install Method: Marketplace glpiinventory Name: GLPI Inventory Version: 1.2.3 State: Enabled Install Method: Manual manufacturersimports Name: Imports fabricants Version: 3.0.2 State: Installed / not activated Install Method: Manual reports Name: Rapports Version: 1.16.0 State: Not installed Install Method: Manual

Anything else?

No response

shinsen26 commented 1 year ago

This morning at work, i've 150+ entrys with this problem

shinsen26 commented 1 year ago

So i removed them yesterday and actually no more locations is created, i'll close and update if needed.

shinsen26 commented 1 year ago

Issue persist after the 10.0.10 update but i managed to know from where theses are created, it's from the SNMP discovery when the rule "Unmanaged update (by name)" is working

Someone can help me please?

trasher commented 1 year ago

This seems quite difficult to reproduce.

Please provide us a simple way to reproduce (this includes rules you use, inventory files involved, etc).

stonebuzz commented 1 year ago

After several tests

I'm not reproducing your case

Do you have any PHP or SQL errors in GLPI log files during inventory?

Can you compare the PC entity with the location entity?

Best regards

trasher commented 11 months ago

No feedback from a while, closing.