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

Undefined array key: "import_monitor", "import_peripheral", "import_printer" #13049

Closed LukeZS closed 1 year ago

LukeZS commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.3

Bug description

In the page: Home > Administration > Inventory

It shows the following warning:

Monitors
Warning: Undefined array key "import_monitor" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php on line 398

Printers
Warning: Undefined array key "import_printer" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php on line 412

Devices Warning: Undefined array key "import_peripheral" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php on line 427

Relevant log output

[2022-10-24 09:06:03] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "import_monitor" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php at line 929
  Backtrace :
  src\Inventory\Asset\Monitor.php:235                Glpi\Inventory\Conf->__get()
  src\Inventory\Inventory.php:674                    Glpi\Inventory\Asset\Monitor->checkConf()
  src\Inventory\Inventory.php:335                    Glpi\Inventory\Inventory->processInventoryData()
  src\Inventory\Request.php:360                      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:244    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front\inventory.php:86                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  index.php:95                                       include_once()

[2022-10-24 09:06:03] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "import_peripheral" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php at line 929
  Backtrace :
  src\Inventory\Asset\Peripheral.php:258             Glpi\Inventory\Conf->__get()
  src\Inventory\Inventory.php:674                    Glpi\Inventory\Asset\Peripheral->checkConf()
  src\Inventory\Inventory.php:335                    Glpi\Inventory\Inventory->processInventoryData()
  src\Inventory\Request.php:360                      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:244    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front\inventory.php:86                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  index.php:95                                       include_once()

[2022-10-24 09:06:03] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "import_printer" in C:\xampp\htdocs\helpdesk\src\Inventory\Conf.php at line 929
  Backtrace :
  src\Inventory\Asset\Printer.php:194                Glpi\Inventory\Conf->__get()
  src\Inventory\Asset\MainAsset.php:834              Glpi\Inventory\Asset\Printer->handle()
  src\Inventory\Asset\MainAsset.php:754              Glpi\Inventory\Asset\MainAsset->handleAssets()
  src\RuleImportAsset.php:946                        Glpi\Inventory\Asset\MainAsset->rulepassed()
  src\Rule.php:1510                                  RuleImportAsset->executeActions()
  src\RuleCollection.php:1591                        Rule->process()
  src\Inventory\Asset\MainAsset.php:554              RuleCollection->processAllRules()
  src\Inventory\Inventory.php:701                    Glpi\Inventory\Asset\MainAsset->handle()
  src\Inventory\Inventory.php:336                    Glpi\Inventory\Inventory->handleItem()
  src\Inventory\Request.php:360                      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:244    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front\inventory.php:86                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  index.php:95                                       include_once()

Page URL

No response

Steps To reproduce

No step required, simply go to the Home > Administration > Inventory page

Your GLPI setup information

Information about system installation and configuration
GLPI 10.0.3 (/helpdesk => C:\xampp\htdocs\helpdesk)
Installation mode: TARBALL
Current language:en_GB

Server
 
Operating system: Windows NT ASSET2 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
PHP 8.1.5 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bcmath, bz2, calendar,
    ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli,
    mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, readline, session, sodium, standard, tokenizer, xml, xmlreader, xmlwriter, zip,
    zlib)
Setup: max_execution_time="120" memory_limit="512M" post_max_size="512M" safe_mode="" session.save_handler="files"
    upload_max_filesize="400M" 
Software: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.5 (Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.5 Server at
    asset.rgdomain.local Port 80
)
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Server Software: mariadb.org binary distribution
    Server Version: 10.4.24-MariaDB
    Server SQL Mode: NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION
    Parameters: root@localhost/glpi
    Host info: localhost via TCP/IP

