Skip to content

7.0.04 to 8.0.0 not working: legacy storage repair issue #13980

Closed

Description

@alexweirig

Hello,

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.

Activity

  1. karlitschek commented on Feb 9, 2015

    @karlitschek
    Contributor

    @PVince81 What do you think?

  2. added this to the milestone on Feb 9, 2015
  3. crysknife commented on Feb 9, 2015

    @crysknife

    I've faced the same issue by upgrading my instance from 7.0.4 -> 8.0.0

  4. PeterPablo commented on Feb 9, 2015

    @PeterPablo

    Could issue #13912 be related (failing upgrade process)?

  5. PVince81 commented on Feb 9, 2015

    @PVince81
    Contributor

    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"

  6. PVince81 commented on Feb 9, 2015

    @PVince81
    Contributor

    @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

  7. karlitschek commented on Feb 9, 2015

    @karlitschek
    Contributor

    @PVince81 Yes. I remember.

  8. crysknife commented on Feb 9, 2015

    @crysknife

    I did changed the data directory quite some time ago ... even before upgrading to 7.x

  9. PeterPablo commented on Feb 9, 2015

    @PeterPablo

    The same holds true for me. I did not modify any values manually in the database.

  10. crysknife commented on Feb 9, 2015

    @crysknife

    As suggested, deleting the bogus tries fixed the issue.

  11. PVince81 commented on Feb 9, 2015

    @PVince81
    Contributor

    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.

  12. alexweirig commented on Feb 9, 2015

    @alexweirig
    ContributorAuthor

    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

  13. PeterPablo commented on Feb 9, 2015

    @PeterPablo

    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.

  14. PVince81 commented on Feb 9, 2015

    @PVince81
    Contributor

    @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.

  15. 40 remaining items

  16. viper1vip commented on Mar 24, 2015

    @viper1vip

    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 :)

  17. abbgrade commented on Mar 25, 2015

    @abbgrade

    @PVince81 thanks

    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.

  18. viper1vip commented on Mar 25, 2015

    @viper1vip

    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

  19. tmahring commented on Apr 7, 2015

    @tmahring

    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 ?

  20. PVince81 commented on Apr 7, 2015

    @PVince81
    Contributor

    @tmahring can you post the exact error message and owncloud.log entries ?

  21. tmahring commented on Apr 7, 2015

    @tmahring

    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 ?

  22. PVince81 commented on Apr 7, 2015

    @PVince81
    Contributor

    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 ?

  23. tmahring commented on Apr 7, 2015

    @tmahring

    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.

  24. PVince81 commented on Apr 8, 2015

    @PVince81
    Contributor

    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.

  25. tmahring commented on Apr 8, 2015

    @tmahring

    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:

    1. 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)
    2. delete fd0d3df08ccdf869498aae57ff90e028 (storage id 17) from oc_storages
    3. rerun the upgrade

    Is that correct ?

  26. PVince81 commented on Apr 8, 2015

    @PVince81
    Contributor

    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.

  27. tmahring commented on Apr 8, 2015

    @tmahring

    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 ?

  28. PVince81 commented on Apr 8, 2015

    @PVince81
    Contributor

    Only delete the entry fd0d3df08ccdf869498aae57ff90e028 in oc_storages and also the matching orphaned oc_filecache entries. Then re-run the upgrade.

  29. tmahring commented on Apr 8, 2015

    @tmahring

    Worked like a charm. Thank you very much for your help !

  30. locked as resolved and limited conversation to collaborators on Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions