Azure/AWS: Take into account CONFIG command may not work

Created on 30 September 2020, over 4 years ago
Updated 27 March 2023, about 2 years ago

Problem/Motivation

Trying to run on Azure, I've found that the CONFIG command is not available. Trying to open the status page will throw this (at least running Predis):

Predis\Response\ServerException: ERR unknown command `CONFIG`, with args beginning with: `get`, `maxmemory*`, inPredis\Client->onErrorResponse() (line 370 of /var/www/html/vendor/predis/

Steps to reproduce

It's actually not hard to reproduce when you have a Redis with the config under your control (e.g. with Lando). Add this line to your config file:

rename-command CONFIG ""

Then, with this config applied, visit the status page.

Proposed resolution

Catch the exception and alter the value displayed for memory accordingly.

Remaining tasks

Create patch
Review

User interface changes

The value reported for memory usage may not include a maximum value or policy (as opposed to the screen not working at all, in this situation).

API changes

None.

Data model changes

None.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands eelkeblok Netherlands πŸ‡³πŸ‡±

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France ericdsd France

    Hi patch #21 works like a charm with AWS

  • Status changed to RTBC about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States firewaller

    #21 works for me

  • Status changed to Needs review 10 months ago
  • Change patch #21

    Small fix to patch #21 that gave me this error

    Warning: Trying to access array offset on value of type bool in Drupal\redis\Controller\ReportController->overview() (line 176 of modules/contrib/redis/src/Controller/ReportController.php).

  • Status changed to Needs work 8 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    watchdog_exception() is deprecated and removed in D11.

  • Status changed to Needs review 8 months ago
  • πŸ‡«πŸ‡·France Renrhaf πŸ“ Strasbourg 🐦🦜

    Adding a patch compatible with the 1.8 version of the module, deprecating watchdog_exception when possible.

  • πŸ‡²πŸ‡¦Morocco abhou

    Having the same issue with version 1.7.0 on AWS, the patch #21 is working for me as expected.

  • πŸ‡ͺπŸ‡ΈSpain jonhattan Plasencia

    Sorry for making more noise. Here's a simplified approach that rely on INFO command instead of CONFIG.

  • πŸ‡³πŸ‡±Netherlands Summit

    patch #26 worked for me on latest version module, thanks! greetings,

  • πŸ‡­πŸ‡ΊHungary Pene

    #21 still works like a charm with AWS Redis cache. thanks!

    Client Predis
    Version 6.2.6
    Drupal 9.5.11
    Redis 8.x-1.7

  • πŸ‡¬πŸ‡§United Kingdom mark-mackenzie-nexus

    Please can the patch at comment #28 please be added to a production release. It is necessary to allow the module to work with Azure Cache for Redis. Tested successfully from Azure App Service with Drupal 10.3.

  • πŸ‡ΊπŸ‡ΈUnited States mitokens

    Thanks for the fix. I can confirm the patch at #28 works for me in an Azure hosted environment with Drupal `v10.4.5` using Redis `v1.9.0` and Predis `v1.1.10`. I would be very interested in seeing it merged so I don't have to manually track this issue anymore.

Production build 0.71.5 2024