nextcloud / android

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

Editing encrypted files on client: hanging with "Fetching most recent version of the file" #13570

Open jgrocha opened 1 month ago

jgrocha commented 1 month ago

⚠️ Before posting ⚠️

Steps to reproduce

  1. Open Nextcloud Client on Android
  2. Open *.kdbx files with KeePassDX (or KeePass2Android)
  3. Unlock the file
  4. Edit or not
  5. Close file
  6. Nextcloud client shows the modal "Fetching most recent version of the file."

Expected behaviour

The same workflow works with a *.md file. It should work with encrypted files too.

I use these files to store passwords and share the same file between my desktop (using KeePassXC) and my mobile (using KeePassDX).

Actual behaviour

The client hangs indefinitely. I have to close it. Screenshot_2024-09-15-16-56-12-63_06ea656a9ba653ff96746f477f32d0f9

Android version

ColorOS 14.0, Android 14

Device brand and model

Oppo Find X5, CPH2307

Stock or custom OS?

Stock

Nextcloud android app version

3.29.3

Nextcloud server version

27.0.0

Using a reverse proxy?

No.

Android logs

The encrypted file I've edited is deposito.kdbx. The file is mentioned in the Android log.

logcatOutput.txt

Server error logs

I can't see related info in the server log. Copy and paste here the last entries, but are from yesterday.

{"reqId":"oumVLk0l8Y2Zrox8ylzv","level":3,"time":"2024-09-13T19:18:04+00:00","remoteAddr":"158.195.247.254","user":"jgrocha","app":"no app in context","method":"PUT","url":"/nextcloud/remote.php/dav/files/jgrocha/InstantUpload/Camera/2024/09/IMG20240913174303.jpg","message":"Expected filesize of 4250244 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 81920 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.1","version":"27.0.0.8","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 4250244 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 81920 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":149,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":364,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":172,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":297,"message":"Expected filesize of 4250244 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 81920 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","exception":{},"CustomMessage":"Expected filesize of 4250244 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 81920 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}

Additional information

I can't synchronize these keepass encrypted databases. I think it should be as easy as any other file.

jgrocha commented 1 month ago

Same with Nextcloud Hub 8 (29.0.7).

In fact, soon as I click the *.kdbx file, this message appears, but I can open the file. When I close the file and get back, the message will be there forever.

nicofrand commented 1 month ago

The issue also occurs with PDF files (I guess every file opened in an external app).

Even unencrypted files (I did not enable E2E yet).

I do not remember having this issue with < 3.29.3 (from F-Droid).