You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
7.0.04 to 8.0.0 not working: legacy storage repair issue #13980
updating 7.0.4 to 8.0.0 fails with the following message:
Updating ownCloud to version 8.0, this may take a while.
Turned on maintenance mode
Checked database schema update
Checked database schema update for apps
Updated database
Could not automatically fix legacy storage "local::/Volumes/OWNCLOUD_DA/ocdata//admin/" => "home::admin" because they both have data.
The update was unsuccessful. Please report this issue to the ownCloud community
What does this mean? How can I fix this?
When I connect to the web interface in 7.0.4 with the admin account, there is no data in that accout.
This is the legacy storage situation: at some point you renamed/moved the data folder but the hard-coded value in the database was still on the old one.
Did you recently change the data directory or was it a long time ago ?
If it was a long time ago, you probably want to manually delete the bogus "local::$olddatadir/$user" entry and keep only "home::$user"
You guys all updated from OC 5.0.12 at some point which add the old "local::$datadir/$user" storage entries. The error message is because in OC 8 it tries to convert these to the new format "home::$user" but cannot do so because for some reason that entry already exists.
Since you guys did not change the datadir recently, the way to fix it is as follows:
Find all users who have both "local::$datadir/$user" and "home::$user" then delete the bogus "home::$user" entries before doing the upgrade. The upgrade will convert the old ones to the new ones.
I just deleted the single entry ('local::/var/www/owncloud/data/', 2); in the table oc_storages (there is now only a single entry ('local::/media/backup/owncloud_data/', 3), with the new data location). Now OwnCloud started the update process. I will edit as soon as this is finished. Wanted to give a timely update, since other people are facing the same issue right now.
@alexweirig hmmm, can you check all local:: entries ? select * from oc_storages where id like 'local::%'
They should all have your current data dir.
Did you at some point move the data dir away then move it back immediately afterwards and maybe forgot ? The DB entries might help figuring this out.
So my 'local::/home/admin/domains/XXXXXX.pl/public_html/site/owncloud/data/user/' matching to 075d4076e5dcab713582709db34b667d so I delate this entries (075d4076e5dcab713582709db34b667d) and the instalation finished.
After that I received blank page but I have read that I have to disabled calendar and contact apps.
After occ app:disable calendar the login worked. But then the previous problem appears with the following log entry:
{"reqId":"55436515f56ab46361561966d20efeaf","remoteAddr":"10.101.1.215","app":"PHP","message":"Class OCA\\Contacts\\Share\\Addressbook contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (OCP\\Share_Backend::isShareTypeAllowed) at \/var\/www\/owncloud\/apps\/contacts\/lib\/share\/addressbook.php#130","level":3,"time":"2015-03-25T17:15:14+00:00"}
Then i disabled the adressbook via ./occ app:disable contacts. Now the webapp works without these (unused) apps.
Hi
I'm getting the same error upgrading to 8.0.3 on debian.
However, I checked the database and oc_storage contains NO entries in the form of local::$olddatadir/$user, all entries are in the home:$user form. Also I never changed my directory in any way.
All my users (besides admin) are stored in an ldap database, could this be the reason ?
here is the exact error message:
Could not automatically fix legacy storage "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" => "home::c09b7381-4d9011e4-b17192f0-f4f98cac" because they both have data.
no new messages appear in owncloud.log when i try to run the update, is there maybe a way to set it to more verbose logging ?
There is no way to get more verbose logging.
So you do confirm that your "oc_storages" table contains no entry with "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" nor one with "home::c09b7381-4d9011e4-b17192f0-f4f98cac" ? The error message implies that both entries exist.
Do you have any kind of database caching enabled ?
And re-running the upgrade also didn't help I guess ?
i DO have this entry: "home::c09b7381-4d9011e4-b17192f0-f4f98cac", but not the one with local::...
Do I need to delete this entry ? I thought the problem was when both entries where in the database, maybe i misunderstood.
No, you're right, it is when both entries are in the database.
Now if you cannot find an entry "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" it is because that id is too long (more than 64 chars), so it will use the md5 of it instead.
Let's convert it: md5("local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac") => "ca535304ac81cab9019419ddf0b060a2".
Try searching for a storage id "ca535304ac81cab9019419ddf0b060a2". That would be the duplicate entry.
At this point you need to check the matching "oc_filecache" entries and decide whether you want to keep either the "local::" one (the md5) or the "home::" one.
Ok, I didn't find ca535304ac81cab9019419ddf0b060a2 but when I run the md5 command on my system it outputs fd0d3df08ccdf869498aae57ff90e028 which i found in oc_storages, as storage id 17.
so in order to fix it i would now:
run an update query to change storage id 17 to 12 in the oc_filecache table (12 is the storage id of the home::... entry)
delete fd0d3df08ccdf869498aae57ff90e028 (storage id 17) from oc_storages
Not exactly. Did you change the "datadir" in config.php recently ? Did you add or remove the trailing slash in that value ? This is usually what causes duplicate entries to appear.
Did you check whether your actual most recent files and shares are in the "home::" entry or in the fd0d3df08ccdf869498aae57ff90e028 entry ? You should only need to delete the one you don't want to use, then re-run the upgrade. It will automatically adjust the id to the new format.
I'm pretty sure I never changed the datadir in config.php (or made any other changes to it).
Could it be that it got changed during an update by the debian package manager ?
I checked oc_filecache and the fd0d3df08ccdf869498aae57ff90e028 storage only contains a few files in files_trashbin, so that should be save to remove.
Should I change the entries in oc_filecache associated with fd0d3df08ccdf869498aae57ff90e028 ? (delete them, change the storage_id...) or just leave them ?
Activity
karlitschek commentedon Feb 9, 2015
@PVince81 What do you think?
crysknife commentedon Feb 9, 2015
I've faced the same issue by upgrading my instance from 7.0.4 -> 8.0.0
PeterPablo commentedon Feb 9, 2015
Could issue #13912 be related (failing upgrade process)?
PVince81 commentedon Feb 9, 2015
This is the legacy storage situation: at some point you renamed/moved the data folder but the hard-coded value in the database was still on the old one.
Did you recently change the data directory or was it a long time ago ?
If it was a long time ago, you probably want to manually delete the bogus "local::$olddatadir/$user" entry and keep only "home::$user"
PVince81 commentedon Feb 9, 2015
@karlitschek this is the reason why I thought it's maybe not a good idea to "block" updates when a legacy storage cannot be repaired: see #13513
karlitschek commentedon Feb 9, 2015
@PVince81 Yes. I remember.
crysknife commentedon Feb 9, 2015
I did changed the data directory quite some time ago ... even before upgrading to 7.x
PeterPablo commentedon Feb 9, 2015
The same holds true for me. I did not modify any values manually in the database.
crysknife commentedon Feb 9, 2015
As suggested, deleting the bogus tries fixed the issue.
PVince81 commentedon Feb 9, 2015
You guys all updated from OC 5.0.12 at some point which add the old "local::$datadir/$user" storage entries. The error message is because in OC 8 it tries to convert these to the new format "home::$user" but cannot do so because for some reason that entry already exists.
Normally when meeting both entries, ownCloud would use the "local::$datadir/$user" one by default (as per https://github.com/owncloud/core/blob/master/lib/private/files/filesystem.php#L369)
Since you guys did not change the datadir recently, the way to fix it is as follows:
Find all users who have both "local::$datadir/$user" and "home::$user" then delete the bogus "home::$user" entries before doing the upgrade. The upgrade will convert the old ones to the new ones.
alexweirig commentedon Feb 9, 2015
Hi Vincent,
there is a contradiction in you instructions, so I just want to make absolutely sure:
are we supposed to delete the local:: or the home:: entries in the database?
I can confirm that I didn't change the data directory either. I've been updating our current OC installation ever since v4.
Here is my version history:
4.0.4
4.0.5
4.0.6
4.0.7
4.0.8
4.5.0
4.5.1
4.5.2
4.5.32
4.5.42
4.5.52
4.5.62
4.5.72
4.5.82
5.0.00
5.0.02
5.0.03
5.0.04
5.0.05
5.0.06
5.0.07
5.0.08
5.0.09
5.0.10
5.0.11
5.0.12
5.0.13
6.0.00
6.0.00a
6.0.01
6.0.02
6.0.03
6.0.04
7.0.00
7.0.01
7.0.02
7.0.03
7.0.04
PeterPablo commentedon Feb 9, 2015
I just deleted the single entry
('local::/var/www/owncloud/data/', 2);in the tableoc_storages(there is now only a single entry('local::/media/backup/owncloud_data/', 3),with the new data location). Now OwnCloud started the update process. I will edit as soon as this is finished. Wanted to give a timely update, since other people are facing the same issue right now.PVince81 commentedon Feb 9, 2015
@alexweirig hmmm, can you check all
local::entries ?select * from oc_storages where id like 'local::%'They should all have your current data dir.
Did you at some point move the data dir away then move it back immediately afterwards and maybe forgot ? The DB entries might help figuring this out.
40 remaining items
viper1vip commentedon Mar 24, 2015
I recommend http://www.tools4noobs.com/online_php_functions/md5/ for md5 :)
So my 'local::/home/admin/domains/XXXXXX.pl/public_html/site/owncloud/data/user/' matching to 075d4076e5dcab713582709db34b667d so I delate this entries (075d4076e5dcab713582709db34b667d) and the instalation finished.
After that I received blank page but I have read that I have to disabled calendar and contact apps.
Finaly is ok.
Thanks :)
abbgrade commentedon Mar 25, 2015
@PVince81 thanks
After occ app:disable calendar the login worked. But then the previous problem appears with the following log entry:
Then i disabled the adressbook via ./occ app:disable contacts. Now the webapp works without these (unused) apps.
viper1vip commentedon Mar 25, 2015
I just update that also I had to add additional code in .htaccess file because I did not have sychronization between computers.
Code:"
https://forum.owncloud.org/viewtopic.php?f=26&t=21065&p=58849&hilit=403+forbidden#p58849
tmahring commentedon Apr 7, 2015
Hi
I'm getting the same error upgrading to 8.0.3 on debian.
However, I checked the database and oc_storage contains NO entries in the form of local::$olddatadir/$user, all entries are in the home:$user form. Also I never changed my directory in any way.
All my users (besides admin) are stored in an ldap database, could this be the reason ?
PVince81 commentedon Apr 7, 2015
@tmahring can you post the exact error message and owncloud.log entries ?
tmahring commentedon Apr 7, 2015
here is the exact error message:
Could not automatically fix legacy storage "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" => "home::c09b7381-4d9011e4-b17192f0-f4f98cac" because they both have data.
no new messages appear in owncloud.log when i try to run the update, is there maybe a way to set it to more verbose logging ?
PVince81 commentedon Apr 7, 2015
There is no way to get more verbose logging.
So you do confirm that your "oc_storages" table contains no entry with "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" nor one with "home::c09b7381-4d9011e4-b17192f0-f4f98cac" ? The error message implies that both entries exist.
Do you have any kind of database caching enabled ?
And re-running the upgrade also didn't help I guess ?
tmahring commentedon Apr 7, 2015
i DO have this entry: "home::c09b7381-4d9011e4-b17192f0-f4f98cac", but not the one with local::...
Do I need to delete this entry ? I thought the problem was when both entries where in the database, maybe i misunderstood.
Rerunning the upgrade doesn't help.
PVince81 commentedon Apr 8, 2015
No, you're right, it is when both entries are in the database.
Now if you cannot find an entry "local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac/" it is because that id is too long (more than 64 chars), so it will use the md5 of it instead.
Let's convert it: md5("local::/var/www/owncloud/data/c09b7381-4d9011e4-b17192f0-f4f98cac") => "ca535304ac81cab9019419ddf0b060a2".
Try searching for a storage id "ca535304ac81cab9019419ddf0b060a2". That would be the duplicate entry.
At this point you need to check the matching "oc_filecache" entries and decide whether you want to keep either the "local::" one (the md5) or the "home::" one.
tmahring commentedon Apr 8, 2015
Ok, I didn't find ca535304ac81cab9019419ddf0b060a2 but when I run the md5 command on my system it outputs fd0d3df08ccdf869498aae57ff90e028 which i found in oc_storages, as storage id 17.
so in order to fix it i would now:
Is that correct ?
PVince81 commentedon Apr 8, 2015
Not exactly. Did you change the "datadir" in config.php recently ? Did you add or remove the trailing slash in that value ? This is usually what causes duplicate entries to appear.
Did you check whether your actual most recent files and shares are in the "home::" entry or in the fd0d3df08ccdf869498aae57ff90e028 entry ? You should only need to delete the one you don't want to use, then re-run the upgrade. It will automatically adjust the id to the new format.
tmahring commentedon Apr 8, 2015
I'm pretty sure I never changed the datadir in config.php (or made any other changes to it).
Could it be that it got changed during an update by the debian package manager ?
I checked oc_filecache and the fd0d3df08ccdf869498aae57ff90e028 storage only contains a few files in files_trashbin, so that should be save to remove.
Should I change the entries in oc_filecache associated with fd0d3df08ccdf869498aae57ff90e028 ? (delete them, change the storage_id...) or just leave them ?
PVince81 commentedon Apr 8, 2015
Only delete the entry fd0d3df08ccdf869498aae57ff90e028 in oc_storages and also the matching orphaned oc_filecache entries. Then re-run the upgrade.
tmahring commentedon Apr 8, 2015
Worked like a charm. Thank you very much for your help !