FS#52974 - [php][owncloud] Could not gather sufficient random data (with php 7.1.2)
Attached to Project:
Arch Linux
Opened by Mathias Rohnstock (mrohnstock) - Wednesday, 15 February 2017, 09:32 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 17 February 2017, 06:01 GMT
Opened by Mathias Rohnstock (mrohnstock) - Wednesday, 15 February 2017, 09:32 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 17 February 2017, 06:01 GMT
|
Details
Description:
After updating php from 7.1.1 to 7.1.2 and restarting php-fpm and nginx the following error occurred and owncloud won't start (log from nginx's error.log): 2017/02/15 10:16:26 [error] 21589#21589: *557 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Could not gather sufficient random data in /usr/share/webapps/owncloud/lib/private/Security/SecureRandom.php:80 Stack trace: #0 /usr/share/webapps/owncloud/lib/private/Security/SecureRandom.php(80): random_int(0, 63) #1 /usr/share/webapps/owncloud/lib/private/Security/Crypto.php(94): OC\Security\SecureRandom->generate(16) #2 /usr/share/webapps/owncloud/lib/private/Session/CryptoSessionData.php(162): OC\Security\Crypto->encrypt('{"LAST_ACTIVITY...', 'yQU2DBdBseipjD7...') #3 /usr/share/webapps/owncloud/lib/private/Session/CryptoSessionData.php(66): OC\Session\CryptoSessionData->close() #4 [internal function]: OC\Session\CryptoSessionData->__destruct() #5 {main} thrown in /usr/share/webapps/owncloud/lib/private/Security/SecureRandom.php on line 80" while reading upstream, client: 217.240.103.192, server: example.com, request: "PROPFIND /remote.php/webdav/ HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "example.com" Restarting php-fpm and nginx won't help. Switching back to 7.1.1-1 solved the issue. Additional info: * php 7.1.2-1 * nginx 1.10.3-2 * owncloud 9.1.3-2 Steps to reproduce: 1. install & config owncloud and nginx 2. install php 3. profit from the error. |
This task depends upon
The problem is that getrandom() was introduced in version 3.17 of the Linux kernel...
Related subject on forums:
https://archlinuxarm.org/forum/viewtopic.php?t=11321&p=54711
https://forums.archlinux.fr/viewtopic.php?f=5&t=18917
I looked into the PHP code, the getrandom() call is hardcoded at compile time if the syscall is available on the system that compiles php. There's no runtime fallback.
https://github.com/php/php-src/pull/2385
See also the bugreport: https://bugs.php.net/bug.php?id=74105
requested closure of this issue, as it is not directly related to archlinux - issue occurred on my arm board using linux 3.10.