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

Bar graphs are not loading on fresh installation #16143

Open arthurrschaefer opened 9 months ago

arthurrschaefer commented 9 months ago

Code of Conduct

Is there an existing issue for this?

Version

10.1.0 - main

Bug description

When using the main nightly image, after a fresh installation, all the bar graphs on Dashboards have the same error:

Warning: Undefined array key 0 in /var/www/glpi/src/Dashboard/Widget.php on line 1056

image

If I just change the widget to other types like, Summary numbers, pies, it works fine.

Relevant log output

No response

Page URL

No response

Steps To reproduce

  1. Fresh install GLPI main image
  2. Finish the wizard
  3. Open as a super-admin user
  4. Try to see the widgets on Dashboards with a Bar Graph widget

Your GLPI setup information

GLPI information
GLPI: 10.1.0-dev ( => /var/www/glpi)
Installation mode: DOCKER
Current language: en_US
Server
Operating system: Linux 230a913b2d68 5.14.0-362.8.1.el9_3.x86_64 #​1 SMP PREEMPT_DYNAMIC Tue Oct 3 11:12:36 EDT 2023 x86_64

PHP: 8.2.12 apache2handler

PHP extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json,
mbstring, SPL, session, PDO, pdo_sqlite, bz2, posix, random, Reflection, standard, SimpleXML, tokenizer, xml, xmlreader,
xmlwriter, mysqlnd, apache2handler, apcu, Phar, exif, gd, intl, ldap, mysqli, soap, sodium, zip, Zend OPcache

Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files"
upload_max_filesize="2M" 

Web server: Apache/2.4.57 (Debian) (Apache/2.4.57 (Debian) Server at 172.16.10.253 Port 9999)

User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Database:

Server Software: MySQL Community Server - GPL

Server Version: 8.0.35

Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

Parameters: glpi@glpi101-db-1/glpi

Host info: glpi101-db-1 via TCP/IP

Requirements:
PHP version (8.2.12) is
supported.
OS and
PHP are relying on 64 bits integers.
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.
openssl extension is installed.
Database
engine version (8.0.35) is supported.
No files from
previous GLPI version detected.
The log file has
been created successfully.
Write
access to /var/glpi/files/_cache has been validated.
Write access to /var/glpi/files/_cron has been validated.
Write access to /var/glpi/files has been validated.
Write access to /var/glpi/files/_dumps has been validated.
Write access to /var/glpi/files/_graphs has been validated.
Write access to /var/glpi/files/_lock has been validated.
Write access to /var/glpi/files/_pictures has been validated.
Write access to /var/glpi/files/_plugins has been validated.
Write access to /var/glpi/files/_rss has been validated.
Write access to /var/glpi/files/_sessions has been validated.
Write access to /var/glpi/files/_tmp has been validated.
Write access to /var/glpi/files/_uploads has been validated.

