Local without memcache breaks after update

Created on 12 July 2024, 5 months ago
Updated 11 September 2024, 3 months ago

Problem/Motivation

I have a site on local for debug, when I upgrade from 8.x-2.5 to 8.x-2.6. The site breaks and keep on showing the error
Uncaught PHP Exception Drupal\memcache\MemcacheException: "No Memcache extension found"

And the following override no longer works on settings.php.

$settings['memcache']['servers'] = [];
$settings['memcache']['bins'] = [];

After I downgraded it back to 8.x-2.5, the local site works.

πŸ’¬ Support request
Status

Needs work

Version

2.7

Component

Code

Created by

πŸ‡²πŸ‡ΎMalaysia ktch_my

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

Merge Requests

Comments & Activities

  • Issue created by @ktch_my
  • First commit to issue fork.
  • πŸ‡³πŸ‡±Netherlands spokje

    The same happened for me.

    memcache_admin_post_update_add_service_definitions invalidated the container, as intended, and afterwards local/development/whatever environments with this module enabled whilst having neither Memcache nor Memcached installed fail with a 500 Uncaught PHP Exception Drupal\memcache\MemcacheException: "No Memcache extension found".

  • Merge request !32Respect empty array servers && bins settings β†’ (Merged) created by spokje
  • Pipeline finished with Success
    5 months ago
    Total: 190s
    #224538
  • Status changed to Needs review 5 months ago
  • πŸ‡³πŸ‡±Netherlands spokje

    The MR solved our use case (having drupal/memcache enabled, but neither Memcache nor Memcached installed), but is at best "iffy".

    Not even sure how this situation came to be, since it seems to be not possible to enabled this module without having either Memcache or Memcached installed (See also #3136253: Disable memcache on local or dev environments (Drupal 8) β†’ ), but here we are.

    A "proper" solution would include decent tests, probably(?) a dedicated setting and the possibility to install without having either Memcache or Memcached installed.

    But foremost, we need a blessing from the maintainer(s) if they want to support such a solution.

    Putting this on NR in the hope this will attract that attention.

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

    I had the same error one of our environments didn't have a good memecache compiled for its PHP.

    BUT the patch did not fix it, so I think it needs work still, same error

  • First commit to issue fork.
  • Pipeline finished with Skipped
    5 months ago
    #235432
  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States japerry KVUO

    Good catch. Committed!

  • πŸ‡ΊπŸ‡ΈUnited States jrglasgow Idaho

    Any chance getting a new release with this fix?

  • πŸ‡ΊπŸ‡ΈUnited States jrglasgow Idaho

    I was having the same issue and ended up tracking it down to this issue... I have a different symptom. After running composer update my `drush cr` failed with this message:

    $ drush cr

    In Container.php line 147:

    Circular reference detected for service "module_handler", path: "module_handler -> cache.bootstrap -> logger.factory -> logger.syslog -> config.factory -> config.typed".

    Failed to run drush cr: exit status 1

    the `drush updb` succeeded but had some
    [error] MemcachedDriver::set() error
    errors.

    I then put in a breakpoint where the exception was being thrown and traced it back to Memcache and reverted from 8.x-2.6 to 8.x-2.5 and the problem was resolved. Also updated to the latest dev release resolves the issue.

    I am putting the specific errors I had in here to make it easier to find when searching.

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

    Pushing for a full release of this fix. Our sites avoid dev versions as potentially unstable, and this is playing havoc with our testing pipeline and requiring significant workarounds for non-production environments.

  • πŸ‡¦πŸ‡ΊAustralia marknatividad

    I am also having a similar circular reference issue after upgrading to Drupal 10.3.1 and downgrading memcache to 2.5.0.

    After running drush cr I get the following error:

    In Container.php line 222:

    Circular reference detected for service "cache.bootstrap", path: "module_handler -> cache.bootstrap -> cache.backend.memcache -> Drupal\Component\Datetime\TimeInterface -> state -> cache.bootstrap".

  • πŸ‡¨πŸ‡¦Canada paulsheldrake

    This is still an issue on the 2.7 release

  • Status changed to Needs work 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States japerry KVUO

    Well shoot. Lets see if there are other reports and then re-escalate as a bug. I'll try to reproduce the issue, but it won't be until next week or early September though.

  • πŸ‡³πŸ‡±Netherlands spokje

    @paulsheldrake What are the symptoms of the issue on 2.7?

    Any errors showing in the log, on screen, etc?

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

    Circling back: the fix on 2.7 seems to work for me. Note that I did need to run drush updatedb which ran add_service_definitions from memcache_admin to clear an error that appeared.

  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA

    Hmmm same here. I swear this fix worked initially, but now I am seeing the same error as #18 again in 8.x-2.7.

  • πŸ‡ΊπŸ‡ΈUnited States wells Seattle, WA

    Ah, wait, I see -- in my local environment I have a config that is equivalent to:

    $settings['memcache']['servers'] = [];
    $settings['memcache']['bins'] = [];
    

    But, I did not have that in a remote test environment I was looking at. Hence the confusion. The errors goes away when those settings values are set to empty arrays.

    From the discussion it sounds like there is some history to this, but I wonder if there is any way to prevent this error without also requiring that config?

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

    I'll second this - it should fail much more gracefully than it does. When I have time, I'll see if I can work up a patch for that.

Production build 0.71.5 2024