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-08 20:59:12

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Sodium Error in Marketplace and Notifications

Hi,
In version 9.5.0, trying to open to open the Marketplace or to send a test-notification, both end up in an error. It's related to Sodium. Sodium is activated on my PHP 7.3. When disabling Sodium, the test-notification ends up with a blank page after clicking "Send a test email to the administrator".

I use a synology web station as a webserver with Apache HTTP Server 2.4 and PHP 7.3 configured.

The error message is for both cases:
Warning: Use of undefined constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES - assumed 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES' (this will throw an Error in a future version of PHP) in /volume1/web/glpi/inc/toolbox.class.php on line 287 Warning: mb_substr() expects parameter 3 to be int, string given in /volume1/web/glpi/inc/toolbox.class.php on line 287 Warning: Use of undefined constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES - assumed 'SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES' (this will throw an Error in a future version of PHP) in /volume1/web/glpi/inc/toolbox.class.php on line 288 Warning: mb_substr() expects parameter 2 to be int, string given in /volume1/web/glpi/inc/toolbox.class.php on line 288


I opened a but in github, but it was closed with this note:
That constants has been added on the lib years ago; your libsodium seems outdated; please consider updating it.


Now, to be honest, I don't know how I could update libsodium.
Does anybody else have the same problem or a hint for me?
As Sodium seems to be something related to authentication and/or encryption, is there a way to use the old method probably?


Thanks,
Viktor

Last edited by viktor_sc (2020-07-08 21:01:10)

Offline

#2 2020-07-08 21:18:17

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Re: Sodium Error in Marketplace and Notifications

I think I found a workaround smile
Disabled Sodium in the PHP settings. Inserted the password in the notification settings again and now both, the notifications and the marketplace work again.

Last edited by viktor_sc (2020-07-08 21:25:54)

Offline

#3 2020-07-09 08:36:41

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Re: Sodium Error in Marketplace and Notifications

EDIT: But the cron.php, that I run with CLI, still throws the same error sad
EDIT2: After clearing the cache also the cron.php seems to work smile

Last edited by viktor_sc (2020-07-09 09:26:35)

Offline

#4 2020-07-18 08:24:16

eric000
Member
Registered: 2020-07-18
Posts: 5

Re: Sodium Error in Marketplace and Notifications

Hi,
I have the same problem with my Synology web server since update from 9.4 to 9.5.1.
Same error message with Sodium lib
The workaround in this thread did not help. If I disable Sodium.

Witch cache did you clean ?

Offline

#5 2020-07-18 08:50:42

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Re: Sodium Error in Marketplace and Notifications

eric000 wrote:

Witch cache did you clean ?

Hi,

I deleted all the files in /files/_cache/. Also all the files in the subfolders (cache_db, cache_trans), but not the subfolders itself.

Cheers

Offline

#6 2020-07-18 09:43:49

eric000
Member
Registered: 2020-07-18
Posts: 5

Re: Sodium Error in Marketplace and Notifications

Thanks for your reply, but it didn't help for me.
If the Sodium Extension is activateted in Web Station, I can not access the marketplace with the same error as you.
If I disable Sodium, it's OK for marketplace, but the cron raise errors for mailcollector (Same Sodium error as you)

Did you use the DSM task manager for lunch the GLPI cron ? If yes, witch command did you use ?

Offline

#7 2020-07-19 09:50:22

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Re: Sodium Error in Marketplace and Notifications

I have the sodium extension disabled in the web station. And actually the first 3 runs of the cron also gave me different errors. But then they disappeared.
Yes I run the cron from the DSM task manager with this command:
/usr/local/bin/php73 /volume1/web/glpi/front/cron.php

Offline

#8 2020-07-29 15:59:30

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

Re: Sodium Error in Marketplace and Notifications

I'm facing the same problem in a hosting with cPanel Softaculous installation, no way introducing key for Marketplace or SMTP password for notifications, has anyone solved this?

Offline

#9 2020-07-29 18:31:08

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

Re: Sodium Error in Marketplace and Notifications

