New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pictures never upload #423
Comments
Here are some clues for trouble shooting.
|
3. Sony Z1, one SD cardTom |
I have the same issue. V1.9.1 from Google Play on Android 5.0 Samsung Galaxy S5 |
Same here: v1.9.1 from Google Play, Android 5.1 (Cyanogenmod), OnePlus One |
Same here: v1.9.1 from Google Play, Android 5.1.1, Sony Xperia Z1 Compact |
My Sony Z1 is still on Android 4.4 and it still doesn't work, even though it's now picked up the update to v1.9.1 as well. 3 pictures have appeared in my library, all from '9 days ago'. But I have taken many more photos than that. |
I've looked at the code and found a couple of issues with media upload. Since the problems are somewhat fundamental, I've started on refactoring CameraUploadService/TransferService and converting them into SyncAdapters. Along the way I'll hopefully be able to address most of the issues reported regarding camera upload. If someone has already started doing another refactoring of that code (especially one of the core developers), please give me a hint so our work won't collide. |
👍
@forouher No one is working on that afaik. |
Could you try and find out the full file path of one of the photos that wasn't uploaded? You'd need a file manager app to see the directory structure (e.g. "File manager" on Cyanogen or some file manager app like "ES Explorer" from the app store). E.g. on my phone it's [/storage/emulated/0] /DCIM/Camera/IMG_20151020_101015.jpg |
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
Same here. Details: |
@lupa18 Thanks! Did you manually select that folder in Seadroid for camera upload? Or did you leave Seadroid camera upload on its default settings? |
Yes, I mannualy selected. |
And the first theory is down the toilet...
|
For me, yes they do show in the phone gallery, and restarting the phone has no effect. Why isn't the code just (even as a double check) scanning for files in $dir newer than the last time it looked? If you want to make a build with extra logging in available I'm happy to install this btw.Tom On 19 November 2015 06:03:22 GMT+00:00, Dariush Forouher notifications@github.com wrote:
|
Here the same: stock gallery works fine. Phone restarted and nothing. :-/ |
@lupa18 @tomchiverton thanks! I've opened PR #444 a couple of days ago, where I attempt to fix some of the camera upload issues. It would be very interesting to see whether PR #444 would also fix your issue. I've packaged that PR into an .apk, which can be downloaded here: https://github.com/forouher/seadroid/releases/tag/account_and_camera_upload_tag Warning: PR #444 is experimental and has seen no code review by the Seadroid core developers yet. You will probably have to configure Seadroid again once you downgrade from that apk back to the official release. |
This immediately uploaded the backlog of old photos (default accepted for the upload set up, to an existing library). A newly taken photo did not upload (even though was on wifi). Nothing in transfer list. A reboot didn't nudge it into working. Progress :-) |
@tomchiverton Thanks for taking the time to test this patch set! Could you please check a couple more things:
|
OK. |
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
the problem seems to be that the first full sync works. But after that subsequent incrementals fail. So, to verify, disable incrementals and always query the MediaStore for all images. (There is still the "file already exists?"-check. So it shouldn't cause multiple uploads on the server).
@tomchiverton Thanks, that's very useful! So, the first full sync does work correctly. Subsequent incrementals fail because Seadroid isn't seeing any new photos. Maybe there is an issue with the image timestamp comparison... I've uploaded a new apk (https://github.com/forouher/seadroid/releases/download/account_and_camera_upload_tag/seadroid_PR444_64f3274.apk) that contains a possible workaround. Would you mind trying that one? Which camera app are you using, btw? |
Didn't seem to make any difference; new photos do not upload, the sync data is recent in the account, and manualy do a sync from there just updates the time stamp. |
Hmm, that I didn't expect. I must have taken a wrong turn somewhere. Okay, sorry. It seems like I have to look at the log messages after all. Would it be possible for youto record the log messages of the Seafile app? I've uploaded a new .apk that pushes the loglevel up to 11 (https://github.com/forouher/seadroid/releases/download/account_and_camera_upload_tag/seadroid_PR444_ddef5da.apk). Unfortunately, fetching logs from an Android app is not that simple. Method A: If you know your way around Linux, the easiest way would be
Method B: Alternatively you can use one of the "logcat" apps from the AppStore to record the logs. The require a rooted phone, however. If neither method is an option for you, no problem. Just give me a note and I'll think up something else. |
Installed. Rebooted. Took photo. Log from there is |
@tomchiverton thank you very much! Okay, I think I know what's going on. Android sorts images into "albums" (basically folders). Seadroid by default only uploads images from the folder "Camera" (a hard coded string). I'd wager that the pictures you've taken are not saved into "Camera". Could you please check your image gallery and find out which album your images are saved into? If my theory is correct, you can enable upload of that album by
|
So, on this Android 4.4 Sony, I open'ed Albums, then from the menu pic 'folders' (never knew this was here). Enter that in Seafile (which lists it twice, so I picked both, as well as 'cemera') , and, with wifi on, suddenly whole new folders appear in the web view of the library ! Cracked it. Serious skillz. Is the folder setting available in the released Seafile client i.e. I can just go back to it ? So maybe Seafile needs to have a longer set of default folders, as it seems there are many devices that don't use 'camera' as the default ? |
Excellent! Yeah, I'll add "100ANDRO" to the default list. Unfortunately that seems arbitrary and who knows what folder names other camera apps or phones might use...
1.9.2 also has a (different) folder setting, yes. Let me know it works for you. Thanks again for your help! |
I uninstalled Seafile, and installed 1.9.2 from the Play Store. In the new version I started the camera upload wizard, and made sure to navigate the (confusing) series of folders to /storage/sdcard1/DCIM and picked '100ANDRO' there (listed as several hundred items. Nothing uploads. Nothing in the app's transfer list. Not even listed in Settings, accounts. I uninstalled the Play version and went to your Will report back. |
Hmm. No uploads of the remaining back log, or new phots after 15 minutes. I'll try the latest build you posted. |
Thanks, so, 1.9.2 folder selection is (partially) broken. That's good to know. But I'd like to make sure that the refactoring really fixes that issue. seadroid_PR444_64f3274.apk should work just as well as seadroid_PR444_ddef5da.apk does. Would you mind going back to seadroid_PR444_64f3274.apk one last time and record a logcat?
I've never done tests with more than 30 images, so you may have stumbled on another issue there. I'd just like to be sure. |
Sure, I can test that in the next few days. Although rather than adding another default folder, why not just use all of them as listed by the advanced config GUI? This matches what people expect.Tom On 26 November 2015 06:26:07 GMT+00:00, Dariush Forouher notifications@github.com wrote:
|
Only if you experience problems. If the upload with 64f3274 works fine, just give me a note and I'll stop worrying.
Well, that would also upload Screenshots/WhatsApp/Facebook/Twitter/Instagram pix. Some people won't care, but others will. So, having an option is important. But the UI of the advanced config page should probably be improved. So users are more aware of what Seadroid will do. Maybe remove that switch and always show the grid of albums and just preselect a default list of albums... |
Installed 64f3274, took photo, log cat shows no evidence of upload immediately, But a few minutes later I saw a bunch of "File XXX in bucket" messages, then there was a notice it was getting a 500 error. But now even triggering a manual sync produces no output in logcat. I am rebooting to see if it makes a difference. |
After a reboot, uploads resume, so it's back filling the old photos now. When it finished I turned on video upload as well. This consistently logged errors because I have a 1gig video that far exceeds the upload size setting in Apache. New issue opened : #451 Anyway once it had caught up (~500 photos) I tried taking a new one, this was uploaded right away (at least while the wifi was on). Photos taken while wifi is off upload a few minutes after wifi returns. This means build 64f3274 should be good to go. |
Yeah, I can't see anything either, which sounds dubious.
That might be by design. A 500 error is a server side error and handled the same as a network/IO error. That means Android will do automatic retries with an exponential back off (i.e.: retry after 1 min, 2 min, 4 min, 8min,...). I'm not sure that manually hitting the "refresh" button can override that back off.
I guess a reboot will reset that back off, so this makes sense.
I was thinking about that, too. But I decided against it. It is a server side issue and nothing a typical user can do anything about. If our server fucks up, our monitoring tools have to notify us. We shouldn't rely on users to call us. ;)
Excellent, as it should. In general, a sync will be performed at least every 24h, but it might happen sooner if there is a pending sync request. Again, thank you very much for testing that patch! If you find any further issues over time, please bring them forward. :) |
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
This is awesome news. Any idea when the store version will be updated? |
This week according to our agenda |
v1.9.0 from Google Play on Android 4.4.4
I have tried clearing the app data and deleting the folder in my Camera Upload library, and still newly taken photos do not appear.
The text was updated successfully, but these errors were encountered: