ios icon indicating copy to clipboard operation
ios copied to clipboard

Files app hangs when there is is a vault backed by an SMB share and the connection is offline

Open orazioedoardo opened this issue 3 years ago • 5 comments

Please agree to the following

Summary

Summarized in the title

System Setup

  • iOS: 15.3.1 (latest as of the time of writing)
  • Cryptomator: 2.12

Cloud Type

Other File Provider

Steps to Reproduce

  1. Open the Files app
  2. Tap the icon on the top-right -> connect to server
  3. Connect to an SMB share (smb://hostname/share)
  4. Open Cryptomator
  5. Add or create a vault on said share
  6. Work with the vault
  7. Turn on airplane mode
  8. Open a file (any file in the Files app, obviously files in the vault are not available while the connection is off).

Expected Behavior

The file opens

Actual Behavior

The file doesn't open. If I navigate back in the directory tree, then I'm are also unable to open other folders: the Files app starts freezing. After 30 seconds or more the app "reset" itself, automatically opened the file I tried to view and started being usable again while offline.

However, from now on, both Cryptomator and the Files app are somehow "bricked". Going to the SMB share location in the Files app reveals that (translated):

The content is unavailable
Unable to show the content of the folder because of an unknown error.

(retrying doesn't work, same message)

Going to the Cryptomator vault reveals the same message. Thinking this was some glitch caused by the connection not being available before, I've ejected the share and reconnected. Then I opened the Cryptomator section in the Files but it just shows just an infinite loading screen. I went to the Cryptomator app and tried to lock the vault, then unlocked via the Files app, and another error showed up (from the Cryptomator extension):

Error
No file provider found with the identifier com.apple.SMBClientProvider.FileProvider.

I've also seen the error

Error
Unable to communicate with a support application

but I'm unable to reproduce now.

The only way to fix is to remove the vault and add it again.

Reproducibility

Always

Relevant Log Output

No response

Anything else?

I thought the freeze was due to a bug in the Files app itself, so I tried to remove the Cryptomator vault and see if the app freezes when an SMB share is mounted and the app is used offline, but it doesn't. IMHO when the device is offline, Cryptomator still tries to access files in the vault (whether it is unlocked or not), over and over, maybe filling the process memory, until the extension crashes.

This does not happen when other file providers like iCloud Drive are used, but I think Apple has a role in this issue as the integrated network share location is not very reliable and on its own.

orazioedoardo avatar Mar 03 '22 15:03 orazioedoardo

Thank you for your bug report! Cryptomator doesn't exactly have offline support though. I wonder if #144 would solve some of the issues you've reported. However, I'm not so sure because the SMB share is a file provider itself, which would need offline access capabilities.

Will have to investigate how Cryptomator is involved in freezing/bricking stuff. Quick question: You've mentioned that removing/adding the vault is the only way to fix this issue. At what point did you turn off airplane mode in that process? Does turning it off not restore everything or help at all?

tobihagemann avatar Mar 04 '22 08:03 tobihagemann

Thank you for your bug report! Cryptomator doesn't exactly have offline support though.

I have noticed it. Having access to cached files would be useful, but it's not what this report is about.

At what point did you turn off airplane mode in that process?

Assuming I have a working unlocked vault in the Files app. I can browse the content, move files in an out, etc. If I turn on airplane mode and try to work with the Files app (any file/folder in the app really, like those stored locally on the device), then the Files app frezees after trying to open the first file.

Does turning it off not restore everything or help at all?

If I turn off airplane mode while the app is frozen, the app resets, the file opens and the vault is accessible too. However if I just wait for a while with airplane mode on like described in my first comment, the app also resets, but then the smb share and the vault are bricked, I have to remove both add add them back.

orazioedoardo avatar Mar 04 '22 10:03 orazioedoardo

I can confirm this behavior as I also tried to setup Cryptomator with a Smb share today for the first time. In the beginning it was exactly as described in this issue.

Later it became even worse: I didn't stop the connection on client side (wifi off or airplane mode) but probably the NAS went to sleep mode or something similar. I only noticed because the whole IPhone started acting weird. Safari didn't even try loading websites and the files app was frozen. Also multiple other apps had no internet connection anymore but WhatsApp still worked. Switching between airplane mode, wifi,4g made no difference. Closing the affected apps completely and restarting them had no effect. Removing the valut from the cryptomator app did also not help.

Only solution was to restart the phone. This happened three times today.

Did you find any workaround for smb shares? Is it maybe more stable if you connect the smb share over ES file explorer instead of the files app directly?

(Unfortunately I couldn't figure out how to connect to the NAS via Webdav from the Cryptomator app. I tried only within the local network and it worked flawless with ES File Explorer but in Cryptomator the authentication is loading forever and the log files contain no data of the connection attempts.)

Odrikanos avatar Dec 26 '22 00:12 Odrikanos

Did you find any workaround for smb shares?

No, I just gave up and setup a simple apache webdav server.

orazioedoardo avatar Dec 28 '22 17:12 orazioedoardo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 30 '23 09:12 github-actions[bot]