You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
21.0.3 OC\HintException: Memcache \OC\Memcache\APCu not available #27781
After the upgrade on my machine there is a condition not appearing in any NC version before:
$ sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
An unhandled exception has been thrown:
OC\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
No logging entry found. This makes the NC cron job unavailable apparently.
No such issue in any version before 21.0.3. All settings in place.
Hello, I had the same problem. For me the solution was apc.enable_cli = 1 in php.ini !!!
Reacted by Roman Feldbauer, Samuel, flacks, Sebastian Lövdahl, Markus Ueberall, CptSlow2000, Guss, Patrick, Deelight-fr, Paulo Coghi and 90 more
Reacted by Paulo Coghi, Martin Eisenhardt, AlienKnight, Michał Piotrowski, Danir Toma, mgostick, Dimitrios Vergados, blackcrack, Laszlo Lang and waverider
Reacted by Paulo Coghi, Martin Eisenhardt, AlienKnight, Éloi Rivard, Rolle Laukkarinen, mgostick, Francis Augusto Medeiros-Logeay, silverdr, Dimitrios Vergados, michaeledi and 10 more
Reacted by Simon Tushev, mgostick, blackcrack, Mike Endsley and waverider
In general the update to 21.0.3 went wrong. I had to go for manual install, then, blocked in maintenance mode, then repaired manually and now still strugling with a invalid_hash for core/js/mimetypelist.js.
I should have wait for this upgrade : my install is more or less broken.
I hope next version will fix these install issues.
Reacted by André Weiler, Dadang NH, C Diego, Martin Eisenhardt, Abdelaziz Elrashed, Chris, neerro and Ty Sayahi
I can confirm after upgrading from 21.0.2 to 21.0.3 the cronjob does not seem to run anymore, without showing an error.
Enabling apc.enable_cli = 1 fixes the issue.
Reacted by André Weiler, trvrcr, Dimitris Maroulidis, CptSlow2000, Shadow2091, Chris Appleyard, Sanjaya Sandaruwan, Paulo Coghi, C Diego, Rodrigo Borges and 19 more
Aha, you provided a more complete solution in this report already. thanks again.
This fix solves the issue on my machine and the NC cron job is available again.
However, there should be a more general fix provided by the NC devs hopefully.
Please note on my machine there was not any upgrade or change to the PHP 7.3.27 installation or the settings provided. This configuration allowed all Nextcloud versions before 21.0.3 running without the a.m. issue.
This points at NC 21.0.3 and some PHP code issue, I presume. Your mileage may vary.
Yes, I also received this error with the update from 21.0.2 to 21.0.3. I haven't changed anything on my system. I have noticed for a long time that the developers no longer have their Nextcloud project under control, errors creep in again and again that somehow nobody notices and as soon as the version is published these errors appear.
Reacted by TP75, Benjamin Danon, Dakota Gravitt and Chris
The admin manual has been changed to reflect this change of design only recently, I presume. This seems to be an intentional change to the PHP coding in NC 22 and obviously was backported to NC 21.0.3 without any notice to the community. Please prove me wrong, but this is my picture after reading the below reports which are one month old.
If this is the case, this apparent negligence and way of change from Nextcloud would be especially hurting to community people like me who were running a stable NC environment for years.
Reacted by André Weiler, sebaxakerhtc, Daniel Scharon, haarp, snowflakeas, MaxXor, jobenvil, sokai, Matthias Luh and Chris
I look through the documentation at regular intervals. Maybe I missed the apc.enable_cli = 1 change. But really now within a smaller release. Activate something like that and the user looks like a dork.
Reacted by MarcelRei, Timothy Harding, TP75, Maximilian Stinsky, Gitsaibot, Nicolas Martignoni, battosai30, snowflakeas, Chris and babyNEKO
Got the same issue after upgraded to 21.0.3 days ago, just solved by increase apc.shm_size in php setting to 64M from default 32M. By adding apc.enable_cli=1 only not work for me.
Thanks for the help!
By the way: Are we supposed to read the whole documentation for every update? And maybe I'm too old for this, but I find it quite annoying that I need to update every 4 months 😢 (including all the problems that come with it, i.e. it just took me two days because I broke my database because of a required database update, needed to update and adjust several things and so on).
I hope this agile nightly-built banana product mentality from nowadays changes back towards a "release one product a year that actually works" mentality. It would save millions of people billions of hours of their life. I feel like I spend 20% of my work and leisure time updating and then fixing software again...
@AndyXheli thank you for your quick reply!
In this file you mentioned (/etc/php/7.4/mods-available/apcu.ini) there is only one line:
extension=apcu.so
Is this correct?
I just added your line (apc.enable_cli=1).
Thank you! Now the command "sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices" worked!
EDIT: Now my cron seems to work, too.
For anyone who tried all these fixes but still had it fail, I was able to fix it by installing php-redis . Some other thread seemed to indicate apcu was being phased out, so I tried: sudo apt install php-redis . After that, all worked!
Hi Everyone,
I have tried with the same issue all of the above. Added the apc.enable_cli=1 basically in every php.ini and apcu.ini, apcu_bc.ini that I could find. Still nothing...
Then I realised the issue on my instance --> I have php version 7.4, 8.0 and 8.1 installed, so I had to specify in the OCC commands and with that in my crontab setup which version to use. So instead of ....php occ...., now I have ....php7.4 occ....
(note: it was originally installed years ago, so I had to check under /etc/php/ all 3 versions to see which one contained the apache2 folder to figure out for me it was 7.4)
My best advice: Migrate Nextcloud to the official Docker Image and configure unattended updates. A blessing, not having to manage dependencies anymore..
Using a Synology DS too and found a possible solution for @snowflakes: Add a "user_settings.ini" in "/usr/local/etc/php74/cli/conf.d" with the following content: "extension = apcu.so [apc] apc.shm_size = 64M apc.enable_cli = 1" Works fine for me. Found this solution in the synology forum (https://www.synology-forum.de/threads/nextcloudhub-21-0-1-und-cron.114219/page-2). Best regards
Using also a synology NAS but with PHP8.0. Add a new nextcloud.ini in usr/local/etc/php80/cli/conf.d did NOT work for me, even after a restart. I had to add extension = apcu.so into the already existing /usr/local/etc/php80/cli/conf.d.extension.ini
Activity
andrewheeler82 commentedon Jul 3, 2021
Hello, I had the same problem. For me the solution was apc.enable_cli = 1 in php.ini !!!
HuguesDug commentedon Jul 3, 2021
Same problem: I had to switch memcache to redis instead of APcu
Raspbian, nextcloud 21.0.2 --> 21.0.3, PHP 7.3, Nginx
In general the update to 21.0.3 went wrong. I had to go for manual install, then, blocked in maintenance mode, then repaired manually and now still strugling with a invalid_hash for core/js/mimetypelist.js.
I should have wait for this upgrade : my install is more or less broken.
I hope next version will fix these install issues.
mstinsky commentedon Jul 3, 2021
I can confirm after upgrading from 21.0.2 to 21.0.3 the cronjob does not seem to run anymore, without showing an error.
Enabling
apc.enable_cli = 1fixes the issue.BernieO commentedon Jul 3, 2021
As a workaround you can use the parameter
--define apc.enable_cli=1to tell PHP to run cli commands with APCu enabled.Example:
Also, adding
--define apc.enable_cli=1to the according crontab line, the cronjob will get executed again.TP75 commentedon Jul 3, 2021
Aha, you provided a more complete solution in this report already. thanks again.
This fix solves the issue on my machine and the NC cron job is available again.
However, there should be a more general fix provided by the NC devs hopefully.
Please note on my machine there was not any upgrade or change to the PHP 7.3.27 installation or the settings provided. This configuration allowed all Nextcloud versions before 21.0.3 running without the a.m. issue.
This points at NC 21.0.3 and some PHP code issue, I presume. Your mileage may vary.
andrewheeler82 commentedon Jul 3, 2021
Yes, I also received this error with the update from 21.0.2 to 21.0.3. I haven't changed anything on my system. I have noticed for a long time that the developers no longer have their Nextcloud project under control, errors creep in again and again that somehow nobody notices and as soon as the version is published these errors appear.
AndyXheli commentedon Jul 4, 2021
I don't think this is a bug just meed to add apc.enable_cli=1 to /etc/php/8.0/mods-available/apcu.ini
#25770
TP75 commentedon Jul 4, 2021
Thanks @andrewheeler82 and I sadly consent.
Apparently, the new Nextcloud policy is taking from big business now: "It's not a bug it's a feature."
https://docs.nextcloud.com/server/21/admin_manual/configuration_server/caching_configuration.html#id1
The admin manual has been changed to reflect this change of design only recently, I presume. This seems to be an intentional change to the PHP coding in NC 22 and obviously was backported to NC 21.0.3 without any notice to the community. Please prove me wrong, but this is my picture after reading the below reports which are one month old.
If this is the case, this apparent negligence and way of change from Nextcloud would be especially hurting to community people like me who were running a stable NC environment for years.
BernieO commentedon Jul 4, 2021
Actually, the recommendation to set
apc.enable_clito1in thephp.iniconfig file has been added in Dec 2018 and was backported to the documentation of NC13:nextcloud/documentation@c5fa1b6#diff-48dc187eeb03371b5ad6886b33043bf060884809c1d51a3568c5d29e40e3bf13
https://docs.nextcloud.com/server/13/admin_manual/configuration_server/caching_configuration.html#id1
Additionally the notice about appending
--define apc.enable_cli=1to the cron job call was added in June 2020 and backported to the documentation of NC17:nextcloud/documentation@38a0a33#diff-48dc187eeb03371b5ad6886b33043bf060884809c1d51a3568c5d29e40e3bf13
https://docs.nextcloud.com/server/17/admin_manual/configuration_server/caching_configuration.html#id1
andrewheeler82 commentedon Jul 4, 2021
I look through the documentation at regular intervals. Maybe I missed the apc.enable_cli = 1 change. But really now within a smaller release. Activate something like that and the user looks like a dork.
hardingt commentedon Jul 5, 2021
Also got bit by this one after upgrading from 20.0.2 to 20.0.3. Adding apc.enable_cli=1 to /etc/php/8.0/mods-available/apcu.ini worked for me as well.
zaku903 commentedon Jul 8, 2021
Got the same issue after upgraded to 21.0.3 days ago, just solved by increase apc.shm_size in php setting to 64M from default 32M. By adding apc.enable_cli=1 only not work for me.
userofgithub023897 commentedon Jul 11, 2021
@zaku903 Thank you very much!!!
This fixed it!
Cron and occ work fine again.
31 remaining items
matzl commentedon Dec 30, 2021
Thanks for the help!
By the way: Are we supposed to read the whole documentation for every update? And maybe I'm too old for this, but I find it quite annoying that I need to update every 4 months 😢 (including all the problems that come with it, i.e. it just took me two days because I broke my database because of a required database update, needed to update and adjust several things and so on).
I hope this agile nightly-built banana product mentality from nowadays changes back towards a "release one product a year that actually works" mentality. It would save millions of people billions of hours of their life. I feel like I spend 20% of my work and leisure time updating and then fixing software again...
thepate94227 commentedon Feb 17, 2022
I tried your command, but i still get the error :
Do someone know why? In my /var/www/nextcloud/config/config.php file there is the line "'memcache.local' => '\OC\Memcache\APCu',"
And how can i add the
--define apc.enable_cli=1to the according crontab line?My currently version is 22.2.5, but with 22.2.4 i also had this problem. Before this version, i didn't have any errors.
AndyXheli commentedon Feb 17, 2022
@thepate94227
Do you have this apc.enable_cli=1 added to you apcu.ini file ?
Should be located in /etc/php/8.0/mods-available/ or /etc/php/7.4/mods-available/
Its recommended to have that for mem chacing makes nc running better.
'memcache.local' => '\OC\Memcache\APCu',
thepate94227 commentedon Feb 17, 2022
@AndyXheli thank you for your quick reply!
In this file you mentioned (/etc/php/7.4/mods-available/apcu.ini) there is only one line:
extension=apcu.so
Is this correct?
I just added your line (apc.enable_cli=1).
Thank you! Now the command "sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices" worked!
EDIT: Now my cron seems to work, too.
AndyXheli commentedon Feb 17, 2022
@thepate94227 You're very welcome!
thepate94227 commentedon Feb 17, 2022
@AndyXheli thanks again for your help! Now everything works! 👍
AndyXheli commentedon Feb 17, 2022
You're Welcome! Happy to help
add 'apc.enable_cli=1' see nextcloud/server#27781
mrtumnus commentedon Apr 13, 2022
Helps to actually read. I spent way too much time figuring out that
apc.enable.cli=1is not the same asapc.enable_cli=1. Thanks @AndyXheliawestin1 commentedon Jun 24, 2022
For anyone who tried all these fixes but still had it fail, I was able to fix it by installing php-redis . Some other thread seemed to indicate apcu was being phased out, so I tried: sudo apt install php-redis . After that, all worked!
gjanos89 commentedon Aug 6, 2022
Hi Everyone,
I have tried with the same issue all of the above. Added the apc.enable_cli=1 basically in every php.ini and apcu.ini, apcu_bc.ini that I could find. Still nothing...
Then I realised the issue on my instance --> I have php version 7.4, 8.0 and 8.1 installed, so I had to specify in the OCC commands and with that in my crontab setup which version to use. So instead of ....php occ...., now I have ....php7.4 occ....
(note: it was originally installed years ago, so I had to check under /etc/php/ all 3 versions to see which one contained the apache2 folder to figure out for me it was 7.4)
OLD:
*/5 * * * * php -f /var/www/html/nextcloud/cron.phpNEW:
*/5 * * * * php7.4 -f /var/www/html/nextcloud/cron.phpAlso running OCC command example:
cd /var/www/html/nextcloud/(note: check your path, maybe yours is without the /html)
sudo -u www-data php occruns to error
sudo -u www-data php7.4 occexecutes
I hope it helps someone...
Sieboldianus commentedon Aug 6, 2022
My best advice: Migrate Nextcloud to the official Docker Image and configure unattended updates. A blessing, not having to manage dependencies anymore..
chiuyau commentedon Aug 28, 2022
This is helpful!
Reiikz commentedon Feb 14, 2023
thanks a bunch!
My cron job wasn't running and now is :3
brunodegoyrans commentedon Apr 30, 2023
Using also a synology NAS but with PHP8.0. Add a new nextcloud.ini in usr/local/etc/php80/cli/conf.d did NOT work for me, even after a restart. I had to add
extension = apcu.sointo the already existing /usr/local/etc/php80/cli/conf.d.extension.ini