Home directory changed- what is wrong?

Hi all,

I am running OC 10 on Debian through the OC repositories.

I moved my data directory following the documentation.
Now I am getting messages in my owncloud.log:
{"[...] "user":"--","app":"no app in context","method":"PROPFIND","url":"\/remote.php\/webdav\/","message":"User backend OC\\User\\Database is returning home: \/srv\/www\/oc_data\/\/myuser for user: myuser which differs from existing value: \/srv\/www\/oc_data\/myuser"}

So in the first path there is a double slash after data while the second path only has a single slash. Should no matter to Linux but OC seems to get confused.

I followed the steps in the above documentation to update the values in the MariaDB and updated the table “oc_storages” with the current value without the leading slash.

Whatever I do, once OC runs for a while I have a second entry in the table with the leading slash. :frowning:

What did I do exactly?

  1. Stop OC and Apache: systemctl stop apache2
  2. Login to MariaDB: mysql -u root -p owncloud:
MariaDB [owncloud]> select * from oc_storages;
+--------------------------+------------+-----------+--------------+
| id                       | numeric_id | available | last_checked |
+--------------------------+------------+-----------+--------------+
| home::root               |          1 |         1 |         NULL |
| home::myuser             |          3 |         1 |         NULL |
[...]
| local::/srv/www/oc_data  |         20 |         1 |         NULL |
| local::/srv/www/oc_data/ |         21 |         1 |         NULL |
+--------------------------+------------+-----------+--------------+

Entry with numeric_id 21 was created by OC.
3. Delete other entry and update the one from OC:

MariaDB [owncloud]> delete from oc_storages where id='local::/srv/www/oc_data';
Query OK, 1 row affected (0.007 sec)

MariaDB [owncloud]> update oc_storages set id='local::/srv/www/oc_data' where id='local::/srv/www/oc_data/';
Query OK, 1 row affected (0.003 sec)
Rows matched: 1  Changed: 1  Warnings: 0
  1. Check again:
MariaDB [owncloud]> select * from oc_storages;
+-------------------------+------------+-----------+--------------+
| id                      | numeric_id | available | last_checked |
+-------------------------+------------+-----------+--------------+
| home::root              |          1 |         1 |         NULL |
| home::cvoelker          |          3 |         1 |         NULL |
[...]
| local::/srv/www/oc_data |         21 |         1 |         NULL |
+-------------------------+------------+-----------+--------------+
13 rows in set (0.001 sec)

So all apears to be fine.
5. Double check in table oc_accounts:

MariaDB [owncloud]> select * from oc_accounts;
+----+------------------------+----------+---------------+--------------------+-------+------------+------------------+---------------------------+-------+
| id | email                  | user_id  | lower_user_id | display_name       | quota | last_login | backend          | home                      | state |
+----+------------------------+----------+---------------+--------------------+-------+------------+------------------+---------------------------+-------+
|  1 | myuser@oc-domain.de    | myuser   | myuser        |  Name Surname      | none  | 1619549048 | OC\User\Database | /srv/www/oc_data/myuser   |     1 |
[...]
+----+------------------------+----------+---------------+--------------------+-------+------------+------------------+---------------------------+-------+
10 rows in set (0.000 sec)

Looks good, doesn’t it?
5. exit from MariaDB and restart Apache2:
systemctl start apache2

Very quickly I am getting again these messages.

Checking the oc_storages table I have a new entry now:

| local::/srv/www/oc_data  |         22 |         1 |         NULL |
| local::/srv/www/oc_data/ |         23 |         1 |         NULL |

WITH the leading slash… :roll_eyes:

Anyone having an idea what is wrong here?

THANKS a lot!

/KNEBB

1 Like

Ok, I figured it out on my own.

As usually, once the admin is too dumb you are getting such errors.

I had to change the config setting in config.php from
'datadirectory' => '/srv/www/oc_data/',
simply to
'datadirectory' => '/srv/www/oc_data',

and the messages went away.
Strange OC does not honor this correctly…even though I did not see any further errors related to this.

/KNEBB

1 Like

Don’t worry, happens to the best :wink:

I would also say that this is a bug, ownCloud should handle this datadirectory config variable correctly…