You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-07-28 21:15:27

eulogy
Member
Registered: 2013-10-11
Posts: 118

Error 9.5.0 new installation

Hi people, this is a new installation of GLPI in a Hosting through Softaculous, everytime I try to enter password for SMTP notifications or key for glpi-networks after submit it, server shows a blank page and in logs this error.

[2020-07-28 15:00:48] glpiphplog.CRITICAL:   *** Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /home/asistem1/public_html/lwo/inc/toolbox.class.php at line 272
  Backtrace :
  inc/toolbox.class.php:272                          sodium_crypto_aead_xchacha20poly1305_ietf_encrypt()
  inc/config.class.php:173                           Toolbox::sodiumEncrypt()
  inc/commondbtm.class.php:1433                      Config->prepareInputForUpdate()
  front/notificationmailingsetting.form.php:44       CommonDBTM->update()

PHP Sodium module is already loaded, I own another installation (several years and been upgrading through time) with same version and I can change password or load key for glpi-network and shows no error.


I tried installing a new instance of GLPI but shows the same error.

Also installed 9.5.1 for bug patching but had no luck.

Someone has had same error or any hint for solving? Thanks in advance.

Last edited by eulogy (2020-07-28 21:25:13)

Offline

#2 2020-07-28 21:38:23

WebGreg
Member
Registered: 2020-02-27
Posts: 727

Re: Error 9.5.0 new installation

What you have in /home/asistem1/public_html/lwo/inc/toolbox.class.php at line 272?


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#3 2020-07-29 00:20:27

eulogy
Member
Registered: 2013-10-11
Posts: 118

Re: Error 9.5.0 new installation

The file isn't the problem, because is the same file I have in the other GLPI instance.
I edited the next code with "(272)" for pointing to the line 272.


public static function sodiumEncrypt($content, $key = null) {
      if ($key === null) {
         $key = self::getGlpiSecKey();
      }

      $nonce = random_bytes(SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES); // NONCE = Number to be used ONCE, for each message
      $encrypted = sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
         $content,
         $nonce,
         $nonce,
(272)         $key
      );
      return base64_encode($nonce . $encrypted);
   }

   public static function sodiumDecrypt($content, $key = null) {
      if (empty($content)) {
         // Avoid sodium exception for blank content. Just return the null/empty value.
         return $content;
      }
      if ($key === null) {
         $key = self::getGlpiSecKey();
      }

Last edited by eulogy (2020-07-29 00:22:29)

Offline

#4 2020-08-14 12:11:50

carlosbmc
Member
Registered: 2016-12-01
Posts: 159

Re: Error 9.5.0 new installation

Similar problema,  any solution?


GLPI 9.5.2;; FusionInventory: 9.2+1.0;; GLPI Modifications 1.1.4;; Notifications 1.1.9;;  Dashboard 0.8.8;; PHP 7.3.33

Offline

#5 2020-09-03 16:30:16

mcguyver
Member
From: SP-Brazil
Registered: 2020-09-03
Posts: 1

Re: Error 9.5.0 new installation

I solved this problem by accessing SSH on the server console, going to the GLPI folder and using the command below:

php bin/console glpi:security:change_key

After that I answered "Yes" to the question about fields and configurations requiring migration.

Offline

#6 2020-09-11 22:55:44

anyqov
Member
Registered: 2019-04-29
Posts: 20

Re: Error 9.5.0 new installation

Hi, I have the same problem in GLPI 9.5.1. After using the command "bin/console glpi:security:change_key" I get the following:

$ sudo php /var/www/glpi/bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]yes

In toolbox.class.php line 293:

  public nonce size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes


glpi:security:change_key



How do I set it up?

Last edited by anyqov (2020-09-12 11:09:56)

Offline

#7 2020-09-29 09:57:30

Filip__
Member
Registered: 2017-02-14
Posts: 9

Re: Error 9.5.0 new installation

Hello,
Same problem here w glpi version 9.5.1. Basically same scenario as @anyqov mentioned.

Only thing I have in mind is php version, we have PHP 7.4.7 so if anybody solved this issue can u point out your PHP version please ?
Thanks and good luck to everybody smile

Offline

#8 2020-10-01 18:07:42

anyqov
Member
Registered: 2019-04-29
Posts: 20

Re: Error 9.5.0 new installation

Error: "public nonce size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES bytes".
I got this problem when I updated GLPI from 9.4.4 to 9.5.1.
Versions: PHP 7.4.10, 10.4.14-MariaDB, Centos 7.

Last edited by anyqov (2020-10-01 18:08:30)

Offline

#9 2020-10-30 00:08:55

jasonpassow
Member
Registered: 2008-08-28
Posts: 5

Re: Error 9.5.0 new installation

I have upgraded from 9.4 to 9.5.2.  This is a CentOS 7 server running PHP 7.3.   I am trying to update my ocsng configuration since it wasn't working since before glpi upgrade. When trying to create the database setup I get the following error:
Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /usr/share/glpi/inc/toolbox.class.php at line 273

Tried running
php bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]y

New security key generated; database updated.

However the error persists when trying to add the ocs server for the ocsng setup.  Anyone have any additional solutions?

Offline

#10 2020-11-02 00:51:03

ph.adam
Member
Registered: 2020-11-02
Posts: 31

Re: Error 9.5.0 new installation

Same problem here but in the OCSNG plugin serveur add. If I set a password, I get a blank page but if I set empty password, it works but of course the connection does not work. If I add a password after that the server page become empty.

