Closed viktor-sc closed 4 years ago
Hi,
Are you sure exention is not loaded in a CLI context ?
Which result do you have if you run php -r "echo((extension_loaded('sodium')?'yes':'no').\"\n\");"
?
Regards
Hi. Thanks for the quick reply. The result is 'yes'. So it's a system configuration issue?
`PHP 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
This means you use a outdated libsodium, this constant has been added for years. You need to update it.
Thanks, that was my issue and I understand my libsodium is outdated. That's what I describe in the description. Unfortunately I can't update libsodium as it's a closed system.
The result is 'yes'. So it's a system configuration issue?
Did not see this. Yes, it's a php-cli configuration issue on server.
For all interested in the solution for a Synology NAS. /usr/local/bin/php73 does not read the PHP settings from the web station. But this does:
PHP_INI_SCAN_DIR="/usr/syno/etc/packages/WebStation/php_profile/
Describe the bug
On a system that uses an outdate libsodium with the sodium extension disabled in PHP, it seems still to be used when running cron.php when there are emails in the queue to send. This leads to an error and the queuednotification task is in 'running' state forever:
`PHP 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: 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 PHP Warning: mb_substr() expects parameter 3 to be int, string given 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 PHP 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`
To reproduce
Steps to reproduce the behavior:
Expected behavior
Running the queuednotification task from the UI (setup > automatic actions > queuednotification > Execute) and running it from cron should behave equally.
Logs
Your GLPI setup (you can find it in Setup > General menu, System tab)