Skip to content

auto upload of pictures is broken #2394

Closed

Description

@hannesa2

With the current version, it seems the auto sync of pictures is broken. On my device there was nothing synced since months

Activity

  1. hannesa2 commented on Dec 8, 2018

    @hannesa2
    ContributorAuthor

    I did a test on a real device from 15:05 till 18:55

    Problem A:

    It seems CameraUploadsSyncJobService does not start

    adb pull /storage/emulated/0/owncloud/log/currentLog.txt .
    cat currentLog.txt |grep CameraUploadsSyncJobService
    
    2018/12/08 15:03:20 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService
    2018/12/08 15:03:38 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService
    2018/12/08 15:03:45 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService
    2018/12/08 15:03:50 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService
    2018/12/08 15:05:40 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService
    
    

    Looks like L53 is never reached
    image

    Problem B:

    Last entry at 15:47:47. After this time app seems to stop doing anything in background. No Job started, nothing

    Problem C:

    I see a lot of actions in background, but server directory Kamera-Upload has still only one file instead if > 800 files

    status:UPLOAD_FAILED and result:NETWORK_CONNECTION
    Socket timeout exception Exception
    UPLOAD_IN_PROGRESS and result:UNKNOWN
    updateCameraUploadSync returns with: 1
    Unrecovered transport exception Exception
    

    Does someone understand what's going on. Here is the complete log
    currentLog.txt

  2. jesmrec commented on Dec 10, 2018

    @jesmrec
    Member

    Thanks a lot for reporting. We have had some issues of people who automatic uploads do not work for them. I guess you selected the correct source folder. We will have a look.

  3. added this to the 2.10.0 milestone on Dec 10, 2018
  4. changed the title [-]auto upload of picures is broken[/-] [+]auto upload of pictures is broken[/+] on Dec 10, 2018
  5. davigonz commented on Dec 12, 2018

    @davigonz
    Contributor

    Thanks for reporting this @hannesa2, in the currentLog.txt you attach I see several logs saying Scheduling a CameraUploadsSyncJobService in different hours but there's no 15 minutes wait.

    2018/12/08 15:03:20 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService 2018/12/08 15:03:38 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService 2018/12/08 15:03:45 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService 2018/12/08 15:03:50 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService 2018/12/08 15:05:40 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService

    If the CameraUploadsSyncJobService is scheduled at 15:03, the job execution should start approximately at 15:18, do you have more logs to see what's going on at that time? Thanks

  6. hannesa2 commented on Dec 12, 2018

    @hannesa2
    ContributorAuthor

    Sorry, that was the only detected log file. If there are more, please tell me.
    Or should we add more places to log, or add additional info ?

    Btw, such lines 2018/12/08 15:03:20 CameraUploadsHandler : Scheduling a CameraUploadsSyncJobService I modified manually, because timestamp is in separate line. What's the purpose of it ? I recommend to have it in one line, maybe with method name and line number.
    I could make a PR to do so, at least for time and log in one line

  7. hannesa2 commented on Dec 18, 2018

    @hannesa2
    ContributorAuthor

    In my point of view, this issue has very high (or highest) priority.
    But I can't fix, because my real device has loose connection and on Emulator I do no picture make.
    @davigonz I guess you are the right person, at least the code lines have your name

  8. davigonz commented on Dec 18, 2018

    @davigonz
    Contributor

    Or should we add more places to log, or add additional info ?

    Please @hannesa2 , try to get more logs, I would need to see at least a period of 15 minutes in your log since you enable CameraUploads feature to see what's going on there.

    In my point of view, this issue has very high (or highest) priority.
    But I can't fix, because my real device has loose connection and on Emulator I do no picture make.
    @davigonz I guess you are the right person, at least the code lines have your name

    Before fixing something, first we need to reproduce it and this is not the case.

  9. hannesa2 commented on Dec 19, 2018

    @hannesa2
    ContributorAuthor

    It would be nice to have this owncloud/android-library#225 to have a more easy investigation

  10. hannesa2 commented on Dec 29, 2018

    @hannesa2
    ContributorAuthor

    "Before fixing something, first we need to reproduce it and this is not the case." ... I can do it on my wife's and my device. Pixel and Pixel 2 both with Android P.

    It looks like this created before period to check, ignoring prevents the upload.

    if (isImage && localFile.lastModified() <= mOCCameraUploadSync.getPicturesLastSync() ||

    I didn't invented it, so I didn't know exactly the purpose of OCCameraUploadSync.
    Please have a look ! @davigonz
    This male function causes all my PRs and has for me the highest prio !
    And because of the merge velocity, I made my private release which is ahead of upstream master https://github.com/hannesa2/owncloud-android/releases

    Here are the logs
    olderLog.txt
    currentLog.txt

  11. davigonz commented on Jan 2, 2019

    @davigonz
    Contributor

    I can do it on my wife's and my device. Pixel and Pixel 2 both with Android P.
    I didn't invented it, so I didn't know exactly the purpose of OCCameraUploadSync.

    @hannesa2 we have to reproduce it in our side so we can fix and properly test it, I'm not saying you invented it, I trust you.

    It looks like this created before period to check, ignoring prevents the upload.
    I didn't know exactly the purpose of OCCameraUploadSync.

    Camera uploads feature, as ...whatever.jpg created before period to check said in your currentLog.txt, does not upload pictures taken or videos recorded before enabling the feature, there's a warning message about that when you enable the feature as well.

    For example, if you take some pictures at 11:30 and you enable Camera uploads at 12:00, those pictures won't be uploaded, just those taken after 12:00.

    That's the main aim of using OCCameraUploadSync, apart from preventing to upload duplicated files when CameraUploadsSyncJobService is executed every 15 minutes. In other words, is a timestamp from which the pictures/videos taken should be uploaded.

    And because of the merge velocity, I made my private release which is ahead of upstream master

    If you want to contribute with some of the features of that private release, please open PR and we will review it.

  12. hannesa2 commented on Jan 2, 2019

    @hannesa2
    ContributorAuthor

    For example, if you take some pictures at 11:30 and you enable Camera uploads at 12:00, those pictures won't be uploaded, just those taken after 12:00.

    And how to enable to sync my older, not synced files ?
    Btw in 2018 Ownclud only synced 4 files !

  13. hannesa2 commented on Jan 2, 2019

    @hannesa2
    ContributorAuthor

    Android camera view, these are just the last ...

    image
    here I can scroll down and see tons of other picture

    In Owncloud:

    This is ALL
    image

    You see just four !

  14. davigonz commented on Jan 3, 2019

    @davigonz
    Contributor

    @hannesa2 what I see in the logs and taking into account the photos you have, if Camera uploads feature detects /storage/emulated/0/DCIM/Camera/IMG_20181228_144728_1.jpg as created before period to check is because it should have uploaded a picture created after that moment, have a look at https://github.com/owncloud/android/blob/master/owncloudApp/src/main/java/com/owncloud/android/files/services/CameraUploadsSyncJobService.java#L207, is executed after requesting a new upload and there's no photo in your Kamera-Upload folder after 28/12/2018 at at 14:47:28. This is a bit weird.

    There's more ways to update that timestamp:

    Have you performed any of those actions? Thanks

  15. davigonz commented on Jan 3, 2019

    @davigonz
    Contributor

    And how to enable to sync my older, not synced files ?

    Uploading them, syncing older files is not the aim of Camera uploads feature.

  16. 2 remaining items

  17. davigonz commented on Jan 18, 2019

    @davigonz
    Contributor

    @hannesa2

    To avoid duplicates with a stored timestamp is potential error rich and I would never do this. Btw, better is to compare two lists and push missing ones

    We've fully tested the feature with timestamp solution and is working pretty fine. Which potential errors should we consider in your opinion?

    but better to have it twice instead of never synced !

    Hmm, think that's not a good approach IMHO.

    But how to fix a wrong working app and let's sync all my picture again ?

    The app is not working wrong in this scenario, your expectations were wrong about the feature. What we could do to avoid this misunderstanding and future ones is including a message saying that the camera uploads feature doesn't upload old pictures.

    So I will close this issue since auto upload pictures is not broken as you describe in here, if you have any idea to improve camera uploads feature, please a new issue or PR, thanks!

  18. hannesa2 commented on Jan 19, 2019

    @hannesa2
    ContributorAuthor

    pretty fine ? I'm not sure
    image
    I use the app for a long time and since this timestamp solution is invented, the app synced only four (4 !) files for the whole year 2018.

    Yes, at least there is a huge room for missunderstanding

  19. davigonz commented on Jan 21, 2019

    @davigonz
    Contributor

    pretty fine ? I'm not sure

    Having reports from people who say that camera uploads do not work for them doesn't mean that the feature is not working fine, this issue is an example of it. Most of the users didn't properly configure the uploads path, that's why we included a new warning dialog.

    I use the app for a long time and since this timestamp solution is invented, the app synced only four (4 !) files for the whole year 2018.

    I have analyzed your logs and suggested possible causes in this comment and by reading what you said above - "Uploading them, syncing older files is not the aim of Camera uploads feature." ... ok, my expectation are wrong." - , it seems there's no wrong behaviour of the feature itself.

  20. jesmrec commented on Jan 21, 2019

    @jesmrec
    Member

    how many pics did you take in such year? about my comment, we planned the solution to warn users about the correct behaviour (already merged). I can also assure you that the number of reports decreased strongly from the latest @davigonz implementation.

  21. hannesa2 commented on Jan 21, 2019

    @hannesa2
    ContributorAuthor

    @jesmrec I took ~100 pictures. I'm on latest master (including #2303) and got no warning

  22. davigonz commented on Jan 22, 2019

    @davigonz
    Contributor

    I took ~100 pictures. I'm on latest master (including #2303) and got no warning

    The warning appears when enabling the camera uploads feature, maybe you've not enabled it since then because is already enabled in your app.

  23. hannesa2 commented on Feb 10, 2019

    @hannesa2
    ContributorAuthor

    Now I made a picture and I'm able to filter for that now so it's easier to investigate (unfortunately the line is long and needs 3 screens)

    image
    image
    image

    What's wrong here ? I see this two lines
    with status:UPLOAD_IN_PROGRESS and result:UNKNOWN
    status:UPLOAD_IN_PROGRESS result:-1

    @jesmrec @davigonz do you see here a reason why nothing appears in app and on server ?

  24. hannesa2 commented on Feb 10, 2019

    @hannesa2
    ContributorAuthor

    Going deeper in log and observe the near time range I see L6484

    It looks like it crashes and app is starting again !
    But Owncloud logger don't share any information !

    image

  25. hannesa2 commented on Feb 10, 2019

    @hannesa2
    ContributorAuthor

    Now I'm able to see, what's wrong #2440
    The complete logging is questionable, when you don't see unexpected crashes

  26. hannesa2 commented on Feb 10, 2019

    @hannesa2
    ContributorAuthor

    Because `AndoridX #2402 solves it for me, its for me done, but I would not surprised when other user run into same too.

    Either this commit 4afb54f causes it:

    pro: you do not see a crash or a log entry, it's just not working
    con: There must be more then a few of people out there, having this issue and I assume it was tested

    Or installation of Android P at August 2018 on my device causes it

    pro : only less people have this, so you get less feedback
    con : Why I've just 4 pictures synced in year 2018 ?

    Anyway, I'm done with this. For me AndoridX #2402 solves it and I spent too much time with this.

    When you close this issue is your decision

    @michaelstingl
    image
    This happen, because a global error catcher is missing. I accepted it and I was able to see reason with #2440 (comment)

  27. revoltown commented on Mar 26, 2023

    @revoltown

    hello i have a problem, im uploading pictures and some of them are not acessible...

  28. jesmrec commented on Mar 27, 2023

    @jesmrec
    Member

    @revoltown could you open new issue with all details?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions