Notes cannot decrypt notes after instance migration
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 738
- Forks
- 162
- Avg merge
- 6h 2m
- Merged PRs (30d)
- 35
Description
I have moved my instalation of NC to a new machine with the same secret, salt and instance id.
All users can access everything except notes.
Steps to reproduce
- Copy over data from one VM to another, also the database. And the config.php.
- Login into the web-brower OR Android app.
- Try to open Notes app.
Expected behaviour
Notes can be loaded and viewed.
Actual behaviour
Many expections with error: Error from Nextcloud server: OCA\Encryption\Exceptions\MultiKeyDecryptException . In details of logs I see data too large for modulus.
Screenshots
Server
Please complete the following information.
- Notes app version: 4.12.2
- Nextcloud version: 31.0.7
- OS: NixOS
- Web server: Nginx
- PHP version: 8.3.24
- Database: MariaDB 10.11.13
Nextcloud configuration:
{
"system": {
"apps_paths": [
{
"path": "\/nix\/store\/bv8abw7vi32g1ca15rvbc0hv4f2sf9ik-nextcloud-31.0.7-with-apps\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/nix\/store\/bv8abw7vi32g1ca15rvbc0hv4f2sf9ik-nextcloud-31.0.7-with-apps\/nix-apps",
"url": "\/nix-apps",
"writable": false
},
{
"path": "\/nix\/store\/bv8abw7vi32g1ca15rvbc0hv4f2sf9ik-nextcloud-31.0.7-with-apps\/store-apps",
"url": "\/store-apps",
"writable": true
}
],
"appstoreenabled": false,
"memcache.local": "\\OC\\Memcache\\APCu",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"default_phone_region": "BE",
"enabledPreviewProviders": [
"OC\\Preview\\BMP",
"OC\\Preview\\GIF",
"OC\\Preview\\JPEG",
"OC\\Preview\\Krita",
"OC\\Preview\\MarkDown",
"OC\\Preview\\MP3",
"OC\\Preview\\OpenDocument",
"OC\\Preview\\PNG",
"OC\\Preview\\TXT",
"OC\\Preview\\XBitmap",
"OC\\Preview\\HEIC"
],
"forwarded_for_headers": [
"HTTP_CF_CONNECTING_IP"
],
"integrity.check.disabled": true,
"log_type": "syslog",
"loglevel": 2,
"mail_sendmailmode": "pipe",
"mail_smtpmode": "sendmail",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"overwriteprotocol": "https",
"profile.enabled": false,
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0
},
"skeletondirectory": "",
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"upgrade.disable-web": true,
"user_oidc": {
"allow_multiple_user_backends": 0
},
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"version": "31.0.7.1",
"overwrite.cli.url": "https:\/\/my.domain",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"maintenance": false,
"twofactor_enforced": "false",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [],
"overwrite": {
"cli": {
"url": "https:\/\/my.domain"
}
},
"trusted_domains": [
"my.domain"
]
},
"apps": {
"activity": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": "filesystem"
},
"admin_audit": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "logging"
},
"app_api": {
"enabled": "yes",
"installed_version": "5.0.2",
"types": ""
},
"backgroundjob": {
"lastjob": "4"
},
"bruteforcesettings": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"calendar": {
"enabled": "yes",
"installed_version": "5.3.8",
"types": ""
},
"circles": {
"enabled": "yes",
"installed_version": "31.0.0",
"loopback_tmp_scheme": "https",
"maintenance_run": "0",
"maintenance_update": "{\"3\":1756015634,\"2\":1756016534,\"1\":1756016534}",
"migration_22": "1",
"migration_run": "0",
"types": "filesystem,dav"
},
"cloud_federation_api": {
"enabled": "yes",
"installed_version": "1.14.0",
"types": "filesystem"
},
"comments": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "logging"
},
"contacts": {
"enabled": "yes",
"installed_version": "7.2.4",
"types": "dav"
},
"contactsinteraction": {
"enabled": "yes",
"installed_version": "1.12.0",
"types": "dav"
},
"core": {
"backgroundjobs_mode": "cron",
"default_encryption_module": "OC_DEFAULT_MODULE",
"encryption_enabled": "yes",
"files_metadata_installed": "1",
"installedat": "1670164972.9979",
"lastcron": 1756016535,
"lastupdateResult": "{\"version\":\"31.0.8.1\",\"versionstring\":\"Nextcloud 31.0.8\",\"url\":\"https:\\\/\\\/download.nextcloud.com\\\/server\\\/releases\\\/nextcloud-31.0.8.zip\",\"web\":\"https:\\\/\\\/docs.nextcloud.com\\\/server\\\/31\\\/admin_manual\\\/maintenance\\\/upgrade.html\",\"changes\":\"https:\\\/\\\/updates.nextcloud.com\\\/changelog_server\\\/?version=31.0.8\",\"autoupdater\":\"1\",\"eol\":\"0\"}",
"lastupdatedat": 1756016473,
"metadataGenerationDone": true,
"moveavatarsdone": "yes",
"previewsCleanedUp": "1",
"public_files": "files_sharing\/public.php",
"public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
"updater.secret.created": 1752606319,
"vendor": "nextcloud",
"files_metadata": {
"photos-original_date_time": {
"value": null,
"type": "int",
"etag": "",
"indexed": true,
"editPermission": 0
},
"photos-size": {
"value": null,
"type": "array",
"etag": "",
"indexed": false,
"editPermission": 0
},
"photos-exif": {
"value": null,
"type": "array",
"etag": "",
"indexed": false,
"editPermission": 0
},
"photos-ifd0": {
"value": null,
"type": "array",
"etag": "",
"indexed": false,
"editPermission": 0
},
"photos-gps": {
"value": null,
"type": "array",
"etag": "",
"indexed": false,
"editPermission": 0
},
"files-live-photo": {
"value": null,
"type": "string",
"etag": "",
"indexed": false,
"editPermission": 1
},
"blurhash": {
"value": null,
"type": "string",
"etag": "6c5f97e8681a917ed2187ecd9985ca8f",
"indexed": false,
"editPermission": 0
},
"photos-place": {
"value": null,
"type": "string",
"etag": "",
"indexed": true,
"editPermission": 0
}
},
"oc.integritycheck.checker": []
},
"dashboard": {
"enabled": "yes",
"installed_version": "7.11.0",
"types": ""
},
"dav": {
"buildCalendarReminderIndex": "yes",
"buildCalendarSearchIndex": "yes",
"builtSocialSearchIndex": "yes",
"chunks_migrated": "1",
"enabled": "yes",
"installed_version": "1.33.0",
"regeneratedBirthdayCalendarsForYearFix": "yes",
"types": "filesystem"
},
"encryption": {
"enabled": "yes",
"installed_version": "2.19.0",
"masterKeyId": "master_96bd2a8f",
"publicShareKeyId": "pubShare_96bd2a8f",
"recoveryKeyId": "recoveryKey_96bd2a8f",
"types": "filesystem"
},
"federatedfilesharing": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": ""
},
"federation": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "authentication"
},
"files": {
"enabled": "yes",
"installed_version": "2.3.1",
"mimetype_version": "31.0.7.1",
"types": "filesystem"
},
"files_downloadlimit": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"files_pdfviewer": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"files_reminders": {
"enabled": "yes",
"installed_version": "1.4.0",
"types": ""
},
"files_rightclick": {
"enabled": "no",
"installed_version": "1.6.0",
"types": ""
},
"files_sharing": {
"enabled": "yes",
"installed_version": "1.23.1",
"types": "filesystem"
},
"files_trashbin": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "filesystem,dav"
},
"files_versions": {
"enabled": "yes",
"installed_version": "1.24.0",
"types": "filesystem,dav"
},
"firstrunwizard": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"gpxpod": {
"enabled": "no",
"installed_version": "5.0.18",
"types": ""
},
"logreader": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": "logging"
},
"lookup_server_connector": {
"enabled": "yes",
"installed_version": "1.19.0",
"types": "authentication"
},
"mail": {
"enabled": "no",
"installed_version": "5.3.1",
"types": ""
},
"maps": {
"enabled": "no",
"installed_version": "1.6.0",
"types": "filesystem"
},
"nextcloud_announcements": {
"enabled": "yes",
"installed_version": "3.0.0",
"pub_date": "Thu, 24 Oct 2019 00:00:00 +0200",
"types": "logging"
},
"notes": {
"enabled": "yes",
"installed_version": "4.12.2",
"types": ""
},
"notifications": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": "logging"
},
"oauth2": {
"enabled": "yes",
"installed_version": "1.19.1",
"types": "authentication"
},
"password_policy": {
"enabled": "yes",
"enforceUpperLowerCase": "0",
"installed_version": "3.0.0",
"types": "authentication"
},
"photos": {
"enabled": "yes",
"installed_version": "4.0.0",
"lastPlaceMappedUser": "thiago",
"lastPlaceMappingDone": "true",
"types": "dav,authentication"
},
"privacy": {
"enabled": "yes",
"fullDiskEncryptionEnabled": "1",
"installed_version": "3.0.0",
"types": ""
},
"profile": {
"enabled": "yes",
"installed_version": "1.0.0",
"types": ""
},
"provisioning_api": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "prevent_group_restriction"
},
"recommendations": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"related_resources": {
"enabled": "yes",
"installed_version": "2.0.0",
"types": ""
},
"serverinfo": {
"cached_count_appdata_files": 81652,
"cached_count_filecache": 278000,
"cached_count_storages": 10,
"enabled": "yes",
"installed_version": "3.0.0",
"size_appdata_storage": -1,
"types": ""
},
"settings": {
"enabled": "yes",
"installed_version": "1.14.0",
"types": ""
},
"sharebymail": {
"enabled": "yes",
"installed_version": "1.21.0",
"types": "filesystem"
},
"support": {
"SwitchUpdaterServerHasRun": "yes",
"enabled": "yes",
"installed_version": "3.0.0",
"types": "session"
},
"survey_client": {
"enabled": "yes",
"installed_version": "3.0.0",
"last_report": "{\"id\":\"ocdexmgq5piy\",\"items\":[[\"server\",\"version\",\"31.0.7.1\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"\\\\OC\\\\Memcache\\\\Redis\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"8.2.29\"],[\"php\",\"memory_limit\",-1],[\"php\",\"max_execution_time\",0],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"mysql\"],[\"database\",\"version\",\"10.11.11\"],[\"database\",\"size\",367345664],[\"apps\",\"activity\",\"4.0.0\"],[\"apps\",\"admin_audit\",\"1.21.0\"],[\"apps\",\"app_api\",\"5.0.2\"],[\"apps\",\"bruteforcesettings\",\"4.0.0\"],[\"apps\",\"calendar\",\"5.3.6\"],[\"apps\",\"circles\",\"31.0.0\"],[\"apps\",\"cloud_federation_api\",\"1.14.0\"],[\"apps\",\"comments\",\"1.21.0\"],[\"apps\",\"contacts\",\"7.2.0\"],[\"apps\",\"contactsinteraction\",\"1.12.0\"],[\"apps\",\"cospend\",\"3.0.11\"],[\"apps\",\"dashboard\",\"7.11.0\"],[\"apps\",\"dav\",\"1.33.0\"],[\"apps\",\"deck\",\"1.15.1\"],[\"apps\",\"drawio\",\"3.1.0\"],[\"apps\",\"encryption\",\"2.19.0\"],[\"apps\",\"federatedfilesharing\",\"1.21.0\"],[\"apps\",\"federation\",\"1.21.0\"],[\"apps\",\"files\",\"2.3.1\"],[\"apps\",\"files_downloadlimit\",\"4.0.0\"],[\"apps\",\"files_pdfviewer\",\"4.0.0\"],[\"apps\",\"files_reminders\",\"1.4.0\"],[\"apps\",\"files_rightclick\",\"disabled\"],[\"apps\",\"files_sharing\",\"1.23.1\"],[\"apps\",\"files_trashbin\",\"1.21.0\"],[\"apps\",\"files_versions\",\"1.24.0\"],[\"apps\",\"firstrunwizard\",\"4.0.0\"],[\"apps\",\"gpxpod\",\"disabled\"],[\"apps\",\"logreader\",\"4.0.0\"],[\"apps\",\"lookup_server_connector\",\"1.19.0\"],[\"apps\",\"mail\",\"5.1.8\"],[\"apps\",\"maps\",\"disabled\"],[\"apps\",\"news\",\"26.0.2\"],[\"apps\",\"nextcloud_announcements\",\"3.0.0\"],[\"apps\",\"notes\",\"4.12.2\"],[\"apps\",\"notifications\",\"4.0.0\"],[\"apps\",\"oauth2\",\"1.19.1\"],[\"apps\",\"onlyoffice\",\"disabled\"],[\"apps\",\"password_policy\",\"3.0.0\"],[\"apps\",\"phonetrack\",\"0.8.2\"],[\"apps\",\"photos\",\"4.0.0\"],[\"apps\",\"privacy\",\"3.0.0\"],[\"apps\",\"profile\",\"1.0.0\"],[\"apps\",\"provisioning_api\",\"1.21.0\"],[\"apps\",\"recommendations\",\"4.0.0\"],[\"apps\",\"related_resources\",\"2.0.0\"],[\"apps\",\"serverinfo\",\"3.0.0\"],[\"apps\",\"settings\",\"1.14.0\"],[\"apps\",\"sharebymail\",\"1.21.0\"],[\"apps\",\"support\",\"3.0.0\"],[\"apps\",\"survey_client\",\"3.0.0\"],[\"apps\",\"systemtags\",\"1.21.1\"],[\"apps\",\"tasks\",\"0.16.1\"],[\"apps\",\"text\",\"5.0.0\"],[\"apps\",\"theming\",\"2.6.1\"],[\"apps\",\"twofactor_backupcodes\",\"1.20.0\"],[\"apps\",\"twofactor_totp\",\"13.0.0-dev.0\"],[\"apps\",\"updatenotification\",\"1.21.0\"],[\"apps\",\"user_status\",\"1.11.0\"],[\"apps\",\"viewer\",\"4.0.0\"],[\"apps\",\"weather_status\",\"1.11.0\"],[\"apps\",\"webhook_listeners\",\"1.2.0\"],[\"apps\",\"workflowengine\",\"2.13.0\"],[\"stats\",\"num_files\",244390],[\"stats\",\"num_users\",5],[\"stats\",\"num_storages\",7],[\"stats\",\"num_storages_local\",1],[\"stats\",\"num_storages_home\",6],[\"stats\",\"num_storages_other\",0],[\"stats\",\"num_comments\",0],[\"stats\",\"num_comment_markers\",0],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",3],[\"files_sharing\",\"num_shares_user\",2],[\"files_sharing\",\"num_shares_groups\",0],[\"files_sharing\",\"num_shares_link\",1],[\"files_sharing\",\"num_shares_link_no_password\",1],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_3_17\",1],[\"files_sharing\",\"permissions_0_19\",2],[\"encryption\",\"enabled\",\"yes\"]]}",
"last_sent": "1754072402",
"types": ""
},
"suspicious_login": {
"enabled": "yes",
"installed_version": "9.0.1",
"types": "authentication"
},
"systemtags": {
"enabled": "yes",
"installed_version": "1.21.1",
"types": "logging"
},
"text": {
"enabled": "yes",
"installed_version": "5.0.0",
"types": "dav"
},
"theming": {
"enabled": "yes",
"installed_version": "2.6.1",
"types": "logging"
},
"twofactor_admin": {
"enabled": "yes",
"installed_version": "4.8.0",
"types": ""
},
"twofactor_backupcodes": {
"enabled": "yes",
"installed_version": "1.20.0",
"types": ""
},
"twofactor_nextcloud_notification": {
"enabled": "yes",
"installed_version": "5.0.0",
"types": ""
},
"twofactor_totp": {
"enabled": "yes",
"installed_version": "13.0.0-dev.0",
"types": ""
},
"twofactor_webauthn": {
"enabled": "yes",
"installed_version": "2.2.1",
"types": ""
},
"updatenotification": {
"calendar": "5.3.9",
"contacts": "7.2.5",
"core": "31.0.8.1",
"cospend": "3.0.11",
"deck": "1.15.2",
"drawio": "3.0.9",
"enabled": "yes",
"installed_version": "1.21.0",
"mail": "5.3.0",
"news": "26.1.0",
"notes": "4.12.3",
"onlyoffice": "9.1.2",
"tasks": "0.16.0",
"types": "",
"update_check_errors": 0
},
"user_status": {
"enabled": "yes",
"installed_version": "1.11.0",
"types": ""
},
"viewer": {
"enabled": "yes",
"installed_version": "4.0.0",
"types": ""
},
"weather_status": {
"enabled": "yes",
"installed_version": "1.11.0",
"types": ""
},
"webhook_listeners": {
"enabled": "yes",
"installed_version": "1.2.0",
"types": "filesystem"
},
"workflowengine": {
"enabled": "yes",
"installed_version": "2.13.0",
"types": "filesystem"
}
}
}
Client
This is a server error.
- Browser (incl. version): Chrome / Android app / Firefox, all clients
- OS: Linux, Windows or Android
Log files
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Notes 4.12.2 migration scenario and the logged OCA\Encryption\Exceptions\MultiKeyDecryptException message, especially “data too large for modulus.” Reproduce the move with the copied database and config.php, then trace whether the failure occurs through the web browser or Android app; done means notes load after migration without encryption errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript, mariadb, php
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100