Sessions configuration is secured.
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/glpi/marketplace has been validated.
Access to timezone
database (mysql) is not allowed.
GLPI constants
GLPI_ROOT: "/var/www/glpi"
GLPI_CONFIG_DIR: "/var/glpi/config"
GLPI_VAR_DIR: "/var/glpi/files"
GLPI_INSTALL_MODE: "DOCKER"
GLPI_MARKETPLACE_DIR: "/var/www/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_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ENABLE: 3
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DOCUMENTATION_ROOT_URL: "https://links.glpi-project.org"
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: "/var/glpi/files"
GLPI_CACHE_DIR: "/var/glpi/files/_cache"
GLPI_CRON_DIR: "/var/glpi/files/_cron"
GLPI_DUMP_DIR: "/var/glpi/files/_dumps"
GLPI_GRAPH_DIR: "/var/glpi/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/var/glpi/files/_locales"
GLPI_LOCK_DIR: "/var/glpi/files/_lock"
GLPI_LOG_DIR: "/var/glpi/files/_log"
GLPI_PICTURE_DIR: "/var/glpi/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/var/glpi/files/_plugins"
GLPI_RSS_DIR: "/var/glpi/files/_rss"
GLPI_SESSION_DIR: "/var/glpi/files/_sessions"
GLPI_TMP_DIR: "/var/glpi/files/_tmp"
GLPI_UPLOAD_DIR: "/var/glpi/files/_uploads"
GLPI_INVENTORY_DIR: "/var/glpi/files/_inventories"
GLPI_THEMES_DIR: "/var/glpi/files/_themes"
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_ENVIRONMENT_TYPE: "production"
GLPI_I18N_DIR: "/var/www/glpi/locales"
GLPI_VERSION: "10.1.0-dev"
GLPI_SCHEMA_VERSION: "10.1.0-dev@193702c30f3f02499ea96e8f7210167f4effe1c4"
GLPI_MARKETPLACE_PRERELEASES: true
GLPI_MIN_PHP: "8.1"
GLPI_MAX_PHP: "8.3"
GLPI_YEAR: "2023"
Libraries
symfony/mailer not found
simplepie/simplepie version 1.8.0 in /var/www/glpi/vendor/simplepie/simplepie/src
tecnickcom/tcpdf version 6.6.2 in /var/www/glpi/vendor/tecnickcom/tcpdf
sabre/dav version  in /var/www/glpi/vendor/sabre/dav/lib/DAV
sabre/http version  in /var/www/glpi/vendor/sabre/http/lib
sabre/uri version  in /var/www/glpi/vendor/sabre/uri/lib
sabre/vobject version  in /var/www/glpi/vendor/sabre/vobject/lib
laminas/laminas-i18n version  in /var/www/glpi/vendor/laminas/laminas-i18n/src
laminas/laminas-json version  in /var/www/glpi/vendor/laminas/laminas-json/src
monolog/monolog version  in /var/www/glpi/vendor/monolog/monolog/src/Monolog
sebastian/diff version  in /var/www/glpi/vendor/sebastian/diff/src
donatj/phpuseragentparser version  in /var/www/glpi/vendor/donatj/phpuseragentparser/src/UserAgent
elvanto/litemoji version  in /var/www/glpi/vendor/elvanto/litemoji/src
symfony/console version  in /var/www/glpi/vendor/symfony/console
symfony/filesystem version  in /var/www/glpi/vendor/symfony/filesystem
scssphp/scssphp version  in /var/www/glpi/vendor/scssphp/scssphp/src
laminas/laminas-mail version  in /var/www/glpi/vendor/laminas/laminas-mail/src/Protocol
laminas/laminas-mime version  in /var/www/glpi/vendor/laminas/laminas-mime/src
rlanvin/php-rrule version  in /var/www/glpi/vendor/rlanvin/php-rrule/src
ramsey/uuid version  in /var/www/glpi/vendor/ramsey/uuid/src
psr/log version  in /var/www/glpi/vendor/psr/log/src
psr/simple-cache version  in /var/www/glpi/vendor/psr/simple-cache/src
psr/cache version  in /var/www/glpi/vendor/psr/cache/src
league/csv version  in /var/www/glpi/vendor/league/csv/src
mexitek/phpcolors version  in /var/www/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors
guzzlehttp/guzzle version  in /var/www/glpi/vendor/guzzlehttp/guzzle/src
guzzlehttp/psr7 version  in /var/www/glpi/vendor/guzzlehttp/psr7/src
glpi-project/inventory_format version  in /var/www/glpi/vendor/glpi-project/inventory_format/lib/php
wapmorgan/unified-archive version  in /var/www/glpi/vendor/wapmorgan/unified-archive/src
paragonie/sodium_compat version  in /var/www/glpi/vendor/paragonie/sodium_compat/src
symfony/cache version  in /var/www/glpi/vendor/symfony/cache
html2text/html2text version  in /var/www/glpi/vendor/html2text/html2text/src
symfony/css-selector version  in /var/www/glpi/vendor/symfony/css-selector
symfony/dom-crawler version  in /var/www/glpi/vendor/symfony/dom-crawler
twig/twig version  in /var/www/glpi/vendor/twig/twig/src
twig/string-extra version  in /var/www/glpi/vendor/twig/string-extra
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php82 version  in /var/www/glpi/vendor/symfony/polyfill-php82
league/oauth2-client version  in /var/www/glpi/vendor/league/oauth2-client/src/Provider
league/oauth2-google version  in /var/www/glpi/vendor/league/oauth2-google/src/Provider
thenetworg/oauth2-azure version  in /var/www/glpi/vendor/thenetworg/oauth2-azure/src/Provider
league/commonmark version  in /var/www/glpi/vendor/league/commonmark/src/Extension/CommonMark
egulias/email-validator version  in /var/www/glpi/vendor/egulias/email-validator/src
symfony/mime not found
apereo/phpcas version  in /var/www/glpi/vendor/apereo/phpcas/source
bacon/bacon-qr-code version  in /var/www/glpi/vendor/bacon/bacon-qr-code/src
robthree/twofactorauth version  in /var/www/glpi/vendor/robthree/twofactorauth/lib
ralouphie/getallheaders not found
symfony/html-sanitizer version  in /var/www/glpi/vendor/symfony/html-sanitizer
league/oauth2-server version  in /var/www/glpi/vendor/league/oauth2-server/src
league/html-to-markdown version  in /var/www/glpi/vendor/league/html-to-markdown/src
twig/markdown-extra version  in /var/www/glpi/vendor/twig/markdown-extra
webonyx/graphql-php version  in /var/www/glpi/vendor/webonyx/graphql-php/src
SQL replicas
Not active
Notifications
Way of sending emails: PHP

Anything else?

I'm testing things in this version. Not urgent, since I could just change the widget type.

trasher commented 9 months ago

I did not test with nightly image, but on current main branch, I do not reproduce

trasher commented 9 months ago

Oh, I do have the error, but only on one of the graphs, not all.

[2023-12-04 06:54:35] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key 0 in /var/www/webapps/glpi/src/Dashboard/Widget.php at line 1056
  Backtrace :
  src/Dashboard/Widget.php:872                       Glpi\Dashboard\Widget::getBarsGraph()
  src/Dashboard/Widget.php:884                       Glpi\Dashboard\Widget::simpleBar()
  :                                                  Glpi\Dashboard\Widget::simpleHbar()
  src/Dashboard/Grid.php:969                         call_user_func()
  ajax/dashboard.php:194                             Glpi\Dashboard\Grid->getCardHtml()
  public/index.php:82                                require()
github-actions[bot] commented 7 months ago

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

trasher commented 6 months ago

Undefined array key 0 persists.