New security warnings upgrading from NC26 to NC27

Installed NC 27, getting the following security warnings (warnings were clean/non-existent before the update):

The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the documentation ? for more information.
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 "mounts_user_root_path_index" in table "oc_mounts".
Please double check the installation guides ?, and check for any errors or warnings in the log.

Check the security of your Nextcloud over our security scan ?.

Running NC27 under OMV6 under docker on a Pi4.
Any comments appreciated.
R.

Ran the occ command for the second warning, and only the first warning remains now. I think it can be ignored…

redis is recommended for performance but if you are happy with your system nothing wrong to stay at this point.

ok thanks, just read that in the NC documentation.

https://docs.nextcloud.com/server/24/admin_manual/configuration_server/caching_configuration.html?highlight=redis

I’m worried about breaking my installation as I don’t see instructions for Docker installs.

Is is safe to install this:
https://hub.docker.com/_/redis
?
I would also need to figure out any PHP file mods.

I’m happy with the performance of NC27 under docker on a Pi4 so I may leave well enough alone.

R.

yes adding redis is safe. see Docker .examples

Because of this Warning I installed Redis but the warning won’t disappear. Checked if Redis is getting input, but redid-cli monitor is not showing anything when I surf on my nextcloud instance.
Tried both with Unix socket as well as over TCP.

in my instance with working redis I see tons of redis logs only browsing through the interface…

there must b something wrong with your redis config…

Slowly I am getting the feeling the problem is my NGINX setting using a php-fpm socket.

This command, and it’s okay :slight_smile:

sudo -u www-data php /var/www/html/nextcloud/occ db:add-missing-indices

This adds only the missing indices, and does not solve the problem with the memcache.

Are you using nginx?

no - apache docker behind traefik

Turned out, installing php8.1-redis solved my problem… My bad, thought this is already installed.
Thx for your help!

1 Like

I installed redis today and edited the config.php file accordingly with file locking enabled… everything works fine and Nextcloud 27 seems a little snappier. All warnings are now gone from my Nextcloud install. Happy days.

After some tests, it seems that you should add these 2 lines in config.php to suppress the warning without needing to install and configure redis :

'memcache.local' => 'OC\\Memcache\\APCu',
'memcache.locking' => 'OC\\Memcache\\APCu',

The first is from nextcloud doc recommandations. The second make the warning go away.

1 Like

I agree, took me ages to suss that out. Adding the second line finally make the error message go away without the need to use Redis

sudo nano /var/www/nextcloud/config/config.php
‘memcache.local’ => ‘OC\Memcache\APCu’,
‘memcache.locking’ => ‘OC\Memcache\APCu’,

If you get a Cron error message
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

add apc.enable_cli=1 not to your php.ini file as this doesn’t seem to work but to your /etc/php/8.2/mods_available/apcu.ini file

Getting this after upgrading to 27.1.4. It seems redis, at least php-redis from debian repo updated lately with php8.3 required and Nextcloud isnt supporting php8.3.
When I run php occ files:scan --all
I get: “This version of Nextcloud is not compatible with PHP>=8.3”.
If I update webserver to use php8.3 instead of php8.2 it breaks the webui with the same error.
I used the memcache.locking to APCu workaround for now to suppress the warning even though redis was working before:

  'memcache.locking' => '\\OC\\Memcache\\APCu',
  //'memcache.locking' => '\\OC\\Memcache\\Redis',

php8.3 is supported as of Nextcloud 28.

Much luck,
ernolf

I saw that, but I’ll stick with the APCu workaround until N28 is stable and then I’ll go back to using Redis.

you can set up redis in a docker container relatively easily. i have updated redis running separately from nextcloud and it works great