Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open one folder within Cryptomator Vault in pCloud from Android #465

Closed
2 tasks done
LearningAsIGo71 opened this issue Nov 5, 2022 · 20 comments
Closed
2 tasks done
Labels
storage:pcloud type:upstream-bug Something isn't working in upstream
Milestone

Comments

@LearningAsIGo71
Copy link

LearningAsIGo71 commented Nov 5, 2022

Please agree to the following

Summary

Unable to open a vault folder on Android

System Setup

- Android: 13 (latest version of GraphenOS)
- Cryptomator: 1.7.5
- Phone: Pixel 5a

Cloud Type

pCloud

Steps to Reproduce

  1. Use Cryptomator to open vault in pCloud cloud storage
  2. Tap the Documents folder and receive error message "No network connection"

Expected Behavior

Documents folder will open.

Actual Behavior

A folder named Documents in my Cryptomator vault residing online in a pCloud drive refuses to open due to supposedly not having a network connection. However, the phone has network access as confirmed by being able to surf the Net and open any other folders within the vault (e.g. Downloads, Pictures, etc.). I have tried restarting the phone and tried on both an LTE and WiFi connections without success, although I can access the Documents folder online (it is NOT an offline folder) from my laptop without issue.

Reproducibility

Always

Relevant Log Output

No response

Anything else?

No response

@LearningAsIGo71 LearningAsIGo71 added the type:bug Something isn't working label Nov 5, 2022
@LearningAsIGo71
Copy link
Author

LearningAsIGo71 commented Nov 6, 2022

In attempting to diagnose the problem I have installed Cryptomator 1.7.5 on two additional phones:

  1. Pixel 4a running latest Graphene OS Android 13
  2. Pixel 6a running stock Google Android 13 with latest updates

As on the original Pixel 5a phone, both these phones also cannot open the Documents folder due to a supposed, "No network connection," but as before I can open any other folder and file within the vault.

@SailReal
Copy link
Member

SailReal commented Nov 6, 2022

Can you please enable debug mode, reproduce the problem and send us the log file? https://community.cryptomator.org/t/how-do-i-enable-debug-mode-on-android/66

@SailReal
Copy link
Member

SailReal commented Nov 7, 2022

Thank you for the log file. Just created the following upstream issue regarding this topic pCloud/pcloud-sdk-java#40

It sounds quiet similar to #459. Hopefully someone at the pCloud team will have a look at it soon but I'm not very optimistic about that to be honest :/

@SailReal SailReal added storage:pcloud type:upstream-bug Something isn't working in upstream and removed type:bug Something isn't working labels Nov 7, 2022
@LearningAsIGo71
Copy link
Author

Thank you for submitting this issue to pCloud.

@LearningAsIGo71
Copy link
Author

Hey check this out: From within Cryptomator on Android I moved the Documents folder to a different folder (i.e. long press Documents > Menu > Move) and now I can open the Documents folder and any subfolder or file within it! Any idea what is going on here?

@LearningAsIGo71
Copy link
Author

I couldn't figure out a way to move the Documents folder "back up" one level to its original "parent folder" in the vault on Android, so I used Windows Explorer on my desktop to do so and I am still able to access the Documents folder from Cryptomator on my Android phone as expected.

So if this is a pCloud issue why did simply moving the folder from one location to another within the vault restore my access to it?

@SailReal
Copy link
Member

SailReal commented Nov 10, 2022

Again, I'm not a pCloud developer, I can not explain to you what's going wrong on the server side and why moving changes something but let me explain the log file to you:

In
20221107084947.001 OkHttp --> GET https://api.pcloud.com/stat?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r http/1.1 (unknown length)
we ask the server to give us some stats about this file.

The server responds with
20221107084947.118 OkHttp <-- 200 OK https://api.pcloud.com/stat?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r (116ms)
which means OK, I found this file, here are some stats like the size, etc.

Then we ask give us a link where we can download this file. In pCloud you can not download the file directly but ask the server to get a link where we can download the file from. We do the request in
20221107084947.120 OkHttp --> GET https://api.pcloud.com/getfilelink?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r http/1.1 (unknown length)

