Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

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
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No



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:, server:, request: "PROPFIND /remote.php/webdav/ HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: ""

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

Closed by  Doug Newgard (Scimmia)
Friday, 17 February 2017, 06:01 GMT
Reason for closing:  Not a bug
Comment by Mathias Rohnstock (mrohnstock) - Wednesday, 15 February 2017, 11:08 GMT
hm, this issue doesn't occurred on the server at work with same installed versions as above. Strange ...
Comment by Aleeex87 (aleeex87) - Wednesday, 15 February 2017, 12:52 GMT
I'm experiencing the same issue as well on armv7h..
Comment by Benjamin Robin (benjarobin) - Wednesday, 15 February 2017, 21:23 GMT
In php 7.1.1 it is using /dev/urandom, but now in php 7.1.2 it is using getrandom().
The problem is that getrandom() was introduced in version 3.17 of the Linux kernel...

Related subject on forums:
Comment by Jan de Groot (JGC) - Thursday, 16 February 2017, 09:31 GMT
We support linux 4.9 and linux 4.4, so I don't see why this is a problem on our side. Yes this will screw users who use Arch inside a container or Xen system that is running an older kernel, but those users can recompile PHP on their system to get this fixed.

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.
Comment by Mathias Rohnstock (mrohnstock) - Thursday, 16 February 2017, 09:46 GMT
benjarobin made a PR so this will hopefully get fixed upstream.

See also the bugreport:

requested closure of this issue, as it is not directly related to archlinux - issue occurred on my arm board using linux 3.10.