You're all have set
const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32;
?

For me in /var/html/glpi/vendor/paragonie/soidum_compat/lib/php72compat_const.php

Last edited by WebGreg (2020-07-29 18:33:58)


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

Offline

#10 2020-08-03 12:08:49

eric000
Member
Registered: 2020-07-18
Posts: 5

Re: Sodium Error in Marketplace and Notifications

Yes ! It is set as this for me. But no change... sad

WebGreg wrote:

You're all have set
const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32;
?

For me in /var/html/glpi/vendor/paragonie/soidum_compat/lib/php72compat_const.php

Offline

#11 2020-08-03 15:54:15

ON-Serv
Member
Registered: 2020-08-03
Posts: 6

Re: Sodium Error in Marketplace and Notifications

Hi,
I think we have something quite related to that : Issue n°7822 in GLPI github (can't post link here)
But if we disable the sodium extention we have another php error : Uncaught Exception SodiumException: Key must be CRYPTO_AEAD_XCHACHA20POLY1305_KEYBYTES long in /home/sc3semadmin/public_html/serviceit/vendor/paragonie/sodium_compat/src/Compat.php at line 897

Offline

#12 2020-08-04 12:01:21

ON-Serv
Member
Registered: 2020-08-03
Posts: 6

Re: Sodium Error in Marketplace and Notifications

I have update to 9.5.1 and regenerate the security key (php bin/console glpi:security:change_key)  because the update don't do it because of a weird error : now it's all good.
So maybe you can try to regenerate the key.

Offline

#13 2020-08-17 10:55:21

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

Re: Sodium Error in Marketplace and Notifications

ON-Serv wrote:

I have update to 9.5.1 and regenerate the security key (php bin/console glpi:security:change_key)  because the update don't do it because of a weird error : now it's all good.
So maybe you can try to regenerate the key.

I can't regenerate the security key,  after do "php bin/console glpi:security:change_key" I have : 

PHP Parse error:  syntax error, unexpected '(' in /glpi/inc/based_config.php on line 150 )

Same error when executing chron.php

Last edited by carlosbmc (2020-08-17 11:02:03)


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

#14 2020-08-17 11:45:54

singhharry12
Member
Registered: 2020-08-17
Posts: 1

Re: Sodium Error in Marketplace and Notifications

eric000 wrote:

Hi,
I have the same problem with my Synology web server since update from 9.4 to 9.5.1.
Same error message with Sodium lib
The workaround in this thread did not help. If I disable Sodium.

Witch cache did you clean ?

Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.

Offline

#15 2020-08-17 11:47:04

viktor_sc
Member
Registered: 2018-06-26
Posts: 24

Re: Sodium Error in Marketplace and Notifications

Did you guys try to disable the sodium extension in your PHP settings?

Offline

#16 2020-08-17 12:46:42

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

Re: Sodium Error in Marketplace and Notifications

carlosbmc wrote:
ON-Serv wrote:

I have update to 9.5.1 and regenerate the security key (php bin/console glpi:security:change_key)  because the update don't do it because of a weird error : now it's all good.
So maybe you can try to regenerate the key.

I can't regenerate the security key,  after do "php bin/console glpi:security:change_key" I have : 

PHP Parse error:  syntax error, unexpected '(' in /glpi/inc/based_config.php on line 150 )

Same error when executing chron.php


Executing chron with    7.2 php version works fine but not when executing php bin/console glpi:security:change_key  see image

https://imgur.com/a/fLW6JBk


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

#17 2020-12-01 10:53:25

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

Re: Sodium Error in Marketplace and Notifications

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 as carlosbmc.

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

#18 2021-03-15 21:41:26

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,146

Re: Sodium Error in Marketplace and Notifications

Hi,
same problem when attempting upgrade 9.4.6->9.5.4  OVH Hosted :(php7.3)
PHP Warning (2): Use of undefined constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES - assumed



then can't set Marketplace Key ( blank page) so I'm stucked with glpi 9.4.6 on this instance.


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

Board footer

Powered by FluxBB