The server responds with
20221107084947.186 OkHttp <-- 200 OK https://api.pcloud.com/getfilelink?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r (66ms)
which means everything OK, here is the link.

Then we ask the server to give us the content of this file from the download link in
20221107084947.189 OkHttp --> GET https://vc535.pcloud.com/dpZoXb6PPZnM1QpUZKr3h7ZYZ32cWc7Z2ZZvKVZZ1YoRvsve5EXg91BXwsggLHsfT3W7/dir.c9r http/1.1 (unknown length)

The server responds in
20221107084947.543 OkHttp <-- 404 Not Found https://vc535.pcloud.com/dpZoXb6PPZnM1QpUZKr3h7ZYZ32cWc7Z2ZZvKVZZ1YoRvsve5EXg91BXwsggLHsfT3W7/dir.c9r (352ms)
with an error that the file can not be found on the server.

The dir.c9r file is a cryptomator directory file which somehow represents a link to a directory, in this case to your Documents folder. Because we are unable to download this file, the folder can not be opened.

And just for the sake of completeness we are using the official API from pCloud and have not programmed the individual requests ourselves, only the process, which is clearly documented. That's why I highly think it must be something in the server, because a file where we requested meta data, to which we got a download link, should still exist a few hundred milliseconds later. I can't say what's going wrong in the server, that can have a lot of causes. In the end, it could be something somewhere in our system too, which I would also like better, because we could fix that, but there's currently absolutely no evidence for it.

@LearningAsIGo71
Copy link
Author

LearningAsIGo71 commented Nov 10, 2022 via email

@LearningAsIGo71
Copy link
Author

After doing the convoluted workaround documented above it continued to work for a couple weeks, but now the same folder (Documents folder) in the same vault in the same drive (pCloud) does not open due to a so-called "No network connection." This happens on both Pixel phones I have Cryptomator installed on. This bug is getting tiresome.

@LearningAsIGo71
Copy link
Author

And unlike last time, this time moving the inaccessible folder to a new location does not fix the problem. The folder is inaccessible from any Android device regardless of what I do. Thankfully I can still access it from Windows.

@georgi-neykov-hub
Copy link
Contributor

Again, I'm not a pCloud developer, I can not explain to you what's going wrong on the server side and why moving changes something but let me explain the log file to you:

In 20221107084947.001 OkHttp --> GET https://api.pcloud.com/stat?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r http/1.1 (unknown length) we ask the server to give us some stats about this file.

The server responds with 20221107084947.118 OkHttp <-- 200 OK https://api.pcloud.com/stat?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r (116ms) which means OK, I found this file, here are some stats like the size, etc.

Then we ask give us a link where we can download this file. In pCloud you can not download the file directly but ask the server to get a link where we can download the file from. We do the request in 20221107084947.120 OkHttp --> GET https://api.pcloud.com/getfilelink?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r http/1.1 (unknown length)

The server responds with 20221107084947.186 OkHttp <-- 200 OK https://api.pcloud.com/getfilelink?path=/Cryptomator%20pCloud%20FUSE/d/5I/UR4U7IDF2RZWFNVUFGHMN7IE2FTDZ4/kwFjq-_uNtDPN386UKwtD8j_QRE6yAPkBg%3D%3D.c9r/dir.c9r (66ms) which means everything OK, here is the link.

Then we ask the server to give us the content of this file from the download link in 20221107084947.189 OkHttp --> GET https://vc535.pcloud.com/dpZoXb6PPZnM1QpUZKr3h7ZYZ32cWc7Z2ZZvKVZZ1YoRvsve5EXg91BXwsggLHsfT3W7/dir.c9r http/1.1 (unknown length)

The server responds in 20221107084947.543 OkHttp <-- 404 Not Found https://vc535.pcloud.com/dpZoXb6PPZnM1QpUZKr3h7ZYZ32cWc7Z2ZZvKVZZ1YoRvsve5EXg91BXwsggLHsfT3W7/dir.c9r (352ms) with an error that the file can not be found on the server.

The dir.c9r file is a cryptomator directory file which somehow represents a link to a directory, in this case to your Documents folder. Because we are unable to download this file, the folder can not be opened.