PHP version (8.1.5) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.
gd extension is installed.
intl extension is installed.
libxml extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.4.24) is supported.
The log file has been created successfully.
Write access to C:\xampp\htdocs\helpdesk/files/_cache has been validated.
Write access to C:\xampp\htdocs\helpdesk/config has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_cron has been validated.
Write access to C:\xampp\htdocs\helpdesk/files has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_dumps has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_graphs has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_lock has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_pictures has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_plugins has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_rss has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_sessions has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_tmp has been validated.
Write access to C:\xampp\htdocs\helpdesk/files/_uploads has been validated.
Web access to files directory is protected
Sessions configuration is secured.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
zip extension is installed.
bz2 extension is installed.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to C:\xampp\htdocs\helpdesk/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: C:\xampp\htdocs\helpdesk
GLPI_CONFIG_DIR: C:\xampp\htdocs\helpdesk/config
GLPI_VAR_DIR: C:\xampp\htdocs\helpdesk/files
GLPI_MARKETPLACE_DIR: C:\xampp\htdocs\helpdesk/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: 

Warning:  Array to string conversion in C:\xampp\htdocs\helpdesk\src\Config.php on line 2073

GLPI_SERVERSIDE_URL_ALLOWLIST: Array
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: 1
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1
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: C:\xampp\htdocs\helpdesk/files
GLPI_CACHE_DIR: C:\xampp\htdocs\helpdesk/files/_cache
GLPI_CRON_DIR: C:\xampp\htdocs\helpdesk/files/_cron
GLPI_DUMP_DIR: C:\xampp\htdocs\helpdesk/files/_dumps
GLPI_GRAPH_DIR: C:\xampp\htdocs\helpdesk/files/_graphs
GLPI_LOCAL_I18N_DIR: C:\xampp\htdocs\helpdesk/files/_locales
GLPI_LOCK_DIR: C:\xampp\htdocs\helpdesk/files/_lock
GLPI_LOG_DIR: C:\xampp\htdocs\helpdesk/files/_log
GLPI_PICTURE_DIR: C:\xampp\htdocs\helpdesk/files/_pictures
GLPI_PLUGIN_DOC_DIR: C:\xampp\htdocs\helpdesk/files/_plugins
GLPI_RSS_DIR: C:\xampp\htdocs\helpdesk/files/_rss
GLPI_SESSION_DIR: C:\xampp\htdocs\helpdesk/files/_sessions
GLPI_TMP_DIR: C:\xampp\htdocs\helpdesk/files/_tmp
GLPI_UPLOAD_DIR: C:\xampp\htdocs\helpdesk/files/_uploads
GLPI_INVENTORY_DIR: C:\xampp\htdocs\helpdesk/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/glpi-plugins/
GLPI_I18N_DIR: C:\xampp\htdocs\helpdesk/locales
GLPI_VERSION: 10.0.3
GLPI_SCHEMA_VERSION: 10.0.3@a130db99c7d9b131c2e2ea59fe0d6260fe93d831
GLPI_MARKETPLACE_PRERELEASES: 
GLPI_MIN_PHP: 7.4.0
GLPI_MAX_PHP: 8.3.0
GLPI_YEAR: 2022

Libraries
 
