jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Sync: Fatal errors on some server configurations

Open jeherve opened this issue 10 years ago • 2 comments

Fatal error: Uncaught exception ‘Exception’ with message ‘There is no suitable CSPRNG installed on your system’ in /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-includes/random_compat/random.php:205
Stack trace: 
#0 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-includes/random_compat/random_int.php(153): random_bytes()
#1 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-content/plugins/jetpack/sync/class.jetpack-sync-queue.php(41): random_int()
#2 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-content/plugins/jetpack/sync/class.jetpack-sync-listener.php(205): Jetpack_Sync_Queue->__construct(3)
#3 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-content/plugins/jetpack/sync/class.jetpack-sync-listener.php(32): Jetpack_Sync_Listener->set_defaults(1, 1000000)
#4 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-content/plugins/jetpack/sync/class.jetpack-sync-listener.php(24): Jetpack_Sync_Listener->__construct(‘sync’)
#5 /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-content/plugins/jetpack/sync/ in /home/users/1/lolipop.jp-dp40254578/web/yagihiro/wp-includes/random_compat/random.php on line 205』

I'm not sure why Core's random_int is not picked up on those servers: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/random_compat/random_int.php

Could it be because of the lack of random_bytes?

Reported here:

  • https://wordpress.org/support/topic/blank-dashboard-setting-page-after-upgrade-to-4-3/#post-8149626
  • https://wordpress.org/support/topic/this-morning-in-the-update-of-jetpack-the-management-screen-no-longer-appear-2/
  • https://wordpress.org/support/topic/updated-jetpack-fatal-error-whole-website-broken/

jeherve avatar Sep 07 '16 09:09 jeherve

cc @ebinnion since it seems the error was introduced in #4878

jeherve avatar Sep 07 '16 09:09 jeherve

Yes, I'd say it's because random_bytes is throwing an exception:

If none of the aforementioned sources are available, then an Exception will be thrown. 

A good way to handle that would be to catch that exception and figure something else out.

zinigor avatar Sep 07 '16 10:09 zinigor