The Basics
- Nextcloud Server version:
- 33.0.3
- Operating system and version:
- Arch Linux
- Web server and version:
- Apache 2.4.66
- PHP version:
- 8.5.5
- Installation method
- Archive
- Are you using CloudfIare, mod_security, or similar?
- No
Summary of the issue you are facing:
I’m using Nextcloud with user key encryption (occ encryption:disable-master-key) and when trying to migrate data from google drive using the Google Integration app I’ve got the exception PrivateKeyMissingException.
I think it’s not an error, because the data import process is running in the background and may be it couldn’t get the user encryption key, but I want to know if there’s any workaround for importing all my data.
I’ve looked for creating an unencrypted directory with no luck.
I’ve created a public shared directory. I can write on it with an unlogged user but got the same exception when importing from drive on this directory.
So if anyone knows how to solve this issue please tell me.
Thanks.
Steps to replicate it:
-
Install Google Integration app on Nextcloud server.
-
Create a project on google console for oauth2 authentication with drive access permissions. Copy the client and key.
-
Configure Google Integration app on Nextcloud server with client and key from google.
-
Connect to your google account and import your drive data.
Log entries
Nextcloud
{"reqId":"MR8NXJXlCBY829lXPzZa","level":2,"time":"2026-04-30T08:43:18+00:00","remoteAddr":"","user":"xxxxx","app":"integration_google","method":"","url":"--","scriptName":"/srv/http/nextcloud/cron.php","message":"Error while importing file","userAgent":"--","version":"33.0.2.2","occ_command":["/srv/http/nextcloud/cron.php"],"exception":{"Exception":"OCA\\Encryption\\Exceptions\\PrivateKeyMissingException","Message":"Private Key missing for user: please try to log-out and log-in again","Code":0,"Trace":[{"file":"/srv/http/nextcloud/apps/encryption/lib/KeyManager.php","line":383,"function":"getPrivateKey","class":"OCA\\Encryption\\Session","type":"->","args":[]},{"file":"/srv/http/nextcloud/apps/encryption/lib/Crypto/Encryption.php","line":130,"function":"getFileKey","class":"OCA\\Encryption\\KeyManager","type":"->","args":["/xxxxx/files/Google Drive/vir/curso_telescopios_25-26/Centro-de-Entrenamiento-en-Robotica-Espacial-Educativa.pdf",null,false]},{"file":"/srv/http/nextcloud/lib/private/Files/Stream/Encryption.php","line":228,"function":"begin","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["/xxxxx/files/Google Drive/vir/curso_telescopios_25-26/Centro-de-Entrenamiento-en-Robotica-Espacial-Educativa.pdf","xxxx","w",[],{"users":["xxxxx"],"public":false}]},{"function":"stream_open","class":"OC\\Files\\Stream\\Encryption","type":"->","args":["ocencryption://","w",0,null]},{"file":"/srv/http/nextcloud/lib/private/Files/Stream/Encryption.php","line":156,"function":"fopen","args":["ocencryption://","w",false,null]},{"file":"/srv/http/nextcloud/lib/private/Files/Stream/Encryption.php","line":131,"function":"wrapSource","class":"OC\\Files\\Stream\\Encryption","type":"::","args":[null,null,"ocencryption","OC\\Files\\Stream\\Encryption","w"]},{"file":"/srv/http/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":363,"function":"wrap","class":"OC\\Files\\Stream\\Encryption","type":"::","args":[null,"files/Google Drive/vir/curso_telescopios_25-26/Centro-de-Entrenamiento-en-Robotica-Espacial-Educativa.pdf","/xxxxx/files/Google Drive/vir/curso_telescopios_25-26/Centro-de-Entrenamiento-en-Robotica-Espacial-Educativa.pdf",[],"xxxxx",{"__class__":"OCA\\Encryption\\Crypto\\Encryption"},{"__class__":"OC\\Files\\Storage\\Wrapper\\Quota","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null},....
Configuration
Nextcloud
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"my.domain"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "33.0.2.2",
"overwrite.cli.url": "https:\/\/my.domain",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"config_preset": 2,
"mail_smtpmode": "sendmail",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"mail_smtptimeout": 10,
"mail_smtpsecure": "",
"mail_smtpauth": false,
"mail_smtpauthtype": "LOGIN",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"twofactor_enforced": "false",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [],
"defaultapp": "files",
"maintenance": false,
"maintenance_window_start": 1,
"localstorage.allowsymlinks": true,
"skeletondirectory": "",
"default_language": "es",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"timeout": 0
},
"app_install_overwrite": [],
"theme": "",
"loglevel": 2,
"logfile": "\/var\/log\/nextcloud\/nextcloud.log",
"logfile_audit": "\/var\/log\/nextcloud\/audit.log",
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"updatedirectory": "\/home\/http\/nc_backups"
}
}
Apps
Enabled:
- activity: 6.0.0
- announcementcenter: 7.3.0
- bruteforcesettings: 6.0.0
- calendar: 6.2.3
- circles: 33.0.0
- cloud_federation_api: 1.17.0
- contacts: 8.4.5
- contactsinteraction: 1.14.1
- dav: 1.36.0
- encryption: 2.21.0
- federatedfilesharing: 1.23.0
- files: 2.5.0
- files_downloadlimit: 5.1.0
- files_pdfviewer: 6.0.0
- files_reminders: 1.6.0
- files_sharing: 1.25.2
- files_trashbin: 1.23.0
- files_versions: 1.26.0
- guests: 4.7.0
- integration_google: 4.3.1
- integration_overleaf: 2.0.1
- logreader: 6.0.0
- lookup_server_connector: 1.21.0
- nextcloud_announcements: 5.0.0
- notifications: 6.0.0
- oauth2: 1.21.0
- password_policy: 5.0.0
- photos: 6.0.0
- privacy: 5.0.0
- profile: 1.2.0
- provisioning_api: 1.23.0
- recommendations: 6.0.0
- related_resources: 4.0.0
- serverinfo: 5.0.0
- settings: 1.16.0
- sharebymail: 1.23.0
- support: 5.0.0
- survey_client: 5.0.0
- text: 7.0.0
- theming: 2.8.0
- twofactor_backupcodes: 1.22.0
- twofactor_totp: 15.0.0
- updatenotification: 1.23.0
- user_status: 1.13.0
- viewer: 6.0.0
- weather_status: 1.13.0
- webhook_listeners: 1.5.0
- workflowengine: 2.15.0
Disabled:
- admin_audit: 1.23.0
- app_api: 33.0.0 (installed 32.0.0)
- comments: 1.23.0 (installed 1.22.0)
- dashboard: 7.13.0 (installed 7.12.0)
- federation: 1.23.0 (installed 1.22.0)
- files_external: 1.25.1 (installed 1.24.0)
- firstrunwizard: 6.0.0 (installed 5.0.0-dev.0)
- suspicious_login: 11.0.0
- systemtags: 1.23.0 (installed 1.22.0)
- twofactor_nextcloud_notification: 7.0.0
- user_ldap: 1.24.0