[SOLVED] Apcu Caching gives Error

Nextcloud version (eg, 10.0.2): 11.0.1
Operating system and version (eg, Ubuntu 16.04): Debian 9
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.10
PHP version (eg, 5.6):7.0 from dotdeb
Is this the first time you’ve seen this error?: Yes , new installation

Can you reliably replicate it? (If so, please outline steps)

In config.php include:
‘memcache.local’ => ‘\OC\Memcache\APCu’,

The issue you are facing:
Every page gives
Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?

The output of your Nextcloud log in Admin > Logging: not available, nextcloud.log contains
{“reqId”:“gXTrIt08g+Bqg8/OShOy”,“remoteAddr”:“84.44.248.73”,“app”:“PHP”,“message”:“OC\HintException: Memcache \OC\Memcache\APCu not available for local cache at /var/www/nextcloud/lib/private/Memcache/Factory.php#96”,“level”:3,“time”:“2017-02-25T20:47:58+00:00”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“user”:"–",“version”:“11.0.1.2”}
{“reqId”:“TbXolNjSU7APCTEXiIzu”,“remoteAddr”:“84.44.248.73”,“app”:“core”,“message”:“Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?”,“level”:3,“time”:“2017-02-25T20:48:00+00:00”,“method”:“GET”,“url”:"/index.php/settings/admin",“user”:"–",“version”:“11.0.1.2”}
{“reqId”:“TbXolNjSU7APCTEXiIzu”,“remoteAddr”:“84.44.248.73”,“app”:“core”,“message”:“Exception: {“Exception”:“OC\\HintException”,“Message”:“Memcache \\OC\\Memcache\\APCu not available for local cache”,“Code”:0,“Trace”:”#0 \/var\/www\/nextcloud\/lib\/private\/Server.php(383): OC\\Memcache\\Factory->__construct(‘f6d507bd295969a…’, Object(OC\\Log), ‘\\\\OC\\\\Memcache\\\\AP…’, ‘\\\\OC\\\\Memcache\\\\AP…’, NULL)\n#1 \/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#2 \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(115): Pimple\\Container->offsetGet(‘MemCacheFactory’)\n#3 \/var\/www\/nextcloud\/lib\/private\/ServerContainer.php(89): OC\\AppFramework\\Utility\\SimpleContainer->query(‘MemCacheFactory’)\n#4 \/var\/www\/nextcloud\/lib\/private\/Server.php(1097): OC\\ServerContainer->query(‘MemCacheFactory’)\n#5 \/var\/www\/nextcloud\/lib\/private\/Server.php(343): OC\\Server->getMemCacheFactory()\n#6 \/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#7 \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(115): Pimple\\Container->offsetGet(‘URLGenerator’)\n#8 \/var\/www\/nextcloud\/lib\/private\/ServerContainer.php(89): OC\\AppFramework\\Utility\\SimpleContainer->query(‘URLGenerator’)\n#9 \/var\/www\/nextcloud\/lib\/private\/Server.php(1063): OC\\ServerContainer->query(‘URLGenerator’)\n#10 \/var\/www\/nextcloud\/lib\/private\/legacy\/template\/functions.php(170): OC\\Server->getURLGenerator()\n#11 \/var\/www\/nextcloud\/core\/templates\/layout.guest.php(13): image_path(’’, ‘favicon.ico’)\n#12 \/var\/www\/nextcloud\/lib\/private\/Template\/Base.php(174): include(’\/var\/www\/nextcl…’)\n#13 \/var\/www\/nextcloud\/lib\/private\/Template\/Base.php(149): OC\\Template\\Base->load(’\/var\/www\/nextcl…’, NULL)\n#14 \/var\/www\/nextcloud\/lib\/private\/legacy\/template.php(229): OC\\Template\\Base->fetchPage(NULL)\n#15 \/var\/www\/nextcloud\/lib\/private\/legacy\/template.php(251): OC_Template->fetchPage()\n#16 \/var\/www\/nextcloud\/lib\/private\/Template\/Base.php(130): OC_Template->fetchPage()\n#17 \/var\/www\/nextcloud\/lib\/private\/legacy\/template.php(331): OC\\Template\\Base->printPage()\n#18 \/var\/www\/nextcloud\/index.php(50): OC_Template::printErrorPage(‘Memcache \\\\OC\\\\Me…’, ‘Is the matching…’)\n#19 {main}",“File”:"\/var\/www\/nextcloud\/lib\/private\/Memcache\/Factory.php",“Line”:96}",“level”:3,“time”:“2017-02-25T20:48:00+00:00”,“method”:“GET”,“url”:"/index.php/setti

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php $CONFIG = array ( 'datadirectory' => '/var/www/data-nextcloud', 'overwrite.cli.url' => 'http://localhost', 'dbtype' => 'pgsql', 'version' => '11.0.1.2', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbpassword' => 'WMfMQwrjw39JRiulbzdB', 'logtimezone' => 'UTC', 'installed' => true, 'memcache.local' => '\OC\Memcache\APCu', ); The output of your Apache/nginx/system log in `/var/log/____`: None --- I used the Ideas here https://help.nextcloud.com/t/caching-has-potentially-stopped-working-since-9-0-52-10-0-0-0-upgrade/2826/23 but without success. Thanks a lot for listening and any ideas. Norbert

Can you check in phpinfo() if apcu was enabled?
Does Debian 9 not support php7 out of the box (because you are using the dotdeb packages)?

I forgot to restart the webserver.

This was my problem. The php extension was not active.

I had to go to php.ini and add extension=apcu.so
Restart php and web server.

apcu have been replaced in several ways on linux and is deprecated, apc the replacement seems that can run without memcached.service, so warning can keep appear because the old apcu with memcached.service is not running, I guess, what we need is set redis memcache as local cache.

‘filelocking.enabled’ => ‘true’,
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘password’ => ‘44741f88c76750e30048e4c04a2c78cfd6ae6b2105d89456ad7bda1741815c28’,
‘port’ => 0,
‘dbindex’ => 0,
‘timeout’ => 1.5,
),

3 Likes

I get this error updating Nextcloud to version 21.0.3 and this solved the issue.
Thank you, @Sergio_Basto !

where should this be changed? In what file?

@rollanders
@Sergio_Basto
I am having the same issue after upgrading to 21.03 and receiving the below error message:

  • The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
    • Missing index “fs_size” in table “oc_filecache”.

Can you please tell us where you edited the above for the ‘memcache.local’ and are all those settings needed? Rollanders did you find another fix for this?

Thank you!

nearly this was the solution for me on Synology diskstation, but in fact, I was successful after inserting extension=apcu.so into my phpMyAdmin.ini

Thanks