And just for the sake of completeness we are using the official API from pCloud and have not programmed the individual requests ourselves, only the process, which is clearly documented. That's why I highly think it must be something in the server, because a file where we requested meta data, to which we got a download link, should still exist a few hundred milliseconds later. I can't say what's going wrong in the server, that can have a lot of causes. In the end, it could be something somewhere in our system too, which I would also like better, because we could fix that, but there's currently absolutely no evidence for it.

@SailReal
The issue is the expected behavior from pCloud's API, it's all about the link expiring and becoming otherwise invalid or inaccessible. I have opened a pull request that add a content link expiration handling strategy on your side.

Some details on the issue:

The link to the file's content has expired or became otherwise invalid due to a network switch, signaled with a 410 - Gone HTTP error code. Content links have a very limited lifetime and apart form the time expiration they are restricted to be used only from the IP that was used when making the API call for generating them.

The IP-switching limitation can be hit quite easily on mobile devices with multiple sources of connectivity (cellular/wifi/...) where the system will follow a strategy that aims to use the fastest and cheapest (non-metered) network present at the moment.

Please review the changes and tell me if they solve the issues.

@georgi-neykov-hub
Copy link
Contributor

georgi-neykov-hub commented Dec 2, 2022

@SailReal , the "no network" message may be selected due to how IOException are handled in the Cryptomator client. The ApiClient.download() family of methods in the SDK will throw а FileNotFoundException on encountering a 404 HTTP error while attempting to read a content link. To fix the issue with the message, maybe the handling of IOExceptions should be split to detect network-related problems, an non-exhausting example to illustrate the idea would be:

fun Throwable.isNetworkError(): Boolean {
    return this is SocketException ||
            this is SocketTimeoutException ||
            this is UnknownHostException ||
            this is SSLException
}

@LearningAsIGo71
Copy link
Author

Wondering if any progress is being made on this issue?

@LearningAsIGo71
Copy link
Author

LearningAsIGo71 commented Dec 12, 2022 via email

@SailReal
Copy link
Member

You can see in #469 we or more precisely Georgi possibly fixed it 4 days ago.

I Just build this version for you. If you have the license key version, it would be awesome if you could test if you can reproduce the problem with this patched version: presentation-apkstore-debug.zip

After downloading, please rename presentation-apkstore-debug.zip to presentation-apkstore-debug.apk, check the hash of it, the SHA256 is c9e639baa4916150fd89cf73316288969d9d4b494bed6405e21e36a9588d59ea and then install it. This app has a different package name so it will be installed next to the existing one and is completely separated.

@LearningAsIGo71
Copy link
Author

Looks like you guys have been busy trying to get this resolved for which I'm grateful. Unfortunately it is still not working on my end. I downloaded the Cryptomator above (i.e. presentation-apkstore-debug) and installed it on a new Pixel 7, but when I go to open the folder I still get a "No network connection" error. :(

@SailReal
Copy link
Member

Unfortunately it is still not working on my end. I downloaded the Cryptomator above (i.e. presentation-apkstore-debug) and installed it on a new Pixel 7, but when I go to open the folder I still get a "No network connection" error. :(

Are you completely sure that you used the test version of Cryptomator with the yellow background in the icon to verify it works? If so, can you please enable debug mode, reproduce the problem and send us the log file? https://community.cryptomator.org/t/how-do-i-enable-debug-mode-on-android/66

@LearningAsIGo71
Copy link
Author

I am using the Cryptomator with the yellow background. Log file sent.

@SailReal
Copy link
Member

I'm sorry, can you please retest with this version? You can just install it without removing the old one. SHA256 is a880185f9f226963f741e7809f5faaeb3713ce36980ded5138ffcb8682e075d0: presentation-apkstore-debug.zip

@LearningAsIGo71
Copy link
Author

LearningAsIGo71 commented Dec 13, 2022

Fantastic, IT WORKS!!! Thanks to all the time and effort of you and Georgi, pCloud with Cryptomator is now usable for me once again! Any ETA when this will be integrated into the Cryptomator repository on F-Droid?

@SailReal SailReal added this to the 1.8.0 milestone Mar 9, 2023
@SailReal SailReal closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
storage:pcloud type:upstream-bug Something isn't working in upstream
Projects
None yet
Development

No branches or pull requests

3 participants