Cannot open files in Android App ("Ein Fehler ist aufgetreten")

Hi all,

I’m new to Cryptomator, installed it on two Windows Desktop computers and my Android smartphone. While everything works fine on Windows, when I try to open files in my vaults in the Android App, I get the (German) error message “Ein Fehler ist aufgetreten” (“An error occured”).

This is what I did:

  • Installed latest version from Google Play Store (Cryptomator 1.7.5).
  • Added two vaults from OneDrive (which I created on my desktop) by picking the corresponding master keys.
  • Opened the vaults in the app, browse folders and files.
  • Now, when I try to open a file, I get the error message mentioned above. I tried dozens of files. Strangely, I could access two .xlsx and a .txt file, but these are rare exceptions. I got errors with all others (including all jpgs an pdfs I tested).

Is this a known issue? Any idea what might be causing this and what I could do to solve it?

Any help will be much appreciated!

Thanks,
Nina

Hey and welcome to the Cryptomator Community :slightly_smiling_face:,

Not I’m aware of. Can you please enable debug mode, reproduce the problem and send us the log file? How do I enable debug mode on Android?

Thank you :slight_smile:

Hey SailReal,

thanks a lot for your quick response and for looking into this! I sent the log file a minute ago. For reproducing the bug, I tried to open a number of files which failed again, plus a txt file that could be opened fine. Please let me know if you need anything else!

Thanks,
Nina

Wow that looks very strange :thinking:, the good but also bad thing is, I have never seen this error message before, will have to do some research:

java.lang.IllegalStateException: Buffer allocated for reported output size apparently not big enough.
	at org.cryptomator.cryptolib.v2.FileContentCryptorImpl.decryptChunk(FileContentCryptorImpl.java:146)
	at org.cryptomator.cryptolib.v2.FileContentCryptorImpl.decryptChunk(FileContentCryptorImpl.java:95)
	at org.cryptomator.cryptolib.v2.FileContentCryptorImpl.decryptChunk(FileContentCryptorImpl.java:78)
	at org.cryptomator.cryptolib.common.DecryptingReadableByteChannel.loadNextCleartextChunk(DecryptingReadableByteChannel.java:119)
	at org.cryptomator.cryptolib.common.DecryptingReadableByteChannel.readInternal(DecryptingReadableByteChannel.java:90)
	at org.cryptomator.cryptolib.common.DecryptingReadableByteChannel.read(DecryptingReadableByteChannel.java:78)
	at org.cryptomator.data.cloud.crypto.CryptoImplDecorator.read(CryptoImplDecorator.kt:322)
	at org.cryptomator.data.cloud.crypto.CryptoCloudContentRepository.read(CryptoCloudContentRepository.kt:95)
	at org.cryptomator.data.cloud.crypto.CryptoCloudContentRepository.read(CryptoCloudContentRepository.kt:21)
	at org.cryptomator.data.repository.DispatchingCloudContentRepository.read(DispatchingCloudContentRepository.kt:160)
	at org.cryptomator.domain.usecases.cloud.DownloadFiles.execute(DownloadFiles.java:32)
	at org.cryptomator.domain.usecases.cloud.DownloadFilesUseCase$Launcher$2.subscribe(DownloadFilesUseCase.java:99)
	at io.reactivex.internal.operators.flowable.FlowableFromPublisher.subscribeActual(FlowableFromPublisher.java:29)
	at io.reactivex.Flowable.subscribe(Flowable.java:14935)
	at io.reactivex.Flowable.subscribe(Flowable.java:14882)
	at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:764)
Caused by: javax.crypto.ShortBufferException: Need at least 32784 bytes of space in output buffer
	at javax.crypto.CipherSpi.bufferCrypt(CipherSpi.java:759)
	at javax.crypto.CipherSpi.engineDoFinal(CipherSpi.java:730)
	at javax.crypto.Cipher.doFinal(Cipher.java:2350)
	at org.cryptomator.cryptolib.v2.FileContentCryptorImpl.decryptChunk(FileContentCryptorImpl.java:142)
	... 20 more

ErrorCode: 5DH8:1KBG

If you notice any pattern that may help in the search, please feel free to comment.

Hi all,

I´m also new to Cryptomator and I have exactly the same issue like Nina.
What I noticed is that files with smaller size I can open. With smaller size I mean for example 9 kB, 19 kB and 29 kB. Larger files with 56 kB, 68 kB or more on the other hand do not work.
And that is what the logfile shows. It is an “ShortBufferException” with message “Need at least 32784 bytes of space in output buffer”
Perhaps the solution is to higher the output buffer?

@nikreutz and @IMike what Android API level or version do you use?

Hi SailRail,
I use Android version 9 (not the latest, I know …). IMike, thanks for mentioning that file size might be an issue. I checked this over here and noticed that I also can open files up to 29 kB, but files larger than 30/32 kB (?) seem to fail.
Thanks again for looking into this!
Nina

My software is up to date. I am using Android version 9. Buildnumber PPR1.180610.011.A530FXXULCUK6

