owncloud / owncloud/android

[BUG] Failed upload hogs storage space

Open
#3,847 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the auto-upload feature and the upload failure path described in the reproduction steps, then trace where temporary files are created and removed. Reproduce with a file larger than available internal storage and verify that a failed upload releases its temporary storage; the issue also raises broader SD-card and manual-cache options that need scope clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.