Migration to new format fails with above Exception.
Workaround
see https://github.com/cryptomator/cryptomator/issues/435#issuecomment-273519573
```2017-01-18 08:06:50,521 INFO [UpgradeStrategy:44] Upgrading C:\path\CryptoVault from 4 to 5.
2017-01-18 08:06:50,677 INFO [UpgradeStrategy:53] Backuped masterkey.
2017-01-18 08:06:50,680 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d.DAV.state_for_dir.dir.
2017-01-18 08:06:50,681 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d.DAV.state_for_dir.pag.
2017-01-18 08:06:50,683 INFO [UpgradeVersion4to5:75] Starting migration of C:\path\CryptoVault\d\32\DSIHQSZ44OCM7LOUYZNJJV6XSJYH2G\7EY55UHFP5XDIRMWEEERLCU5UJ77JNQPTIS2PZB4WNYBYQB3QRONKRROJJQ3UTHRMAY4PK7FKST4NSPSJHF7QJY=...
2017-01-18 08:06:50,684 INFO [UpgradeVersion4to5:81] Header read
2017-01-18 08:06:50,689 INFO [UpgradeVersion4to5:85] Skipping already migrated file
2017-01-18 08:06:50,690 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B.DAV.state_for_dir.dir.
2017-01-18 08:06:50,691 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B.DAV.state_for_dir.pag.
2017-01-18 08:06:50,692 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5.DAV.state_for_dir.dir.
2017-01-18 08:06:50,693 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5.DAV.state_for_dir.pag.
2017-01-18 08:06:50,693 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5.DAV\3UNZM5ETFWDU2VJV4ZKEXWZWFBEUI34XWCRCBR2IEOT2CYQEXA6QSIMTNKGGWB3PX5NQB4M7M2DA====.dir.
2017-01-18 08:06:50,694 INFO [UpgradeVersion4to5:75] Starting migration of C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5.DAV\3UNZM5ETFWDU2VJV4ZKEXWZWFBEUI34XWCRCBR2IEOT2CYQEXA6QSIMTNKGGWB3PX5NQB4M7M2DA====.pag...
2017-01-18 08:06:50,695 INFO [UpgradeVersion4to5:81] Header read
2017-01-18 08:06:50,701 ERROR [AsyncTaskService:127] Uncaught exception
org.cryptomator.cryptolib.api.AuthenticationFailedException: Header MAC doesn't match.
at org.cryptomator.cryptolib.v1.FileHeaderCryptorImpl.decryptHeader(FileHeaderCryptorImpl.java:108) ~[cryptolib-1.0.7.jar:?]
at org.cryptomator.ui.model.UpgradeVersion4to5.migrate(UpgradeVersion4to5.java:82) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.model.UpgradeVersion4to5.access$100(UpgradeVersion4to5.java:32) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.model.UpgradeVersion4to5$1.visitFile(UpgradeVersion4to5.java:59) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.model.UpgradeVersion4to5$1.visitFile(UpgradeVersion4to5.java:54) ~[Cryptomator-1.2.3.jar:1.2.3]
at java.nio.file.Files.walkFileTree(Files.java:2670) ~[?:1.8.0_112]
at java.nio.file.Files.walkFileTree(Files.java:2742) ~[?:1.8.0_112]
at org.cryptomator.ui.model.UpgradeVersion4to5.upgrade(UpgradeVersion4to5.java:54) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.model.UpgradeStrategy.upgrade(UpgradeStrategy.java:55) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.controllers.UpgradeController.lambda$upgrade$1(UpgradeController.java:111) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.util.AsyncTaskService.lambda$asyncTaskOf$0(AsyncTaskService.java:32) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$null$6(AsyncTaskService.java:89) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.util.AsyncTaskService.logExceptions(AsyncTaskService.java:118) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.util.AsyncTaskService.access$100(AsyncTaskService.java:19) ~[Cryptomator-1.2.3.jar:1.2.3]
at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$run$7(AsyncTaskService.java:87) ~[Cryptomator-1.2.3.jar:1.2.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
#### upgrade.log
```2017-01-18 08:06:50,521 INFO [UpgradeStrategy:44] Upgrading C:\path\CryptoVault from 4 to 5.
2017-01-18 08:06:50,677 INFO [UpgradeStrategy:53] Backuped masterkey.
2017-01-18 08:06:50,680 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\.DAV\.state_for_dir.dir.
2017-01-18 08:06:50,681 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\.DAV\.state_for_dir.pag.
2017-01-18 08:06:50,683 INFO [UpgradeVersion4to5:75] Starting migration of C:\path\CryptoVault\d\32\DSIHQSZ44OCM7LOUYZNJJV6XSJYH2G\7EY55UHFP5XDIRMWEEERLCU5UJ77JNQPTIS2PZB4WNYBYQB3QRONKRROJJQ3UTHRMAY4PK7FKST4NSPSJHF7QJY=...
2017-01-18 08:06:50,684 INFO [UpgradeVersion4to5:81] Header read
2017-01-18 08:06:50,689 INFO [UpgradeVersion4to5:85] Skipping already migrated file
2017-01-18 08:06:50,690 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\.DAV\.state_for_dir.dir.
2017-01-18 08:06:50,691 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\.DAV\.state_for_dir.pag.
2017-01-18 08:06:50,692 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5\.DAV\.state_for_dir.dir.
2017-01-18 08:06:50,693 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5\.DAV\.state_for_dir.pag.
2017-01-18 08:06:50,693 INFO [UpgradeVersion4to5:61] Skipping irrelevant file C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5\.DAV\3UNZM5ETFWDU2VJV4ZKEXWZWFBEUI34XWCRCBR2IEOT2CYQEXA6QSIMTNKGGWB3PX5NQB4M7M2DA====.dir.
2017-01-18 08:06:50,694 INFO [UpgradeVersion4to5:75] Starting migration of C:\path\CryptoVault\d\3B\W3HJEO5XYHDNTOWKOVBC2VDDUQSFA5\.DAV\3UNZM5ETFWDU2VJV4ZKEXWZWFBEUI34XWCRCBR2IEOT2CYQEXA6QSIMTNKGGWB3PX5NQB4M7M2DA====.pag...
2017-01-18 08:06:50,695 INFO [UpgradeVersion4to5:81] Header read
```C:\Users\root\AppData\Roaming\Cryptomator>java -jar sanitizer-0.4.jar -vault C:\path\CryptoVault
Output file(s) exist. Overwrite [Y|n]?
Vault password:
Scanning vault structure may take some time. Be patient...
Wrote structure to CryptoVault.structure.txt.
Checking the vault may take some time. Be patient...
Found 0 problem(s):
See CryptoVault.check.txt for details.
Done.
#### CryptoVault.check.txt
0 problem(s) found.
INFO RootExists d\PQ\XIGHM2Z64FGODMH3KB6VV5V5QM23H6
```
It looks like Cryptomator is trying to upgrade the contents of .DAV folders that apparently have .dir and .pag files. Sanitizer is probably smart enough to skip them, that's why it's not finding any errors.
I don't know the significance of the .DAV folders. Maybe they can just be deleted, but I assume these folders are all over the place. Where is the cloud storage service located and how are you connected to it? I've actually never seen this before.
We have to look over our upgrade routine again and ignore these folders in a future update.
Thx for the quick reply!
I'm using Telekom's MagentaCloud software to sync my encrypted data to the cloud. MagentaCloud is essentially a WebDAV client/server system.
Oviously the .DAV folders containing the .dir and .pag files are created by the MagentaCloud software. A little reasearch on the web suggests that these files contain information related to WebDAV. I'm not sure wether these files can be deleted safely. IMHO you're quite right: The upgrade routine should ignore all files and directories not associated to the vault.
Okay, I'm not sure either. We'll fix that with the next version. Unfortunately, I don't know how long it will take us to release it. Luckily, your vault hasn't been migrated yet. Well, except for one file: \d\32\DSIHQSZ44OCM7LOUYZNJJV6XSJYH2G\7EY55UHFP5XDIRMWEEERLCU5UJ77JNQPTIS2PZB4WNYBYQB3QRONKRROJJQ3UTHRMAY4PK7FKST4NSPSJHF7QJY=
I'm not exactly sure, but MagentaCloud should have a "restore" function. You could try it with the MagentaCloud software, but if it doesn't have any restore function, check out their web portal. After restoring that file, your vault should be in the "old state". Continue using 1.1.4 until we've released an update. You can download old versions from https://cryptomator.org/downloads/#allVersions
After a backup of my vault data I deleted all .DAV directories and gave the migration another start.
After that migration finished successfully and MagentaCloud client synced all data.
As a temporary work-around until you guys come up with a new version I recommend the following procedure for a successful migration of a vault synced with MagentaCloud:
.DAV directories in the vault file structureIf anything goes wrong:
Most helpful comment
After a backup of my vault data I deleted all
.DAVdirectories and gave the migration another start.After that migration finished successfully and MagentaCloud client synced all data.
Conclusion
As a temporary work-around until you guys come up with a new version I recommend the following procedure for a successful migration of a vault synced with MagentaCloud:
.DAVdirectories in the vault file structureIf anything goes wrong: