Skip to content

FR: Retry failed camera uploads #2149

Open

Description

A user review on GooglePlayStore requested a feature:

"Image upload still does not work reliably, not in 2.6 and is actually my most important feature. As far as I was happy, everything worked as it should. I was actually satisfied so far, everything worked as it should. Now I've had the problem for a long time that the photo upload to the InstantUpload directory always fails, especially because then simply ceases to upload the images, which is very unreliable. As if the trigger is lost in the system (Samsung S6 Edge and now Samsung S8). It would be OK if a second attempt would be made later to upload the picture again, but here this breaks completely away, so that not all my photos arrive in the InstantUpload."

Could this be implemented into the app?

Activity

  1. michaelstingl commented on Mar 14, 2018

    @michaelstingl
    Contributor

    Implement a new feature to work around something else that isn't working? Why not fix the root cause?

    @lefherz Please ask the user to send more information to [email protected] .

  2. andreaslink-de commented on Mar 14, 2018

    @andreaslink-de

    Ok, let me try to explain the major issue I have and where I would be surprised, if others would not have. I'm using newest version on Android (and iOS), I have set up an instant picture and video upload into a dedicated target folder on my owncloud. I also only want pictures/videos to be uploaded, when I'm connected to a WiFi.

    Please see the following real life example:
    Some days ago (10.03.2018), I was outside with my girls and took some pictures, there I was not connected to a WiFi, so no pictures where uploaded (which is what I wanted due to only a small data package on my phone).
    Then, some days later (13.03.2018), I took at home some pictures of electronic parts on a table, which I did at home, where I was connected to my usual WiFi.

    Situation and expectation:
    In none of the cases I ever opened the ownCloud app until today. So I simply expect all my pictures to be uploaded in the background to my server, whenever I'm connected to a WiFi with access to my server. I've recognized today, that pictures of my girls are missing, but the electronic parts were visible in my photo folder. So why are the girls missing?

    Situation in the app:
    I opened the app and entered the upload section:

    37412183-b92cc22e-27a4-11e8-9752-c1a069753cd8

    Here I can see, all pictures seem to wait on a WiFi connection, even though I'm currently connected to a WiFi (can also be seen at the top). So that's the issue, why aren't these uploaded?

    If I scroll down a bit, I see the pictures taken at home to be successfully uploaded without any interaction from me, even though they are older:

    37412378-0b30ea8c-27a5-11e8-80de-50d8812ffad4

    This of course makes sense, as I was able to see them in my folder on the server.

    If I now manually hit the button to retry all failed uploads, the upload successfully starts again and is working like a charm:
    37412448-391770b0-27a5-11e8-93af-b415c0edf0ed

    And THIS is exactly the point, where I'm wondering why the heck these are not retried a second time.

    Discussion:
    So the former scenario is exactly showing my issue with picture uploads, why you can't trust them and why this is an issue. What if I have decided to delete them today, assuming, they were already all backed-up in my ownCloud?
    The core issue is probably as @michaelstingl said, to get things right, why is the available WiFi ignored and why are these not retriggered? So the initial feature request from @lefherz makes sense, just to have a retry on these ones. This is not just a WiFi related issue, but I had a lot more with things like "authentication failed" even though, there was no issue and I simply had to click "retry all failed" and they were all uploaded without any further noise. So why aren't all these failed ones not retried within some new timeslots? A re-trigger event could be, if at least one other photo/video was successfully uploaded as this prooves there is a working WiFi and a valid authentication existing. The only error I can understand is, if a source file is deleted, but please, then also remove the task to upload the picture. It does not make sense to have orders for not existing pictures.

    What I'm aiming for is a 100% reliable picture and video upload functionality as I do not never ever want to enter the upload menu to manually re-trigger an upload process. Whether this is either solved by fixing the correct trigger point evaluation or by creating a new feature/scheduler to retry missing pictures. Or probably a mixtures of both?

    Personal blabla:
    I bring in a lot emotion in here as I've based my wife's and mine children-photo-and-video-life to this app, so I just need to rely on the app that all our mobile photos are stored secure and persistent in our ownCloud so we do not loose important moments with our children. Other cloud apps are also able to handle this silently in the background, so this is why I'm wondering that this is still not stable in this fairly mature app being quite some time on the market.

    I hope, I could help :-).

  3. michaelstingl commented on Mar 15, 2018

    @michaelstingl
    Contributor

    @andreaslink-de thank you very much for your feedback. To work on such an issue, ownCloud experts need some more information. Normally if you open a new issue here, you need to provide this information. (you can use it as an template). Please help and provide the information in the structured format. It would be awesome if you could help the ownCloud team to reproduce the issue.

  4. andreaslink-de commented on Jul 15, 2018

    @andreaslink-de

    Hej there,

    some time past and I really would like to get this error fixed as it's still existing exactly the same way, even though I go with every stable version, which is provided. So following your template...

    Actual behaviour

    Pictures are not uploaded when being taken outside a valid wifi network and then entering back into a wifi network (like e.g. at home). I always need to press the button manually to retrigger an upload of the failed ones. Please find way more exact details in my posting above.

    Expected behaviour

    I do not want to make any interaction in the app, whenever there is a valid wifi connection, I want all outstanding pictures and videos automtically to be uploaded without any additional user interaction (compare e.g. with Dropbox app).

    Steps to reproduce

    1. Read my very detailed posting above...
    2. Setup owncloud to only upload pics and videos when being WLAN connected
    3. Leave a valid wifi and take several pictures/videos
    4. Enter valid Wifi network take some further pictures if wanted
    5. See new pictures being uploaded but old ones taken outside wifi to be awaiting to be uploaded

    Can this problem be reproduced with the official owncloud server?
    (url: https://demo.owncloud.org, user: test, password: test)
    I was not able to do it, as I did not connect my personal app (production phone) to the demo server. This needs to be tested by someone with a testphone.

    Environment data

    Android version: last tested with 8.0.0 (but failed same way with older versions)

    Device model: Samsung S6 Edge, Samsung S8

    Stock or customized system: Stock

    ownCloud app version: v2.8.0

    ownCloud server version: 10.0.8.5

    Logs

    There are no logs, which might make sense as this is app triggered I guess, except you tell me something else.

  5. added
    p3-medium
    and removed on Apr 10, 2019
  6. added this to the milestone on Apr 10, 2019
  7. 88fingerslukee commented on Jan 17, 2020

    @88fingerslukee

    I'd like to throw my support behind this fix. My uploads fail frequently and they don't retry unless I do it manually.

  8. changed the title [-]FR: Retry failed uploads[/-] [+]FR: Retry failed camera uploads[/+] on Feb 18, 2020
  9. removed this from the milestone on Sep 30, 2020
  10. jesmrec commented on Jul 21, 2021

    @jesmrec
    Member

    New implementation (WorkManager) will help to do this. To check:

    • Which cases makes sense to retry (camera uploads)
    • Periodicity
  11. added this to the 2.20-... milestone on Jul 23, 2021
  12. removed this from the 2.20-current milestone on Dec 9, 2021
  13. DeepDiver1975 commented on Jun 28, 2026

    @DeepDiver1975
    Contributor

    🤖 Automated issue triage by Claude Code review agent.

    This is still relevant after the WorkManager rewrite. Failed automatic (camera) uploads are not retried automatically; only the manual "retry failed" action re-runs them — the same gap the reporter described.

    What I found in the current code:

    • AutomaticUploadsWorker runs as a periodic worker. On each run it scans for files whose lastModified falls in lastSyncTimestamp..<currentTimestamp, enqueues a one-shot upload per file, then advances lastSyncTimestamp to currentTimestamp unconditionally (updateTimestamp(...) in syncFolder).
    • An individual upload (UploadFileFromContentUriWorker.doWork) returns Result.failure() on any error — not Result.retry() — so WorkManager does not back off and re-run it. The transfer is marked TRANSFER_FAILED.
    • Because the periodic scan window has already moved past that file, the next periodic run does not pick the failed file up again either.

    Net effect: a transient failure (Wi-Fi dropped mid-upload, momentary auth error) leaves the file permanently in TRANSFER_FAILED until the user opens the app and manually retries — matching the original report.

    Possible directions (for the team to scope):

    • Have the periodic worker also re-enqueue transfers in TRANSFER_FAILED for the automatic-upload accounts, or
    • Return Result.retry() (with a backoff policy) for transient/retryable error classes in the upload worker, keeping Result.failure() only for permanent errors (e.g. source file deleted — which should also drop the transfer, as the reporter noted).

    Relevant files:

    • owncloudApp/src/main/java/com/owncloud/android/workers/AutomaticUploadsWorker.kt
    • owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromContentUriWorker.kt

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions