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

Created on 30 September 2020, almost 5 years ago
Updated 27 March 2023, over 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 over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States firewaller

    #21 works for me

  • Status changed to Needs review about 1 year 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 12 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    watchdog_exception() is deprecated and removed in D11.

  • Status changed to Needs review 11 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.

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

    Patch at #28 works for me with AWS Elasticache-Redis with Drupal 10.4.5, drupal/redis 1.9.0, and predis 2.4.0.

    (I also had to apply a patch from Support TLS for Predis ✨ Support TLS for Predis Needs review to enable this module to provide the "tls" scheme to predis and apparently I'm following @mitokens around on this.)

  • Status changed to Closed: duplicate 5 days ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    I believe this has been addressed by πŸ“Œ Abstract info-collection RedisController to deal with special environments Active , if not, feel free to reopen.

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

    I'm a little doubtful, as πŸ“Œ Abstract info-collection RedisController to deal with special environments Active is still calling config() to retrieve the value. I have been running with #28 on a project for a while now, that eliminates that completely. But maybe the condition in there is enough to prevent that from happening.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Yes, but it only calls it if the information isn't already available. stats/info/config output seems to vary wildly between different, it is very much possible that while config() might not work on Azure, info() might not work somewhere else. There also are patches here wit different approaches. if necessary we can extend the logic with a try/catch, removing it completely does not seem like a viable option.

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

    FWIW, I can't reproduce the original problem anymore. πŸ™ƒ I had this patch for a site on Platform.sh, maybe they've changed something.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    I saw that comment and was surprised, we've been using redis on platform.sh since 2015 and never needed this.

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

    Weird. I looked through my Git history, but no details. Only confirmation that it was for Platform.sh. I do see that the project is on Redis 6.0 and has been since we added Redis. That's not supported anymore, not sure what the status was when it was added.

Production build 0.71.5 2024