{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/16633","labels_url":"https://api.github.com/repos/owncloud/core/issues/16633/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16633/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/16633/events","html_url":"https://github.com/owncloud/core/issues/16633","id":82637495,"number":16633,"title":"files_encryption error: public key exists but private key is missing","user":{"login":"ageis","id":1161532,"avatar_url":"https://avatars.githubusercontent.com/u/1161532?v=3","gravatar_id":"","url":"https://api.github.com/users/ageis","html_url":"https://github.com/ageis","followers_url":"https://api.github.com/users/ageis/followers","following_url":"https://api.github.com/users/ageis/following{/other_user}","gists_url":"https://api.github.com/users/ageis/gists{/gist_id}","starred_url":"https://api.github.com/users/ageis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ageis/subscriptions","organizations_url":"https://api.github.com/users/ageis/orgs","repos_url":"https://api.github.com/users/ageis/repos","events_url":"https://api.github.com/users/ageis/events{/privacy}","received_events_url":"https://api.github.com/users/ageis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app:files_encryption","name":"app:files_encryption","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-30T00:06:08Z","updated_at":"2015-08-21T11:20:46Z","closed_at":null,"body":"One of our ownCloud users, whose files_encryption migration_status (in oc_preferences) is still 0, is receiving the following error:\r\n```\r\n Encryption App is enabled but your keys are not initialized, please log-out and log-in again\r\n```\r\nIn owncloud.log it says:\r\n```\r\npublic key exists but private key is missing for <user>\r\n```\r\nHe's tried logging in and out several times and it doesn't work—the error isn't going away. I've tried running encryption:migrate-keys; but the files and directories for keys don't exist. We need to trigger his migration to encryption and key generation, but I don't know how to get it to happen. rm'ing his files_encryption folder doesn't work, I wonder if there's a variable I need to edit in the database?\r\n\r\nOn another note, a while ago I manually deleted a couple unshared files out of his data folder, which I now realize was a mistake and strongly ill-advised. I've since run files:scan and maintenance:repair, but I suspect that this might be the cause of the fact that he's the only one of our users having issues with file encryption and who hasn't been migrated.\r\n\r\nBased on a search of GitHub issues and Google, other people have had this problem, but I don't see any straightforward solution."},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/133375930","html_url":"https://github.com/owncloud/core/issues/16633#issuecomment-133375930","issue_url":"https://api.github.com/repos/owncloud/core/issues/16633","id":133375930,"user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T11:20:45Z","updated_at":"2015-08-21T11:20:45Z","body":"> public key exists but private key is missing for <user>\r\n\r\nThe error message is quite obvious. Please double check that the public key ````<user>.publicKey```` in data/files_encryption/public_keys exists and that the private key doesn't exist at ````<user>/files_encryption/<user>.privateKey````\r\n\r\nIf that's the case please restore the private key from your backups, I hope you have backups. ownCloud never deletes a private key, so I have now idea how you lost it. Maybe while you \"Manually delete a couple files in their data directory\"?\r\n\r\nIf the user never logged in all data should be still unencrypted. In this case you could also try to delete the public key. At next login ownCloud should create a new key pair and migrate his files. But keep in mind that in case some files are already encrypted, they will be lost."}}