ownCloud docker with GlusterFS hangs on /remote.php/dav/files/admin/

Steps to reproduce

  1. ownCloud 10.5.0 run as docker service
  2. external mySQL 5.7 database
  3. /mnt/data from container mounted on GlusterFS volume on host

Expected behaviour

While ownCloud files are located on GlusterFS volume, after login I can see list of files.

Actual behaviour

After login ownCloud interface is loaded, but there is loader image instead of files list. Firefox network console say that there is no response to /remote.php/dav/files/admin/. Requestes is still waiting, no any http error. Response is 0 bytes.
On volume in docker host, default files are created and exists in /files/admin/files.
After switching LOG_LEVEL to DEBUG owncloud.log didn’t indicate to any errors.
In UI admin -> Settings is also stucking on loader, docker desktop client is starting synchronization but is unable to get any files.
Switching mount of /mnt/data to standard filesystem directory (instead of GlusterFS volume) resolves any problems.

Server configuration

Ubuntu server 18.04
Docker 19.03.12 in swarm mode
GlusterFS 6.9, issue tested with Distributed volume and Replicated volume - same effect.
docker command to run service:

docker service create --replicas 1 --network masext --with-registry-auth \
  --name owncloud \
  --publish 8080:8080 \
  --env OWNCLOUD_DB_TYPE=mysql \
  --env OWNCLOUD_DB_NAME=my_database_name \
  --env OWNCLOUD_DB_USERNAME=my_user \
  --env OWNCLOUD_DB_PASSWORD=my_password \
  --env OWNCLOUD_DB_HOST=my_databse_host \
  --env OWNCLOUD_ADMIN_USERNAME=admin \
  --env OWNCLOUD_ADMIN_PASSWORD=admin_pass \
  --env OWNCLOUD_MYSQL_UTF8MB4=true \
  --env OWNCLOUD_LOG_LEVEL=0 \
  --mount type=bind,source=/mnt/volumes/owncloud,destination=/mnt/data \
  owncloud/server:10.5.0

Any help would be appreciated.

I assume you’re still testing and you could restart everything from scratch…
Could you try to remove ownCloud from the ecuation? I mean, maybe running a php script that writes inside the /mnt/data folder from inside the container, or playing around the remote.php file to write some random content in the /mnt/data folder. This is to ensure you can write (and read) into that folder.

The problem might not be with ownCloud, but with either the GlusterFS or the way it’s mounted inside docker.

1 Like

Checked. File permissions for php scripts is not the issue.

Inside container I created file /var/www/owncloud/write.php

<?php
echo "start to write file\n";
$myfile = fopen("/mnt/data/files/ocadmin/files/testfile.txt", "w+");
$txt = "Actual time: " . date("Y-m-d G:i:s") . "\n";
fwrite($myfile, $txt);
fclose($myfile);
echo "write finished";
die();

And /var/www/owncloud/write.php

<?php
echo "start to read file\n";
$myfile = fopen("/mnt/data/files/ocadmin/files/testfile.txt", "r");
echo fread($myfile,filesize("/mnt/data/files/ocadmin/files/testfile.txt"));
fclose($myfile);
echo "read finished";
die();

Removed .htaccess and from browser accessed http://dockerIP:8080/write.php
and http://dockerIP:8080/read.php

Output is as expected:

start to read file
Actual time: 2020-08-26 15:20:42
read finished

df -Th shows:

localhost:/gfs fuse.glusterfs 7.0G 3.4G 3.7G 48% /mnt/data

So mount type is fuse.glusterfs. This must be some issue, but not so simple as php file permissions.

Any ideas?

Any chance to update the glusterFS? It could be a bug in the glusterFS, or some FS feature not properly implemented in glusterFS.
I think ownCloud uses filesystem locks in some places. Other than that, the operations are quite common (read, write, rename, move, etc)

1 Like

Yes, I can update glusterFS - version 6.10 is aviable, but can’t do this at this moment, need couple of days to find time when this dev environment can be switched to maintenance.

I have searched also for similar issues in glusterFS issue tracker, but didn’t find anything similar.
There is many services using this glusterFS volumes very intensive and there was no any issues (services like wordpress, geoserver, nginx, redis, terria and many others…).

What special filesystem locks can ownCloud use? With this information maybe will be easier to find some information about issues in glusterFS.

ownCloud access to the FS via PHP functions, and I don’t think it uses a shell or something similar to bypass that.
Apart from “whatever PHP does” I can’t provide other information (https://www.php.net/manual/en/function.flock.php)

1 Like