{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/13957","labels_url":"https://api.github.com/repos/owncloud/core/issues/13957/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/13957/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/13957/events","html_url":"https://github.com/owncloud/core/issues/13957","id":56860639,"number":13957,"title":"ownCloud upgrade 5.0.14 to 7.04 ","user":{"login":"iliyasbasir","id":10195796,"avatar_url":"https://avatars.githubusercontent.com/u/10195796?v=3","gravatar_id":"","url":"https://api.github.com/users/iliyasbasir","html_url":"https://github.com/iliyasbasir","followers_url":"https://api.github.com/users/iliyasbasir/followers","following_url":"https://api.github.com/users/iliyasbasir/following{/other_user}","gists_url":"https://api.github.com/users/iliyasbasir/gists{/gist_id}","starred_url":"https://api.github.com/users/iliyasbasir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliyasbasir/subscriptions","organizations_url":"https://api.github.com/users/iliyasbasir/orgs","repos_url":"https://api.github.com/users/iliyasbasir/repos","events_url":"https://api.github.com/users/iliyasbasir/events{/privacy}","received_events_url":"https://api.github.com/users/iliyasbasir/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app:user_ldap","name":"app:user_ldap","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/blue-ticket","name":"blue-ticket","color":"0033CC"},{"url":"https://api.github.com/repos/owncloud/core/labels/triage","name":"triage","color":"00FFFF"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/32","labels_url":"https://api.github.com/repos/owncloud/core/milestones/32/labels","id":955004,"number":32,"title":"8.0.1-next-maintenance","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":7,"state":"open","created_at":"2015-01-28T14:58:27Z","updated_at":"2015-02-12T10:25:38Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-02-06T20:02:21Z","updated_at":"2015-02-12T13:44:38Z","closed_at":null,"body":"#### Expected behavior\r\n1. Manual upgrade path of Owncloud 5.0.14->5.0.18->6.0.6->7.0.4. \r\n2. In testing, upgrade worked flawlessly. \r\n3. In production, upgrade was successful and most users were happy \r\n4. Next day we received complaints that some users could not see their files. I regenerated the file_cache and this resolved their issues\r\n5. We then received reports that some shares for some users are not accessible.\r\n\r\nThe problem is with the oc_storages database and an inconsistency in how the id value is generated and searched. \r\n\r\nIn our oc_storages table, some users have an id value that looks like an md5 hash and some have an entry of the form \"home::<GUID>\". For example, my oc_storage entry is:\r\n```\r\n+----------------------------------+------------+\r\n| id | numeric_id |\r\n+----------------------------------+------------+\r\n| da8d001d43de3e426e30f22ef14b251d | 5 |\r\n+----------------------------------+------------+\r\n```\r\nAnd a user with the issue has \r\n```\r\n+--------------------------------------------+------------+\r\n| id | numeric_id |\r\n+--------------------------------------------+------------+\r\n| home::F10E0A54-3E55-4987-AAAF-F3FB7C6D95E9 | 483 |\r\n+--------------------------------------------+------------+\r\n```\r\nAfter the upgrade, the user with numeric_id was allocated a new storage at\r\n```\r\n+----------------------------------+------------+\r\n| id | numeric_id |\r\n+----------------------------------+------------+\r\n|d405b43cd27c23342fd7ed378455707a | 766 |\r\n+----------------------------------+------------+\r\n```\r\nYet they could still access their files on storage id 483 and the oc_filecache for 766 only had 3 entries. \r\n\r\nThe real problem occurs when a user tries to access a share. The search for the mount point in this case does a search on the hash d405b43cd27c23342fd7ed378455707a instead of home:: F10E0A54-3E55-4987-AAAF-F3FB7C6D95E9 and gets a storage ID of 766 but all of the shares point to fields with storage 483.\r\n\r\n This generates the error {\"app\":\"files_sharing\",\"message\":\"Unable to get mount for shared storage '483' user 'F10E0A54-3E55-4987-AAAF-F3FB7C6D95E9'\",\"level\":3,\"time\":\"2015-02-05T19:06:14+00:00\"}. \r\n\r\nAs soon as the entry for 766 is removed everything starts functioning again.\r\n\r\nOwncloud has been in production for several days and quite active so reverting to a backup and earlier version at this point is not an option but I do still have the backups that I have been using for my investigations. To compound the problem, some students have discovered that recreating shares works so we now have a mix of shares pointing to files with the old storage id and new storage id. \r\n\r\nI need to be able to reconcile the new IDs with the old IDs to fix the problem but need to know a few things before a script can be generated:\r\n\r\n1. How is the hash generated? What string format is used to generate the storage hash? This will help me line up the home::<GUID> with the new IDs\r\n2. What would happen if I changed the storage in the oc_filecache from new storage to old storage? The tree should be fine except that a user will now have two parent nodes. Those need to be reconciled somehow. \r\n3. Which id is supposed to be used in the oc_storages? The existence of the two types of IDs is concerning to me because inconsistency is what causes problems like this. It masked our testing because our tests were using accounts and shares with the hash instead of home::<GUID>.\r\n\r\n#### Actual behavior\r\nevery user should able to share/view  folder\r\n\r\n#### Steps to reproduce\r\n This issue is  ongoing upgrade issue \r\n####  Server configuration\r\nOperating system: Ubuntu 12.04.5 LTS\r\n\r\nWeb server: 2.2.22-1ubuntu1.7\r\n\r\nDatabase: MySQL 5.5.41-0ubuntu0.12.04.1\r\n\r\nPHP version: 5.3.10-1ubuntu3.15\r\n\r\nownCloud version: 7.0.4 (stable)\r\n\r\nStorage backend: Local storage ext4 filesystem - VMware raw disk mapped LUN on SAN\r\n\r\nClient configuration:\r\n\r\nClient version: Varied - web interface and all sync clients affected\r\n\r\nOperating system: Windows, Linux, Mac, Android, iPad\r\n\r\nOS language: Varied but mostly English\r\n\r\nInstallation path of client: default\r\n#### Log\r\nLog can be found at S3/shared/ownCloud/support/github-issue/core/13957"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/74072127","html_url":"https://github.com/owncloud/core/issues/13957#issuecomment-74072127","issue_url":"https://api.github.com/repos/owncloud/core/issues/13957","id":74072127,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T13:44:37Z","updated_at":"2015-02-12T13:44:37Z","body":"@iliyasbasir a few points:\r\n\r\n- You are saying that the user already had a storage \"home::xxx\" but after the upgrade a new one appeared. This is the problem number 2) here: https://github.com/owncloud/enterprise/issues/525#issuecomment-74068468 (there are steps how to fix it without rolling back, CC @bboule)\r\n\r\n- the md5 hash is actually the md5(real_storage_id). This means that to find the storage id of every user, you need to take the user name of every user and then do\r\n   - md5(\"local::$datadir/\" + userId) (for the old style storages)\r\n   - md5(\"home::\" + userId) (for the new style storages)\r\n\r\nYes... this is so messy..."}}