ResolveTransactional file locking message in admin page

memcache
10

#1

Expected behaviour

I tried to solve the message that I get in admin page

Transactional file locking should be configured to use memory-based locking, not the default slow database-based locking. See the documentation :arrow_upper_right: for more information.

Following the guide, I installed the APCu and I added in the config file the "memcache.local": "\\OC\\Memcache\\APCu",

I restarted the Apache2, but the message is still there

Actual behaviour

the message is still there

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache2

Database: MySQL

PHP version: PHP Version 7.0.22-0ubuntu0.16.04.1

ownCloud version: 10.0.3.3

Updated from an older ownCloud or fresh install: fresh

Where did you install ownCloud from: owncloud

Signing status (ownCloud 9.0 and above):

No errors have been found.

The content of config/config.php:

{
    "system": {
        "instanceid": "ocvgzukzb4qp",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "my.domain.com"
        ],
        "datadirectory": "\/var\/www\/html\/my.domain.com\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/myfolder\/owncloud",
        "dbtype": "mysql",
        "version": "10.0.3.3",
        "dbname": "myownclouddb",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_from_address": "mycloud",
        "mail_smtpmode": "php",
        "mail_domain": "mydomain.com",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "loglevel": 2
    }
}

Client configuration

Browser: Chrome

Operating system: Windows 10


#2

You have configured the memory cache.

This is how you enable file locking:

https://doc.owncloud.com/server/10.0/admin_manual/configuration/server/caching_configuration.html#configuring-transactional-file-locking


#3

Thanks for your help! From the link you posted:

'filelocking.enabled' => true,
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
     'host' => 'localhost',
     'port' => 6379,
     'timeout' => 0.0,
     'password' => '', // Optional, if not defined no password will be used.
 ],

From this line 'memcache.locking' => '\OC\Memcache\Redis', I understand that I have to installl Redis first?


#4

You can try it with the memcache, but we recommend installing redis


#5

Thanks!
You have done great work! :slight_smile:


#6

If it works with your setup - I am glad that I could help you out :slight_smile:


#7

I come back because the message is still there after I installed the Redis. I followed this guide to install Redis, I removed the line "memcache.local": "\\OC\\Memcache\\APCu", from the confing.php and I added the :

  'filelocking.enabled' => true,
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => [
       'host' => '/var/run/redis.sock',
       'port' => 0,
       'timeout' => 0.0,
       'password' => '', // Optional, if not defined no password will be used.
  ],

But the message is still there...

The redis is running without any errors,

 sudo systemctl status redis
● redis.service - Redis In-Memory Data Store
   Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-10-19 08:01:15 UTC; 14min ago
 Main PID: 1055 (redis-server)
    Tasks: 4
   Memory: 4.4M
      CPU: 1.359s
   CGroup: /system.slice/redis.service
           └─1055 /usr/local/bin/redis-server 127.0.0.1:0

Oct 19 08:01:16 myserver redis-server[1055]:   `-._    `-._`-.__.-'_.-'    _.-'
Oct 19 08:01:16 myserver redis-server[1055]:  |`-._`-._    `-.__.-'    _.-'_.-'|
Oct 19 08:01:16 myserver redis-server[1055]:  |    `-._`-._        _.-'_.-'    |
Oct 19 08:01:16 myserver redis-server[1055]:   `-._    `-._`-.__.-'_.-'    _.-'
Oct 19 08:01:16 myserver redis-server[1055]:       `-._    `-.__.-'    _.-'
Oct 19 08:01:16 myserver redis-server[1055]:           `-._        _.-'
Oct 19 08:01:16 myserver redis-server[1055]:               `-.__.-'
Oct 19 08:01:16 myserver redis-server[1055]: 1055:M 19 Oct 08:01:16.010 # Server initialized
Oct 19 08:01:16 myserver redis-server[1055]: 1055:M 19 Oct 08:01:16.013 * DB loaded from disk: 0.003 seconds
Oct 19 08:01:16 myserver redis-server[1055]: 1055:M 19 Oct 08:01:16.013 * The server is now ready to accept connections at /tmp/redis.sock

When I tried to add the 'memcache.local' => '\OC\Memcache\Redis', in the browser I get a message:

Memcache \OC\Memcache\Redis not available for local cache Is the matching PHP module installed and enabled?

I tried to install php5-redis but the package can't not be located (my server OS is Ubuntu 16.04)..
The message I got is caused because of the missing module?

Thanks a lot!


#8

Would you consider switching to php7?
I think it will be easier to find the correct modules.


#9

Yes! However, could you guide me how to switch to php7?
I thought that Ubuntu 16.04 uses php7 You mean that I installed Redis on php 5?
Forgive me for all these questions but i am newbie in system administrator..


Internal Error with Redis
#10

I think you can just remove pjp5 and install php7


#11

Well I installed the php module by

sudo apt install php-redis

and then in my config.php I added:

'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => 'true',
'redis' => 
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
),

and the message resolved.