Owncloud & Docker : Unable to run CLI correctly

Hello guys,

Since some days and after a big amount of data uploaded on my owncloud, I having issues on my owncloud :

I find out that some folders cannot be renamed or deleted. I checked the logs and i seen that files were locked by webdav as you can see in log message :

 
Exception: {"Message":"HTTP\/1.1 423 \"Recup 23-01-2017\" is locked","Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked","Code":0,"Trace":"#0 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(640): OCA\\DAV\\Connector\\Sabre\\ObjectTree->move('Recup 23-01-201...', 'Recup 23-01-201...')\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpMove(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \/var\/www\/html\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:MOVE', Array)\n#4 \/var\/www\/html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/html\/apps\/dav\/appinfo\/v1\/webdav.php(56): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/html\/remote.php(164): require_once('\/var\/www\/html\/a...')\n#7 {main}","File":"\/var\/www\/html\/apps\/dav\/lib\/Connector\/Sabre\/ObjectTree.php","Line":252,"User":"Maelle"}

Then, after few googling I find out that using the command php occ files:cleanup cloud fix issue.
Soi decided to get a tty in my container in order to type the command.

i made these following commands :

#Connecting to the container tty :
docker exec -it my-oc-app  /bin/bash
#then I have to make www-data user able to open a session cause sudo is not in the container :
usermod -s /bin/bash www-data
#now i log on www-data user : 
www-data@0efe5192e556:~/html$ pwd
/var/www/html
www-data@0efe5192e556:~/html$ php occ file:cleanup
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
0 orphaned file cache entries deleted

As you can see, the phg interpreter in container doesn't have PCNTL plugin activated.

Here is my docker-compose.yml. As you can see, i'm using the official images, that's why i'm here :

services:
    db:
        image: mariadb:latest
        container_name: my-oc-db
        volumes:
            - /media/docker-repo/my-oc-db/database:/var/lib/mysql
        restart: unless-stopped
        environment:
            MYSQL_ROOT_PASSWORD: V6hC8UbR
            MYSQL_DATABASE: owncloud_db
            MYSQL_USER: oc_DvdMeow
            MYSQL_PASSWORD: *********
        network_mode: "bridge"
    owncloud:
    depends_on:
        - db
    links:
        - db
    image: owncloud:latest
    container_name: my-oc-app
    restart: unless-stopped
    environment:
        - VIRTUAL_HOST=************
        - VIRTUAL_PORT=443
    network_mode: "bridge"
    volumes:
        - /media/docker-repo/my-oc/apps:/var/www/html/apps
        - /media/docker-repo/my-oc/config:/var/www/html/config
        - /media/docker-repo/my-oc/data:/var/www/html/data

Am I on wrong way to fix this issue ?

I also tried to check on cron functions, and I discoverd that crontab commands are not included in container. I switched cron parameters to Ajax, but it doesn't fix anything : Folder is still locked....

Is there any trick to bypass this issue or i will have to create my own image to put php functionnality required ?

If you have advice or anything else, i''m listening

Thanks for help and have a good day =)

Hi,

"official image" means that this is provided by Docker itself. The issue tracker for that one could be found at [1].

However the PCNTL extension is no hard requirement, thats why the command is executed correctly. But as the files:cleanup command is not doing what you think (cleaning up this locked files) it won't help with your issue. For that specific locked files issue there is a FAQ available at [2].

[1]

[2]

Hey !

Thanks for these information =)

The sql request fixed the problem.
Thanks a lot and see you !

The "file is locked" message might happen again. If those are popping up again you can request a few things from the docker image maintainer at [3]:

[1] Use redis for file locking https://doc.owncloud.org/server/latest/admin_manual/configuration_files/files_locking_transactional.html

[2] Enable systems cron for background job https://doc.owncloud.org/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron

[1] will take some load from your database and works more reliable in file locking, [2] will clean-up such locked files automatically