I don't know how to disable sodium to try this solution.

Tryed to reinstall sodium, can't make it work (I do not know what I'm doing).


I have PHP 7.3.

Last edited by ph.adam (2020-11-02 08:12:30)

Offline

#11 2020-11-02 12:17:01

bguillerme
Member
Registered: 2020-11-02
Posts: 1

Re: Error 9.5.0 new installation

Hello,

I tried to roll-back changes mentionned for ocsserver.class.php (github.com/pluginsGLPI/ocsinventoryng/commit/5c157b1c4c2192da3bd890be0798ed32533734ee) and it works...
There is an error for crypt method but the server connection is ok..

Offline

#12 2020-11-10 12:33:53

Tadek
Member
Registered: 2017-12-15
Posts: 12

Re: Error 9.5.0 new installation

Hi,

bguillerme, I don't understand what changes you're talking about for the ocsserver.class.php file?

"github.com/pluginsGLPI/ocsinventoryng/commit/5c157b1c4c2192da3bd890be0798ed32533734ee"
It's a line which have to added?

Offline

#13 2020-11-11 18:07:05

HendriX
Member
Registered: 2020-11-11
Posts: 1

Re: Error 9.5.0 new installation

Hi Guys,

Any news about this topic, already tried :

php bin/console glpi:security:change_key
Found 2 field(s) and 3 configuration entries requiring migration.
Do you want to continue ? [Yes/no]y

New security key generated; database updated.

but still the same issue :
[2020-11-11 10:57:44] glpiphplog.CRITICAL:   *** Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /var/www/html/glpi/inc/toolbox.class.php at line 273
  Backtrace :
  inc/toolbox.class.php:273                          sodium_crypto_aead_xchacha20poly1305_ietf_encrypt()
  ...ins/ocsinventoryng/inc/ocsserver.class.php:1648 Toolbox::sodiumEncrypt()
  inc/commondbtm.class.php:1102                      PluginOcsinventoryngOcsServer->prepareInputForAdd()
  plugins/ocsinventoryng/front/ocsserver.form.php:59 CommonDBTM->add()

Offline

#14 2020-11-18 18:29:41

jasonpassow
Member
Registered: 2008-08-28
Posts: 5

Re: Error 9.5.0 new installation

Reverting to encrypt and decrypt instead of sodiumencrypt and sodiumdecrypt also worked for me.
https://github.com/pluginsGLPI/ocsinven … 32533734ee

Offline

#15 2020-11-18 22:09:28

ph.adam
Member
Registered: 2020-11-02
Posts: 31

Re: Error 9.5.0 new installation

jasonpassow wrote:

Reverting to encrypt and decrypt instead of sodiumencrypt and sodiumdecrypt also worked for me.


Thank you very much. This solution works fine. Pretty scary to update the code (even if I used to be a programmer...) and I imagine that at the next update I will have to redo the fix but it works now.

Offline

#16 2020-11-26 11:47:57

Filip__
Member
Registered: 2017-02-14
Posts: 9

Re: Error 9.5.0 new installation

Hello,
We just updated our GLPI to latest version 9.5.3 and problem with LDAP is no longer present. U can try to update and apparently latest version resolved this issue. GL all.

other info:
PHP 7.4.12 (cli)
CentOS Linux release 7.3.1611 (Core)
GLPI version 9.5.3 25/11/2020 – Archive

Offline

#17 2020-11-30 15:09:02

ph.adam
Member
Registered: 2020-11-02
Posts: 31

Re: Error 9.5.0 new installation

Hi,

Thank you for the work and the information. Personnaly, after updating to GLPI 9.5.3 and undoing the changes (replace encrypt and decrypt with sodiumEncrypt and sodiumDecrypt and update the password) I still have the error "Uncaught Exception SodiumException: secret key size should be SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES bytes in /var/www/html/glpi/inc/toolbox.class.php at line 275".

But I had warning telling me that encrypt and decrypt are deprecated.

Have a nice day

Offline

#18 2020-12-01 11:01:17

huertab33
Member
Registered: 2020-12-01
Posts: 5

Re: Error 9.5.0 new installation

Hi,
I have the same problem on GLPI 9.5 (1-2-3).
I am at OVH PHP 7.2 Libsodium OK.

I tried php bin / console glpi: security: change_key with the same error.

Has anyone solved this problem that prevents me from using this version of GLPI?

Thank you in advance


GLPI 9.5; GLPI Modifications ; PHP 7.3; OVH

Offline

#19 2021-01-21 19:17:07

isidro_dominguez
Member
Registered: 2021-01-20
Posts: 3

Re: Error 9.5.0 new installation

I have the same problem on GLPI 9.5.3, PHP 8.0.0 xampp

Has anyone solved this problem?

Thank you

Offline

#20 2021-01-21 19:45:39

isidro_dominguez
Member
Registered: 2021-01-20
Posts: 3

Re: Error 9.5.0 new installation

Hello all, I have resolved my problem.
In my case the problem came from an undefined constant: MB_OVERLOAD_STRING in 'C:\xampp\htdocs\glpi\vendor\paragonie\sodium_compat\src\Core\Util.php'

I have included the following code in line 913:
if (!defined('MB_OVERLOAD_STRING')) {
    define("MB_OVERLOAD_STRING", 2);
}

It seems that the system is confused about the definition of this constant.

Have a nice day.

Offline

Board footer

Powered by FluxBB