Thank you very much for reporting this bug. We found the cause, will fix it and provide an update ASAP. See Using GCM decrypting the file content fails for files >32kB on Android API level pre 29 (version 9 and below) · Issue #479 · cryptomator/android · GitHub for further details and insights, also some workarounds are mentioned :slight_smile:

Terrific, thanks to you & your team! Really appreciate your fast reaction. Great experience, will be happy to recommend Cryptomator :slight_smile:

1 Like

@nikreutz and @IMike as you can see in Using GCM decrypting the file content fails for files >32kB on Android API level pre 29 (version 9 and below) · Issue #479 · cryptomator/android · GitHub, we fixed the problem already.

We’re planning to push the update within the next few days, we still need to do a lot of testing for the 1.8.0. If everything is going well, we will publish 1.8.0-beta2 tomorrow and the release version on Monday.

If you want to try out the GCM fix, I uploaded here an debug build of the APK: https://static.cryptomator.org/tmp/presentation-apkstore-debug-1.8.0-gcm-fix-SNAPSHOT.apk
The Sha256 of this file is 50554892dc23cfd9db0d751a731cd7d2483258b377756bbb8c570196fbdc3482. Please verify after downloading.
It does have a different package name so you can install it next to the release version. They do not share settings etc.

If you do not have a license key please let me know. And if you test it, we are very curious about your feedback.

Thanks, @SailReal, I’d be happy to try out the fix! I downloaded the apk but don’t have an individual license key (bought Cryptomator at Google Play Store). If you could send me one, that would be great :slight_smile:

If you choose to do so, please send to the email address I used to send you the Android Error Report.

Just sent you a direct message :slight_smile:

Thanks! The key worked fine. However, when I try to add an existing vault (on OneDrive), I get an empty page (see screenshot). If I tap on the “plus” icon, it says “Ein Fehler ist aufgetreten.” Sorry - any idea what I should do differently?

Hmm that looks not good. Can you please enable debug mode, reproduce it and send us the log again?

Edit: I might know the cause. Is it possible that you block the network connection for this app? Because I see this generic error message when I try to add an OneDrive cloud in flight-mode. Will fix it but it would be awesome if you could check the network connection.

Edit2: Or update the app with this new APK, then you should get an better error message if there is an network problem while creating a new OneDrive cloud connection: https://static.cryptomator.org/tmp/presentation-apkstore-debug-1.8.0-gcm-fix-SNAPSHOT2.apk
The SHA256 of this file is 26858153df902fdc48377bed57bf4293f3660622ae4786ad7d0682bf4619fe17.

Thanks for the log file. I see Microsoft now objects to having these two versions of Cryptomator (Debug and Release) on your phone at the same time…good to know. Then we can’t test it so easy because you have to uninstall the release version which you have to set up again afterwards…we have tested a lot today and will publish the version as 1.8.0-beta2 now but thanks again for reporting and testing!

com.microsoft.identity.client.exception.MsalClientException: More than one app is listening for the URL scheme defined for BrowserTabActivity in the AndroidManifest. The package name of this other app is: org.cryptomator
	at com.microsoft.identity.client.PublicClientApplicationConfiguration.validateCustomTabRedirectActivity(PublicClientApplicationConfiguration.java:644)
	at com.microsoft.identity.client.PublicClientApplicationConfiguration.checkIntentFilterAddedToAppManifestForBrokerFlow(PublicClientApplicationConfiguration.java:661)
	at com.microsoft.identity.client.PublicClientApplication.initializeApplication(PublicClientApplication.java:1073)
	at com.microsoft.identity.client.PublicClientApplication.<init>(PublicClientApplication.java:1057)
	at com.microsoft.identity.client.MultipleAccountPublicClientApplication.<init>(MultipleAccountPublicClientApplication.java:67)
	at com.microsoft.identity.client.PublicClientApplication$9.onTaskCompleted(PublicClientApplication.java:939)
	at com.microsoft.identity.client.PublicClientApplication$9.onTaskCompleted(PublicClientApplication.java:925)
	at com.microsoft.identity.common.java.controllers.CommandDispatcher.commandCallbackOnTaskCompleted(CommandDispatcher.java:562)
	at com.microsoft.identity.common.java.controllers.CommandDispatcher.access$1000(CommandDispatcher.java:86)
	at com.microsoft.identity.common.java.controllers.CommandDispatcher$4.run(CommandDispatcher.java:538)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7050)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

ErrorCode: 7AAC:R3I3

I uninstalled the regular Cryptomator version and tested the latest beta on my phone - and as far as I can tell, everything is working fine, now! Thanks again for taking care of this so quickly, great experience! :smile:

1 Like

Wooooow thank you very much for testing and confirming that it works now. We just published 1.8.0-beta2, hopefully Google reviews this version fast so that we get enough feedback over the weekend and can publish on Monday v1.8.0 :crossed_fingers:

A post was split to a new topic: Cannot open files in Android App (“Ein Fehler ist aufgetreten”) due to Unauthentic ciphertext