• Resolved strarsis

    (@strarsis)


    On a new site on production, the admin area suddenly doesn’t show up and HTTP 500 is responded instead.
    In the PHP error log for that site a Redis error is logged:

    `
    
    [...] [error] 3565169#3565169: *6619907 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught RedisException: OOM command not allowed when used memory > 'maxmemory'. in /srv/www/example.com/releases/20210329105951/web/app/plugins/wp-redis/object-cache.php:1266
    Stack trace:
    #0 /srv/www/example.com/releases/20210329105951/web/app/plugins/wp-redis/object-cache.php(1266): Redis->set('options:allopti...', 'a:558:{s:7:"sit...')
    #1 /srv/www/example.com/releases/20210329105951/web/app/plugins/wp-redis/object-cache.php(872): WP_Object_Cache->_call_redis('set', 'options:allopti...', 'a:558:{s:7:"sit...')
    #2 /srv/www/example.com/releases/20210329105951/web/app/plugins/wp-redis/object-cache.php(217): WP_Object_Cache->set('alloptions', 'a:558:{s:7:"sit...', 'options', 0)
    #3 /srv/www/example.com/releases/20210329105951/web/wp/wp-includes/option.php(457): wp_cache_set('alloptions', Array, 'options')
    #4 /srv/www/example.com/releases/20210329105951/web/app/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_OptionLock.p" while reading response header from upstream, client: [...], server: www.example.com, request: "GET /wp/wp-admin/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "www.example.com"
    2021/03/30 12:02:51 [error] 3565169#3565169: *6619916 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught RedisException: OOM command not allowed when used memory > 'maxmemory'. in /srv/www/example.com/releases/20210329105951/web/app/plugins/wp-redis/object-cache.php:1266


    `
    Apparently one reason for this error is too much memory usage of Redis or too low memory limit of Redis.

    Also, even if this error occurs, the caching plugin should rather forego caching and allow the page to be delivered.

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Hi @strarsis,

    Thanks for the report.

    There are a few exception messages for which WP Redis will attempt to gracefully restart the connection.

    For the scenario you described, I think the best behavior is still to throw the exception. The nature of the exception is severe (Redis misconfiguration) and worth getting the attention of the site administrator.

    If you’d like to modify the behavior for yourself, the wp_redis_prepare_client_connection_callback filter inside of _connect_redis() (ref) should let you do a check for your error condition.

Viewing 1 replies (of 1 total)
  • The topic ‘HTTP 500 (OOM command not allowed when used memory > ‘maxmemory’)’ is closed to new replies.