owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.82k stars 3.05k forks source link

[BUG] Failed upload hogs storage space #3847

Open MegaBrutal opened 1 year ago

MegaBrutal commented 1 year ago

Actual behaviour

I have a large video file that I have on SD card. The ownCloud app has tried to upload it, and apparently for that it needs to create a copy on internal storage. But there was no space on internal storage and so the operation failed. Since that, the DiskUsage app shows that ownCloud is hogging 777 MB of my internal storage space; I guess it's the temporary file it created as I don't have many and large files downloaded for offline usage (I mainly use the app to just auto-upload my photos and videos, I rarely download files to my phone). Previously I could manually delete temporary files from the app's tmp directory, but I can't access ownCloud's operation directories directly anymore, I suspect it's because of the scoped storage update (#3455).

Expected behaviour

The ownCloud app should clear the temporary files it created in case the upload fails, or have an option in the settings to manually clear its cache / tmp. It would also be nice if the entirety of the ownCloud app could operate from the SD card inserted to the phone because in that case the app could successfully upload my large video in the first place – many apps are movable to external storage, but not ownCloud.

Steps to reproduce

  1. Create a very large file, make sure your internal storage don't have enough free space to hold a copy of this file.
  2. Upload this file with the ownCloud app. For more accurate reproduction, have it uploaded by ownCloud's auto-upload feature.
  3. Watch how the upload fails.
  4. Observe how the ownCloud app ate up all free space of your internal storage.

Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test)

I don't think this is relevant, as it is purely client-side behavior, but I suppose yes.

Environment data

Android version: 6.0.1

Device model: Samsung Galaxy S5 Neo SM-G903F

Stock or customized system: Stock (not rooted – yet)

ownCloud app version: 3.0.1 release 5e553f078

ownCloud server version: ownCloud 10.11.0 (stable)

Logs

Web server error log

Doesn't seem relevant, but might provide it if asked.

ownCloud log (data/owncloud.log)

Will provide if asked.
abelgardep commented 1 year ago

Hello, @MegaBrutal thanks a lot for the report.

We will recheck this case and we will evaluate the potential solutions u posted.

We create a local copy to avoid losing access to that file while waiting to upload (no connection to server, long uploads queue..). Anyway, if it fails due to storage, the cached file should be removed and may be retried with the original file (taking into account that we could have lost access to it by that time)