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.18k stars 1.28k forks source link

Unable to enter GLPI subscription key #15203

Open buggzbeny opened 1 year ago

buggzbeny commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Version

GLPI 10.0.6

Bug description

Hello,

I try to put GLPI network licence key page refresh after save and key is not saved. No error message.

Relevant log output

No response

Page URL

No response

Steps To reproduce

Put GLPI network licence Key

Your GLPI setup information

Operating system: Linux GLPI-EANNA 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 PHP 7.4.33 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apc, 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, readline, session, shmop, sockets, sodium, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, 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/2.4.56 (Debian) (Apache/2.4.56 (Debian) Server at glpi-crna.synology.me Port 80 ) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67 Server Software: Debian 11 Server Version: 10.5.19-MariaDB-0+deb11u2 Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: glpiuser@localhost/glpidb 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, json, simplexml.Following extensions are installed: dom, fileinfo, json, simplexml. curl extension is installed.curl extension is installed. gd extension is installed.gd extension is installed. intl extension is installed.intl extension is installed. libxml extension is installed.libxml 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.19) is supported.Database engine version (10.5.19) 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 /opt/fichiers_glpi/_cache has been validated. Write access to /etc/glpi/ has been validated. Write access to /opt/fichiers_glpi/_cron has been validated. Write access to /opt/fichiers_glpi has been validated. Write access to /opt/fichiers_glpi/_dumps has been validated. Write access to /opt/fichiers_glpi/_graphs has been validated. Write access to /opt/fichiers_glpi/_lock has been validated. Write access to /opt/fichiers_glpi/_pictures has been validated. Write access to /opt/fichiers_glpi/_plugins has been validated. Write access to /opt/fichiers_glpi/_rss has been validated. Write access to /opt/fichiers_glpi/_sessions has been validated. Write access to /opt/fichiers_glpi/_tmp has been validated. Write access to /opt/fichiers_glpi/_uploads has been validated.Write access to /opt/fichiers_glpi/_cache has been validated. Write access to /etc/glpi/ has been validated. Write access to /opt/fichiers_glpi/_cron has been validated. Write access to /opt/fichiers_glpi has been validated. Write access to /opt/fichiers_glpi/_dumps has been validated. Write access to /opt/fichiers_glpi/_graphs has been validated. Write access to /opt/fichiers_glpi/_lock has been validated. Write access to /opt/fichiers_glpi/_pictures has been validated. Write access to /opt/fichiers_glpi/_plugins has been validated. Write access to /opt/fichiers_glpi/_rss has been validated. Write access to /opt/fichiers_glpi/_sessions has been validated. Write access to /opt/fichiers_glpi/_tmp has been validated. Write access to /opt/fichiers_glpi/_uploads has been validated. GLPI data directories are located in a secured path.GLPI data directories are located in a secured path. Sessions configuration is secured.Sessions configuration is secured. exif extension is installed.exif extension is installed. ldap extension is installed.ldap extension is installed. openssl extension is installed.openssl extension is installed. zip extension is installed.zip extension is installed. bz2 extension is installed.bz2 extension is installed. 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 /opt/glpi/marketplace has been validated.Write access to /opt/glpi/marketplace has been validated. Timezones seems loaded in database.Timezones seems loaded in database.

Anything else?

No response

trasher commented 1 year ago

10.0.6 is outdated, consider upgrading.

buggzbeny commented 1 year ago

Bad experience with 10.0.7 and 10.0.8 so i keep the one whitch works with document added on timeline tickets. Other glpi user has the same problem with 10.0.8

trasher commented 1 year ago

We won't investigate on an issue that may be fixed. Feel free to reopen if you reproduce with latest version.

Community support is on a best effort basis, debuging 3 versions late is not possible.

cedric-anne commented 1 year ago

The only way I am able to reproduce this behaviour is when I voluntarly remove the config/glpicrypt.key file from my filesystem. I get the following error in GLPI logs:

glpiphplog.WARNING:   *** PHP User Warning (512): You must create a security key, see security:change_key command. in /var/www/glpi/src/GLPIKey.php at line 129
  Backtrace :
  src/GLPIKey.php:129                                trigger_error()
  src/GLPIKey.php:367                                GLPIKey->get()
  src/Config.php:2998                                GLPIKey->encrypt()
  src/Config.php:298                                 Config::setConfigurationValues()
  src/CommonDBTM.php:1589                            Config->prepareInputForUpdate()
  front/config.form.php:65                           CommonDBTM->update()
  public/index.php:82                                require()

Anyway, this is not supposed to be a normal behaviour. If file is missing or cannot be created during install/migration, an error is shown to user and tells him to run the bin/console security:change_key command to generate it manually.

Do you have a config/glpicrypt.key file?

buggzbeny commented 1 year ago

yes i have glpicrypt.key file in config directory but i have same message your show in my php-errors.log

[2023-07-12 15:04:17] glpiphplog.WARNING: *** PHP User Warning (512): You must create a security key, see security:change_key command. in /opt/glpi/src/GLPIKey.php at line 125 Backtrace : src/GLPIKey.php:125 trigger_error() src/GLPIKey.php:363 GLPIKey->get() src/Config.php:2911 GLPIKey->encrypt() src/Config.php:299 Config::setConfigurationValues() src/CommonDBTM.php:1595 Config->prepareInputForUpdate() front/config.form.php:65 CommonDBTM->update()

buggzbeny commented 1 year ago

My bad !

config dir for glpi was migrated on other directory than /glpi/config after update from 9.4.6 to 10.0.6 with local_define.php but when i move the files i move config directory into new location so .key file was /newdir/glpi/config/glpicrypt.key or in local_define config dir is /newdir/glpi/. i move .key file to /newdir/glpi/ and now registration works.

thanks @cedric-anne to put me on right way to resolve this.

cedric-anne commented 1 year ago

There is probably something that can be enhanced here. For instance, something should probably be shown on UI, even before trying to save the form.

buggzbeny commented 1 year ago

yes, just an error displayed with a popup information should help to fix the problem quickly without asking here.