htmlawed/htmlawed version 1.2.9 in (C:\xampp\htdocs\helpdesk\vendor\htmlawed\htmlawed)
phpmailer/phpmailer version 6.6.0 in (C:\xampp\htdocs\helpdesk\vendor\phpmailer\phpmailer\src)
simplepie/simplepie version 1.5.8 in (C:\xampp\htdocs\helpdesk\vendor\simplepie\simplepie\library)
tecnickcom/tcpdf version 6.5.0 in (C:\xampp\htdocs\helpdesk\vendor\tecnickcom\tcpdf)
michelf/php-markdown in (C:\xampp\htdocs\helpdesk\vendor\michelf\php-markdown\Michelf)
true/punycode in (C:\xampp\htdocs\helpdesk\vendor\true\punycode\src)
iamcal/lib_autolink in (C:\xampp\htdocs\helpdesk\vendor\iamcal\lib_autolink)
sabre/dav in (C:\xampp\htdocs\helpdesk\vendor\sabre\dav\lib\DAV)
sabre/http in (C:\xampp\htdocs\helpdesk\vendor\sabre\http\lib)
sabre/uri in (C:\xampp\htdocs\helpdesk\vendor\sabre\uri\lib)
sabre/vobject in (C:\xampp\htdocs\helpdesk\vendor\sabre\vobject\lib)
laminas/laminas-i18n in (C:\xampp\htdocs\helpdesk\vendor\laminas\laminas-i18n\src)
laminas/laminas-servicemanager in (C:\xampp\htdocs\helpdesk\vendor\laminas\laminas-servicemanager\src)
monolog/monolog in (C:\xampp\htdocs\helpdesk\vendor\monolog\monolog\src\Monolog)
sebastian/diff in (C:\xampp\htdocs\helpdesk\vendor\sebastian\diff\src)
donatj/phpuseragentparser in (C:\xampp\htdocs\helpdesk\vendor\donatj\phpuseragentparser\src\UserAgent)
elvanto/litemoji in (C:\xampp\htdocs\helpdesk\vendor\elvanto\litemoji\src)
symfony/console in (C:\xampp\htdocs\helpdesk\vendor\symfony\console)
scssphp/scssphp in (C:\xampp\htdocs\helpdesk\vendor\scssphp\scssphp\src)
laminas/laminas-mail in (C:\xampp\htdocs\helpdesk\vendor\laminas\laminas-mail\src\Protocol)
laminas/laminas-mime in (C:\xampp\htdocs\helpdesk\vendor\laminas\laminas-mime\src)
rlanvin/php-rrule in (C:\xampp\htdocs\helpdesk\vendor\rlanvin\php-rrule\src)
blueimp/jquery-file-upload in (C:\xampp\htdocs\helpdesk\vendor\blueimp\jquery-file-upload\server\php)
ramsey/uuid in (C:\xampp\htdocs\helpdesk\vendor\ramsey\uuid\src)
psr/log in (C:\xampp\htdocs\helpdesk\vendor\psr\log\Psr\Log)
psr/simple-cache in (C:\xampp\htdocs\helpdesk\vendor\psr\simple-cache\src)
psr/cache in (C:\xampp\htdocs\helpdesk\vendor\psr\cache\src)
league/csv in (C:\xampp\htdocs\helpdesk\vendor\league\csv\src)
mexitek/phpcolors in (C:\xampp\htdocs\helpdesk\vendor\mexitek\phpcolors\src\Mexitek\PHPColors)
guzzlehttp/guzzle in (C:\xampp\htdocs\helpdesk\vendor\guzzlehttp\guzzle\src)
guzzlehttp/psr7 in (C:\xampp\htdocs\helpdesk\vendor\guzzlehttp\psr7\src)
glpi-project/inventory_format in (C:\xampp\htdocs\helpdesk\vendor\glpi-project\inventory_format\lib\php)
wapmorgan/unified-archive in (C:\xampp\htdocs\helpdesk\vendor\wapmorgan\unified-archive\src)
paragonie/sodium_compat in (C:\xampp\htdocs\helpdesk\vendor\paragonie\sodium_compat\src)
symfony/cache in (C:\xampp\htdocs\helpdesk\vendor\symfony\cache)
html2text/html2text in (C:\xampp\htdocs\helpdesk\vendor\html2text\html2text\src)
symfony/css-selector in (C:\xampp\htdocs\helpdesk\vendor\symfony\css-selector)
symfony/dom-crawler in (C:\xampp\htdocs\helpdesk\vendor\symfony\dom-crawler)
twig/twig in (C:\xampp\htdocs\helpdesk\vendor\twig\twig\src)
twig/string-extra in (C:\xampp\htdocs\helpdesk\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 (C:\xampp\htdocs\helpdesk\vendor\symfony\polyfill-php82)

LDAP directories
 

SQL replicas
 

Notifications
 

Plugins list
 

Anything else?

No response

stonebuzz commented 1 year ago

Hi @LukeZS can you post here your GLPI inventory conf ? (enable debug mode) image

Best regards

LukeZS commented 1 year ago

image

stonebuzz commented 1 year ago

Can you save configuration (this should put the values right.)

Best regards

LukeZS commented 1 year ago

Done! It worked :) Thanks!