-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files #8546
Comments
Just updated to PHP 7.0.27. The problem prevails. |
cc @nextcloud/encryption |
@knut-hildebrandt Thanks for creating this issue. I've done the exact same steps as you to reproduce on my new NC13 deployment. +1 For this getting picked up and seen by the devs. If it's something stupid simple that I'm doing, then let this fool know. |
Looks like #8393 is having same issue, thus linking for visibility |
@knut-hildebrandt after searching and searching last night I ended up giving up on it. Come back today and try to give it another go and got things working as my whole goal is to enable E2EE (end-to-end encryption) with my new NC13 deployment on FreeNAS. So, yesterday I enabled the “Default encryption module” & “End-to-End Encryption” Apps. Went through the process of logout/login and that pesky "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files" message hit me. I quickly disabled “Default encryption module” & “End-to-End Encryption” Apps to get rid of the error. I remember reading in a guide that when you enable the encryption feature it must generate the private keys somewhere. Looking in the NC13 Admin Manual it doesn't show me anything about the keys Nextcloud 13 Administration Manual - Encryption configuration/encryption_configuration.html and I stumbled onto the ownCloud Admin Manual it has a nice section telling you about the keys and where they're stored ownCloud 8.1 Server Administration Manual - Encryption Configuration - Where Keys are Stored This is the new file structure for ownCloud 8.1: Private public share key: Private recovery key: Public public share key: Public recovery key: File keys for system-wide mount points: Share keys for files on a system-wide mount point (one key for the owner and one key for each user with access to the file): Users’ private keys: Users’ public keys: File keys for files owned by the user: Share keys for files owned by the user (one key for the owner and one key for each user with access to the file): I checked the paths and didn't see that there was anything there. Then it hit me, I never enabled "Server-side encryption". Went back and made suer that the "Default encryption module” was enabled, turned on "Server-side encryption" and once I did those paths populated with newly generated keys. Albeit when I checked in the "OC_DEFAULT_MODULE" directory this is what was listed: data/files_encryption/OC_DEFAULT_MODULE # ls -la master_#####.privateKey I then went back to Apps and enabled “End-to-End Encryption”, downloaded the latest Prerelease Client and started testing E2EE (end-to-end encryption). Hope this helps shed some light on things and helps folks in the right direction. If there's something that I'm missing or have left out please let me know as I don't' want to be spreading false information and make someone waste their time. |
@shadadougha that's it, thanks. I enabled server side encryption, then the keys are created. Then I disabled server side encryption via |
@spackmat word, glad that helped. I'm going to have to disable server side encryption as I'm finding some weird issues going on with the E2EE IoS App and suspect this may be causing it. Also, I'm doing my NC13 deployment in FreeNAS thanks to this guide How to install Nextcloud 13 in FreeNAS with all checks passed updated to use iocage and the
Also the guide for Using the occ command is super helpful. If you too are doing a FreeNAS deployment like me below is the proper syntax for running the occ commands
P.S. Sorry for changing my username that you referenced. Figure it'd be easier to have a coherent presence across Git and other forums I help out with. |
I am also receiving this error with nextcloud 13.0.5, started with 13.0.4. I am really looking forward for a bug fix on that one. Kind regards |
Me too , |
I tried it in two different ways:
-> everything works as expected. I don't see the message. Per default we also use one master key for all users, completely independent from the user password. That's why I don't see how this could ever be triggered in this setup. That's why I tried in addition:
|
@schiessle enabling server side encryption (at least one time) solves the problem as described before. So the issue is about the case, where server side encryption shouldn't be used. At least it must be documented, that the default encryption module throws this error, before the server side encryption module generated its keys on install. Better would be to remove this dependency (create the keys in default encryption module or if the keys are not necessary at all, let the right module show this error). |
I have this issue with Nextcloud 14!
|
I can confirm this on NC 14 happens with old and new users. [ Quite annoying - that pop-up is rendered above the app menu, making clicking those impossible, though zooming out is a workaround ] |
this popup appear with a FreshInstall of Nextcloud 14 |
disable Default encryption module fix the problem thanks |
But disabling the Default encryption module makes E2EE only appear to work. Without the default encryption module, uploaded files are just stored as-is on the server. My situation: 13.0.7 (no upgrade offered) on a home server (Debian Linux, updated several time through the web updater). I keep getting the dreaded "wrong private key" popup ("Falscher privater Schlüssel für die Verschlüsselungs-App. Bitte aktualisiere Deinen privaten Schlüssel in Deinen persönlichen Einstellungen um wieder Zugriff auf die verschlüsselten Dateien zu erhalten."). Please provide instructions for turning on E2EE that do not throw problem messages when thre is no problem, or messages that do point to the real cause. |
Can confirm I'm seeing the same issue on a fresh Nextcloud 15 installation with the basic encryption module. The dialog referenced from this popup looks like this: I have just created this new user and not "changed" a password. Submitting the form will only print "Saving..." and not return. JS console reports an invalid JSON response as detailed in #6834. Apparently, a JSON response was expected, but it actually returned an HTML response with status code 503 containing the text:
Is there anything we can do to help diagnose this issue? |
This is actually true - I set up my Owncloud 15.0 out of the box a month ago, and since two days I have the same errortext...makes no difference for me, if Encryption is enabled or not.. |
I'm experiencing the same thing; goofy "Invalid key" warning. I had turned on encryption several years ago, and changed my password in the interim. Now I've migrated my data to S3, and apparently enabling the default encryption app is required even if you don't enable encryption, or large file uploads fail. So what bit do I need to flip to get this message to go away? I cannot find anything relevant in the database. |
It looks like you could fix this issue with a change to |
FWIW as a short-term solution I ended up commenting out the relevant lines from |
Had this issue happen on NextCloud 14, and I hoped updating to 15 would fix something but still having the problem. Only seems to be for one user and with only some files, I never changed the password or anything. Restarted my server and had that error happen. https://github.com/nextcloud/server/issues/13998 |
I tried to do this, but I did not have any encrypted files at the start, but I did have the error. |
With maintenance mode on (this on a v27.0.2 installation), I ran
|
Is there a way to delete and regenerate all private keys? I don't have any encrypted files, so I would happily do this to get rid of the error. |
So answering my own question: the keys are in I was able to do this because I did not have any encrypted files. If you do have encrypted files, you will probable be unable to decrypt them. |
Still having this problem. files:scan --all reveals no problems. encryption:scan:legacy-format reveals no files using the legacy format. What on Earth is triggering this? |
Thanks @jeroenh I know there is a big time gap between my question and your answer but is it possible that you note down all your steps how you've solved this issue for you? Thanks in advance! |
If encryption:scan:legacy-format returns no files using that format, and says, “All scanned files are properly encrypted. You can disable the legacy compatibility mode,” but the “Invalid private key for encryption app” persists, where, exactly, is the invalid private key to be found? In data/files_encryption/OC_DEFAULT_MODULE? In there I see three privateKey files: master, pubShare, and recovery. Of those three, only the master file starts with a header, in this case, “HBEGIN:cipher:AES-256-CFB:keyFormat:hash”. The other two simply start with raw data; presumably, the hash. Does that mean pubShare and recovery are legacy-format private keys? If so, is there some procedure to cause those to be re-generated so as not to use the legacy format? Running encryption:migrate-key-storage-format apparently succeeds, showing, “Key storage format successfully updated”, but it does not add any HBEGIN to any of the existing .privateKey files which are presently missing it. |
interestingly every time I install NextCloud, I had that message until today; YES I figured outand here how you could toothese options have a order
So where was my mistake?I was jumping directly to and only enabling the encryption for the home storage while the server-side encryption was not active. |
In the NC webinterface i disabled the app: |
You mean you disabled, “Enable server-side encryption”, right? The “Default encryption module” is a radio button, can’t be disabled, presumably unless you have some other encryption module installed. Is yours a new installation? Did you have files encrypted already? If so, were the files successfully decrypted? Can you now access everything successfully? Unfortunately, in my case, for some reason, the option to disable server-side encryption is unavailable and cannot be manipulated. Personally, I would love completely to disable encryption if only to get rid of this ridiculous message which has plagued me and others for years seemingly without any progress on the developer side. I guess no Enterprise customers have ever encountered this. |
@Pazu ; i did receive this notification message since the update to 27.1.3, i never enabled encryption, also the command said: |
This happens on a brand new server with Nextcloud 27.1.4.1. Enabled Default Encryption Module, disabled encryption, used SSE-C. Messages appears after logging in. Did not run Files appear to be accessible, though. I noticed in the logs it says...
I was able to fix it by running |
Sticks on "Saving...". HTTP status code reveals 2023-12-04_22-16-52_299.mp4Response says this... Even though JavaScript is, of course, enabled. No adblocking turned on. Same issue happens on mobile. If anything, there should be an error handler surrounding this so it would say "Failed, check the logs" or something along those lines. 😊 |
Same issue, I've a freshly installed NextCloud 27.1.4 and enabling "Default Encryption Module" gives me the error |
I have never seen this message until just now, having updated from 23 to 27. We are not using any form of server-side encryption, it has always been disabled. I cannot understand what is causing this message for all the users. The suggestions above did not fix the issue. |
Disabling the Default encryption module app makes the message go away. |
Yes, I did not have the issue either until version 27, was on version 24. |
Okay, interesting idea. Are there any consequences for doing so with an instance which already has all files encrypted using this module? Wlil they simply be automatically decrypted? |
I am afraid I cannot answer that. For us, we have not been using server-side encryption, yet that message has started appearing. Disabling the Default encryption module "app" is an acceptable workaround for us. |
I can disable the default encryption app, but doesn't that disable encryption thus defeating the purpose? 😊 |
Okay folks: This issue has become a hodgepodge of different scenarios that happen to generate the same error message as the original reporter's situation, but are not necessarily related to each other. Not all of the root causes are the same. There may be legitimate underlying bug(s), but in other cases the cause is having multiple incompatible encryption apps installed simultaneously (which is not a supported configuration; and, yes, we should do a better job outright preventing it from being possible for a Server to be configured in this way, but that's a matter covered elsewhere so out-of-scope for this particular Issue). I also suspect that many here have very different environments too since this issue was opened in 2018. Also, a million things have changed with encryption since Nextcloud v13 when this issue was opened so it's very difficult to compare your situation to older reports and any suggested workarounds or troubleshooting steps. Lastly, if you're a long-time Nextcloud encryption user, the history of how your data has migrated through different versions of Server is more relevant than it is to those experiencing this error message in more recent installations. I'm going to do by best to clear out some of the noise here and nudge this issue forward... and hopefully close it out with new dedicated issue(s) with up-to-date information where appropriate. In this way we can all make sure we're looking at problems being faced today and that we've got the appropriate information in-hand to not be blindly digging around for solutions to long ago addressed matters (or where enough has changed that the particularly old reports aren't realistic to map to today's code base or the newer report's ). After you review the below - if it still seems to you that you've encountered a bug - please open a dedicated issue with your environment's details so that things can be evaluated in today's context (not what was true 6+ years ago). I'd rather chase a few extra duplicate reports than unravel the different threads in this issue. I understand this is a PITA, but I see no other way to tackle this open issue other than by meeting it head-on. The encryption functionality in Nextcloud, which is really two completely distinct features that have little to do with each other, has evolved a lot over the years. Not everyone here is starting from the same place. Only you can assess your situation, but I'll do my best to help a bit. (Btw: There are a few things repeated here and there. In some cases I think it's helpful because everyone has different levels of comfort when the word "encryption" gets mentioned and also because I don't have the time to nicely edit this down -- I'm hoping to focus that energy in a more scalable way on the documentation itself rather than here). Let's get started... If you're experiencing this problem today in a fairly new installation, please confirm this isn't a configuration matter (which is usually fairly easy to resolve... once you're aware of the underlying cause):
But do not change anything yet! First determine the following:
Again, do not change anything yet. You need to assess your situation a bit in order to determine how to safely unravel things without impacting your data. If you've installed the WARNING: Do not disable either the
|
@joshtrichards thanks for the excellent write-up. Hopefully that will help folks distinguish one bug from another. Since the error messages are all similar, I think that's why there's some issue bleed-over. For those of us unfamiliar with the detailed inner-workings of Nextcloud, I think we were stabbing a bit in the dark (I was!), so it's great that you made that post. 😊 For me, the issues I am facing are when using S3 + server side encryption. I detailed the issues in #41992 therefore I will keep future comments on that issue instead of this one. I ended up switching to SSE which works great, although not the preferred encryption method. |
Same issue here: S3 buckets as Primary storage with OIDC. So, I guess one master-key and no E2EE.
|
this works perfectly |
Steps to reproduce
Expected behaviour
Default encrytion module should be enable and work without problems. No clue why changing password is necessary.
Actual behaviour
At login an error message pops up saying: "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files"
Trying to change the password is not possible, because an old password that could be entered never has been set. This even holds true for fresh accounts that are set up after enabling Default encryption module.
See discussion here: https://help.nextcloud.com/t/invalid-private-key-for-encryption-app-please-update-your-private-key-password-in-your-personal-settings-to-recover-access-to-your-encrypted-files/27108/13
Server configuration
Operating system:
Web server:
shared hoster
Database:
mysql 5.6.34
PHP version:
5.6
Nextcloud version: (see Nextcloud admin page)
13.0.0
Updated from an older Nextcloud/ownCloud or fresh install:
from 12.0.5
Where did you install Nextcloud from:
updater
Signing status:
Signing status
Nextcloud configuration:
Config report
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder
Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM
oc_appconfig
WHEREappid
= 'user_ldap';Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.
Insert your webserver log here
Insert your Nextcloud log here
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
The text was updated successfully, but these errors were encountered: