nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.32k stars 1.78k forks source link

"Cannot upload null" with end-to-end encryption enabled #3291

Open rugk opened 6 years ago

rugk commented 6 years ago

Actual behaviour

This notification is shown: notification: "Hochladen fehlgeschlagen – Cannot upload 'null'"

And this is how it is shown in the recent uploads: uploadlist

Expected behaviour

Upload file.

Steps to reproduce

  1. Setup e2e encryption on Android in the exact same app.
  2. (Tried to) upload something in the dir in Nextcloud Desktop 2.5.0 on Fedora 29.
  3. Access dir in Android app. It shows no files… :confused:
  4. Now try to upload a small <500kB file.

Environment data

Android version: LineageOS 14.1

Stock or customized system: custom

Nextcloud app version: 3.3.2 (F-Droid)

Nextcloud server version: 14

Logs

Web server error log

I checked when the error occurred, no error logged here.

Nextcloud log (data/nextcloud.log)

I checked when the error occurred, nothing special in there.

nextcloud-android-bot commented 6 years ago

GitMate.io thinks possibly related issues are https://github.com/nextcloud/android/issues/1599 (End to end encryption - overview), https://github.com/nextcloud/android/issues/1863 (Beta end-to-end encryption missing), https://github.com/nextcloud/android/issues/2388 (Andoird end-to-end encryption having issues after upgrade), https://github.com/nextcloud/android/issues/2309 (E2E encryption : not able to re-enable a folder as E2E encrypted), and https://github.com/nextcloud/android/issues/2691 (Instant Upload not syncing after re-enabling it).

rugk commented 6 years ago

On the desktop it also does not work, BTW: https://github.com/nextcloud/desktop/issues/890

rugk commented 5 years ago

Any news here what I can do to troubleshoot/debug this, or is this "expected"??

tobiasKaminsky commented 5 years ago

It seems that somehow the setup of encryption keys failed and thus "null" is used. Can you try it with a complete new test user?

rugk commented 5 years ago

Did so and it worked with a completely new user for some reason…

I directly uploaded a file after setting it up on Android. maybe that was the big difference… :thinking: And I've only connected the broken desktop e2e setup (https://github.com/nextcloud/desktop/issues/560) after I've set it up on Android. :thinking:

rugk commented 5 years ago

Okay, on the desktop client syncing a 30kB file seems to have worked, but a 80kB file failed:

image

here is some client-side log:


[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::GetFolderEncryptStatusJob::finished   GetFolderEncryptStatus of QUrl("https://server.url:1111/subDir/remote.php/webdav") finished with status QNetworkReply::NetworkError(NoError) ""
[OCC::SocketApi::slotReadSocket     Received SocketAPI message <-- "RETRIEVE_FILE_STATUS:/local/path/to/e2e/dir.43b76200f31043bd880519b2b523a1a6.~53bf0994" from QLocalSocket(0x556ccaeb9e60)
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "STATUS:IGNORE:/local/path/to/e2e/dir.43b76200f31043bd880519b2b523a1a6.~53bf0994" to QLocalSocket(0x556ccaeb9e60)
[OCC::SocketApi::slotReadSocket     Received SocketAPI message <-- "GET_MENU_ITEMS:" from QLocalSocket(0x556ccaeb9e60)
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "GET_MENU_ITEMS:BEGIN" to QLocalSocket(0x556ccaeb9e60)
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "GET_MENU_ITEMS:END" to QLocalSocket(0x556ccaeb9e60)
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::AbstractNetworkJob::slotFinished  QNetworkReply::NetworkError(UnknownContentError) "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: " QVariant(int, 423)
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(UnknownContentError)
[OCC::WebFlowCredentials::stillValid    "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: "
[OCC::SyncJournalDb::setErrorBlacklistEntry     Setting blacklist entry for  "dir/43b76200f31043bd880519b2b523a1a6" 6 "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: " 1544277907 0 1541430936 "71c60dcb32c26d54d6d997458b226c56" "" 0
[OCC::blacklistUpdate   escalating soft error on  "dir/43b76200f31043bd880519b2b523a1a6"  to normal error,  423
[OCC::PropagateItemJob::done    Could not complete propagation of "dir/43b76200f31043bd880519b2b523a1a6" by OCC::PropagateDownloadFile(0x556ccbb1a0d0) with status 2 and error: "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: "
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "STATUS:ERROR:/local/path/to/e2e/dir43b76200f31043bd880519b2b523a1a6" to QLocalSocket(0x556ccaeb9e60)
[OCC::ActivityWidget::slotItemCompleted     Item  "dir/43b76200f31043bd880519b2b523a1a6"  retrieved resulted in  "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: "
[OCC::ActivityWidget::slotItemCompleted     Item  "dir/43b76200f31043bd880519b2b523a1a6"  retrieved resulted in error  "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: "
[OCC::ActivityListModel::addErrorToActivityList     Error successfully added to the notification list:  "Error transferring https://server.url:1111/subDir/remote.php/dav/files/userName/dir/43b76200f31043bd880519b2b523a1a6 - server replied: "
[OCC::SocketApi::slotReadSocket     Received SocketAPI message <-- "GET_MENU_ITEMS:" from QLocalSocket(0x556ccaeb9e60)
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "GET_MENU_ITEMS:BEGIN" to QLocalSocket(0x556ccaeb9e60)
[OCC::SocketListener::sendMessage   Sending SocketAPI message --> "GET_MENU_ITEMS:END" to QLocalSocket(0x556ccaeb9e60)
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::LsColJob::finished    LSCOL of QUrl("https://server.url:1111/subDir/remote.php/dav/files/rugk/") FINISHED WITH STATUS "OK"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::PropfindJob::finished     PROPFIND of QUrl("https://server.url:1111/subDir/remote.php/dav/files/userName/") FINISHED WITH STATUS "OK"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::GetFolderEncryptStatusJob::finished   GetFolderEncryptStatus of QUrl("https://server.url:1111/subDir/remote.php/webdav") finished with status QNetworkReply::NetworkError(NoError) ""
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::LsColJob::finished    LSCOL of QUrl("https://server.url:1111/subDir/remote.php/dav/files/userName/") FINISHED WITH STATUS "OK"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::AbstractNetworkJob::slotFinished  QNetworkReply::NetworkError(ContentAccessDenied) "Error transferring https://server.url:1111/subDir/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/124927?format=json - server replied: " QVariant(int, 403)
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(ContentAccessDenied)
[OCC::WebFlowCredentials::stillValid    "Error transferring https://server.url:1111/subDir/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/124927?format=json - server replied: "
[OCC::LockEncryptFolderApiJob::finished     error locking file "ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/124927" "Error transferring https://server.url:1111/subDir/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/124927?format=json - server replied: " 403
[OCC::AccessManager::createRequest  6 "PROPFIND" "https://server.url:1111/subDir/remote.php/dav/files/rugk/" has X-Request-ID "573817b5-c89f-4432-98ab-6ce37cfeefbb"
[OCC::AbstractNetworkJob::start     OCC::PropfindJob created for "https://server.url/nextcloud" + "/" "OCC::ConnectionValidator"
[OCC::AccessManager::createRequest  6 "PROPFIND" "https://server.url:1111/subDir/remote.php/dav/files/userName/" has X-Request-ID "641758e5-7d00-4890-863a-b0329ab901d9"
[OCC::AbstractNetworkJob::start     OCC::PropfindJob created for "https://server.url/nextcloud" + "/" "OCC::ConnectionValidator"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::PropfindJob::finished     PROPFIND of QUrl("https://server.url:1111/subDir/remote.php/dav/files/userName/") FINISHED WITH STATUS "OK"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::PropfindJob::finished     PROPFIND of QUrl("https://server.url:1111/subDir/remote.php/dav/files/rugk/") FINISHED WITH STATUS "OK"
[OCC::AccessManager::createRequest  6 "PROPFIND" "https://server.url:1111/subDir/remote.php/dav/files/userName/" has X-Request-ID "7adaf089-42cb-430d-9d49-e55cb1b69b4f"
[OCC::AbstractNetworkJob::start     OCC::PropfindJob created for "https://server.url/nextcloud" + "/" "OCC::QuotaInfo"
[OCC::WebFlowCredentials::slotFinished  request finished
[OCC::WebFlowCredentials::stillValid    Still valid?
[OCC::WebFlowCredentials::stillValid    QNetworkReply::NetworkError(NoError)
[OCC::WebFlowCredentials::stillValid    "Unknown error"
[OCC::PropfindJob::finished     PROPFIND of QUrl("https://server.url:1111/subDir/remote.php/dav/files/userName/") FINISHED WITH STATUS "OK"
rugk commented 5 years ago

Also got this on the server, but this may be related to the fact that I added a new client and just had to enter the e2e password(?):

image

rugk commented 5 years ago

Also this was once shown on a client (note this is really the new user!): mess

translation: …cannot be downloaded, because there are no encryption information.

spackmat commented 5 years ago

Exact the same problems here. Today I created a complete new user (with a username never used before) to be sure that my old user isn't the problem.

To reproduce the problem, I do following steps:

  1. Create a new folder in the Android App and set is as encrypted
  2. Upload a file, see it works
  3. Delete the file, see it works
  4. Upload the file again, still works
  5. Sync with Desktop Client, see and check the file, yay, seems to work, but:
  6. Try to delete the file in Andoid client: Server not reachable.
  7. Try to delete the file on Desktop: Works sometimes, sometimes provokes only sync errors
  8. Try to upload another file in that folder in Android App: Fails with unknown error or folder error (Ordnerfehler)
  9. Try to upload/sync any new file from Desktop App leads to several different errors, but never seen a working file reaching the Android App.
  10. Removing encryption in Android App works, then deleting the folder in the Webapp, too (but not from Android App).
  11. Start at 1. and repeat several times.

So when the Android App works alone, it works. When I sync with the Desktop App only once, the new folder is messed up and nothing works anymore in that folder.

Edit: Andoid App is 3.5.0 and Windows Desktop App is 2.5.1. Both also never worked in previous versions. Tried from the first beta onwards: Since the Desktop client has E2EE, the above happens.

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

spackmat commented 5 years ago

I'm pretty sure this is a problem of the desktop software, since the Android client works fine alone. There are several open issues over there, so I think this one here can be closed.

Yesterday I tried everything again with a completely new (hosted) Nextcloud-15-instance with new users and the current client versions and could reproduce the steps above: When the desktop client comes in, the encrypted folder is messed up and stops working at all.

marbetschar commented 5 years ago

@spackmat any known workaround for the desktop client e2e mess?

spackmat commented 5 years ago

@marbetschar I haven't seen one and simply consider e2ee in nextcloud as not ready. And for me, it doesn't look like this will be fixed soon, as it in broken from day 1 on.

marbetschar commented 5 years ago

@spackmat thanks for clarification. It‘s a pity, E2E seemed like a huge step forward.

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

rugk commented 5 years ago

Thanks bot for reminding us, this annoying issue is still not fixed. :cry:

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

spackmat commented 5 years ago

I love that bot and its message: "We ignored the problem for another 4 weeks, so we suggest considering it as solved."

No, it is far away from being solved. It still exists and it is still unclear, if it is only related to the windows client or if the android client is part of the problem, too. Before closing it, at least, this should be clarified.

rugk commented 5 years ago

if the android client is part of the problem, too.

It's better there, but AFAIK it also has it's problems. After all – in case you did not notice – you've commented on the issue in the Android app repo. :wink:

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

1989gironimo commented 5 years ago

Still not working.

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

1989gironimo commented 5 years ago

Still relevant

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

marbetschar commented 5 years ago

Will there be any progress in e2e in the foreseeable future?

1989gironimo commented 5 years ago

Tested it with NC 15.0.11 and the NC app (3.8.1) under Android 9 (LineageOS 16) - still not possible.

spackmat commented 5 years ago

I confirm also that this is still existent with the new desktop client v2.6.1-rc1. See, for example, this issue over there: https://github.com/nextcloud/desktop/issues/890

1989gironimo commented 5 years ago

That's the thing - Either it doesn't encrypt the files (which in my case is true) even if the folder is set to e2e or it blocks uploading files like above.

stale[bot] commented 5 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

rugk commented 5 years ago

.

1989gironimo commented 5 years ago

I should automate this.

stale[bot] commented 4 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

1989gironimo commented 4 years ago

This application did not receive an update in the last 4 weeks. Please take a look again and update the application with new code, otherwise the issue will be open forever.

spackmat commented 4 years ago

At least, if this is really a problem related exclusively to the desktop app, the android client could detect that and raise a more helpful error message. Cannot upload null doesn't point to a E2EE-related problem in any way.

stale[bot] commented 4 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

1989gironimo commented 4 years ago

I do love playing ping pong with you, bot.

stale[bot] commented 4 years ago

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

1989gironimo commented 4 years ago

pong.

rugk commented 4 years ago

I guess we should program a bot for replying to that stale bot. This is only fair, IMHO. :smiley:

tobiasKaminsky commented 4 years ago

There might be a chance that desktop messed something up. Can you try it with a new empty folder on Android?

spackmat commented 4 years ago

@tobiasKaminsky I described my reproduction-steps above in https://github.com/nextcloud/android/issues/3291#issuecomment-466401422

In short: A new folder in Android works fine, until the Desktop-Sync tries to change somethin in that folder, then it is crashed. I could play that game several times, seems as if the Desktop-client sets a lock or something, fails and doesn't remove the lock, so all access is blocked from that time on.

joshtrichards commented 11 months ago

The E2E code base has had significant changes made to it since this report. Are you still experiencing the matter covered in this report?

spackmat commented 11 months ago

@joshtrichards I tried again after I gave up for the last years. I resetted the E2EE in the user-security-settings (in the webinterface) and started from scratch (I'm on v3.11.0 of the Client on Windows and on the server NC 28.0.1 and E2EE 1.14.1):

  1. Enabled the E2EE in the Windows App.
  2. Created a new Folder in Windows Explorer and set is as encrypted. This leads to an error message (in German):
    
    Ordner konnte nicht verschlüsselt werden

Der folgende Ordner konnte nicht verschlüsselt werden: "Testfolder".

Server antwortete mit Fehler: Server hat "404 Not Found" auf "PUT https://nextcloud.my-domain.tld/ocs/v2.php/apps/end_to_end_encryption/api/v1/encrypted/00260035514" geantwortet


3. But on Android (v3.26.0) with the new mnemonic I got from the Windows App I can successfully enable the E2EE on that new folder.
4. I can even upload files to that encrypted folder, but I cannot open them there: "Herunterladen fehlgeschlagen" (download failed). When I upload the same files to non-encrypted folders, they work correctly.
5. I also cannot delete those uploaded files (i.e. the delete entry in the context menu is missing). That is even worse than my last known state when the problems started at the moment, the Windows App first came in.
6. The Windows App recognizes the encrypted folder (with a lock symbol) and shows the correct file size, but the sync protocol states that the files inside were removed from the server and in Windows Explorer the folder is empty. When I try to upload files from the Windows side, I get sync errors that I can only get rid of, when I disable the E2EE completely as there is no way to delete the encrypted folder and everything is stuck. This is the same behavior I described years ago.

Then I tried all that again (and deleted the encrypted folder within Windows Explorer once, which before only led to it being created again on next sync with the same problems) but **now it works magically for the first time**. I still cannot open files within the Android App inside the encrypted folder, nor delete them there, but now I can upload files within the Android App, they are synced on Windows and I can upload, open and delete them there.

We are nearly there!