Skip to content
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

InstantUpload broken #591

Closed
binarykitchen opened this issue Aug 19, 2014 · 27 comments
Closed

InstantUpload broken #591

binarykitchen opened this issue Aug 19, 2014 · 27 comments

Comments

@binarykitchen
Copy link

I have the Instant Picture Uploads option enabled on the Android app v1.5.8 but it is not uploading them whenever I shot some photos.

@purigarcia
Copy link
Contributor

@binarykitchen , thanks for your feedback
we need more information:
Which version of the app are you using?
Which brand is your device?
Which version of android has it?

@binarykitchen
Copy link
Author

App version: 1.5.8
Device brand: Fairphone
Android version: 4.2.2

@modstone
Copy link

Hi there, I think I'm experiencing the same failures, or similar.

[APP]
App version: 1.5.8
Brand: MyWigo
Android version: 4.2.2

[SERVER]
nginx 1.4.6
php 5.5.9
ownCloud 6.0.4

Seems that every new attempt to upload an image from app to the server, app launches a HEAD petition like this. If it got 200/OK, interprets that this file exists and try to create a new version of the same file. Problem in my server is that always got 200/ok, even if file does not exist in my server.

Here I paste an example:
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519.jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(2).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(3).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(4).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(5).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"

[...]

"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(39708).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(39709).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(39710).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"
"HEAD /remote.php/webdav/InstantUpload/IMG_20140821_182519%20(39711).jpg HTTP/1.1" 200 0 "-" "Android-ownCloud"

@modstone
Copy link

could be the same than #554

@Wikinaut
Copy link
Contributor

I noticed the same on my new smartphone HUAWEI P7 mini ‒ instant upload does not work reliably (sometimes it works well, sometimes it does not work at all).

  • Android OC client 1.5.8
  • HUAWEI P7 mini
  • Android 4.3
  • OC Server 7.0.1

Regression ?

@Bugsbane
Copy link

My experience is the same as Wikinaut's. I'll take 20 photos and 6 videos, and I'll get something like 6 photos and no videos.

SETUP:
ownCloud Android client v1.5.8 on a Nexus 5 running Android 4.4.3 (Omnirom)
ownCloud server 7.0.1
nginx
ssl
Set to upload all photos and videos on wifi only with an admin user

The largest file in InstantUpload is 4.2mb. Not sure if any smaller ones failed. I have a few errors in the log, but the only ones in the last couple of days are:
Array to string conversion at PATH TO OWNCLOUD/apps/contacts/lib/backend/database.php#529
Division by zero at PATH TO OWNCLOUD/lib/private/preview.php#426 (<-- many of these)

I can make a test user available, although I'd rather not publich the login details publicly (I'm fine with emailing them to a team member). Is there any way I can provide more useful info?

@Wikinaut
Copy link
Contributor

ping developers (Clarification request):

Because my phone is new, I remember, that the InstantUplaod stopped when I inserted my SDCARD. Before that, the DCIM folder and images was only on the internal sdcard directory /mnt/sdcard0, now I have two /mnt/sdcard0/DCIM and /mnt/sdcard1/DCIM →

  • can this (TWO DCIM directories on the device) be the reason why InstantUpload fails ?

How is the InstantUpload of ownCloud working, when is it triggered?

@Bugsbane
Copy link

Interesting... I have two camera apps (the default Android one and Open Camera) both of which I use. I only tend to use Open Camera for videos. I need to check, but I wonder if the app is only looking in /DCIM/Camera...

@Wikinaut
Copy link
Contributor

@Bugsbane I simply do not know, how OC InstantUpload works, how it is triggered and just noticed, when deep-deleting my new smartphone (because I returned that to the seller because of the bad camera quality), that two different directories were present. I also found, that the first directory was properly uploaded by InstantUpload, whereas the second, newer directory was not.

@Bugsbane
Copy link

Ah! That's so what it is! It's only looking under /DCIM/Camera... I just took 6 photos and a huge video with the default android camera app... all uploaded perfectly. I took the same number with Open Camera... none uploaded.

Edit: Hmmm... the only challenge with this theory... I changed the save location for Open Camera to be in /DCIM/Camera and when it saves a video there, there's still no auto upload. So there's something about when the Android Camera takes a photo/video that triggers upload that other camera apps don't.

Edit2: The Focal camera app always seems to upload correctly, too. I can't figure out what the difference is though. They all seem to use the same filename schema, yet when Open Camera saves to /storage/emulated/0/DCIM/Camera no upload occurs, while everything that Camera or Focal saves there does upload. confused

@davivel
Copy link
Contributor

davivel commented Aug 28, 2014

The Android app does not check the content of any folder in the device for uploading pictures. Instead, it registers itself to be notified about pictures taken. Not all the camera apps existing in Android send the proper notification. Google Camera app does it, some other non Google apps do it too, but not every camera app does. I am sorry, but we cannot do an extensive list.

@davivel
Copy link
Contributor

davivel commented Aug 28, 2014

@modstone, your issue really seems the same as #554. I would appreciate you copy your comment with your logs there.

@binarykitchen , could you provide to us some server logs? Thanks in advance.

@Bugsbane , I read in more detail now, and seems you found it: some camera apps work fine, some other not. To overcome this problem we need to update our implementation to watch folders in the device, and maybe to allow the user define what folders to watch. I am quite sure that is already registered in some other issue.

@Wikinaut , please check if the issue of using different camera apps match your use case too. If that is not your case, please, check the other issues labeled with instant_uploads to see if any of them matches better. Please, notice that for @binarykitchen the instant uploads seem to never work , not some times. If no other issue matches your case, create a new one.

@binarykitchen
Copy link
Author

@davivel Sure, which server logs?

@Bugsbane
Copy link

Now I seem to have a bunch of uploads with a new behavior: uploading a 0 byte file, where before they were either there or they weren't. I still need to check, but I have a feeling this is linked to starting to try a third camera app (Focal) just yesterday. It also saves in the same place as the Android camera app (/DCIM/Camera).

A couple of files did upload correctly, but that may have just been me accidentally using the default app a couple of times.

@davivel
Copy link
Contributor

davivel commented Aug 28, 2014

@binarykitchen , some logs from your web server aorund the moment of a failed instant upload. In a typical Apache configuration, /var/log/apache2/access.log and /var/log/apache2/error.log.

@Wikinaut
Copy link
Contributor

@davivel as mentioned above, I already returned that specific smartphone.I have nothing else to report (except, as mentioned, that two DCIM directories were found, because I took photos, then I inserted the SDCARD and took more photos, wich "land" in the second DCIM directory, the one on the external SDCARD. I have no idea, if this could cause the problem, that then the instant upload stopped, or was influenced.)

I will keep listening to this thread, but have nothing new to report.

@binarykitchen
Copy link
Author

@davivel Thanks - I just made a photo on my Android and suddenly saw the notification that the instant upload failed on my phone. On the server I saw no log entries so must be an issue inside my phone. No idea how to dig deeper?

@Bugsbane
Copy link

Very (very) occasionally I see a "failed upload" notification. Usually though it doesn't show any notification at all if it's not going to work. No upload notification. No failed notification. Nothing. There is no new log entry on the server when I take something with Open Camera, with "Instant Upload" and "Over Wifi" enabled (yes, I'm in close range to the wifi).

@binarykitchen
Copy link
Author

Yes, sometimes I see these "failed upload" notifications when IT WORKED anyway (few seconds later).

Probably there is a timeout when to show that failed-upload-notification? If so, then you should increase that timeout!

@davivel
Copy link
Contributor

davivel commented Sep 1, 2014

@binarykitchen, in this case I think that the 'ninja' "failed upload" notification may be due to an older instant upload, that failed in the past, and is being retried when another picture is taken. In this case, clearing the app data in the system settings should get rid of it, and allow you to test again without interference.

@Wikinaut , thanks for your clarification.

@binarykitchen
Copy link
Author

@davivel but clearing the app data will delete everything and i have to set up everything again

@davivel
Copy link
Contributor

davivel commented Sep 11, 2014

The accounts information won't be deleted. The downloaded files will remain downloaded also. You will have to sync the accounts again to recover the file tree information (or just browse through the app so that it's refreshed on-the-go), and also enable again instant uploads.

Is this too bothering for you? Do you have a lot of files in your account, and keep it sync'ed?

@omethfessel
Copy link

i notice the same behaviour on my new Huawai Ascend P7. It does not start to upload anything to the server. manuall upload works great and fast as ever.

App_Version: 1.5.8
InstantUpload activaed (tried both: only on wifi, and everytime).
Android: 4.4.2
Camera-App: Huawai Origin.

When will this be fixed?

@LukeOwlclaw
Copy link

@davivel I just saw that there is a class FolderObserver. I just issued a PR (#678) so it can be used for watching the photo folder as well.

Photo folder is android.os.Environment.DIRECTORY_DCIM and supported since API 8. Is this good enough? --> http://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DCIM

@voidzero
Copy link

If I upload anything manually with the owncloud Android app, this occurs to me too.. I mean this quote:

Seems that every new attempt to upload an image from app to the server, app launches a HEAD petition like this. If it got 200/OK, interprets that this file exists and try to create a new version of the same file. Problem in my server is that always got 200/ok, even if file does not exist in my server.

I was able to logcat today and noticed that the app was just increasing the filename by one. But, like with @modstone the file does not exist on the server.

I tried to upload a file test.txt from the root of my SD card, and it failed. In fact, I have never been able to upload a file using the owncloud app. So if I can help debug, please let me know.

Add.: nothing in any error logs on the webserver. The only useful hints I got came from 'adb log'.

@voidzero
Copy link

I couldn't let this go, so, I just did two things that solved the issue I was having.

First - I replaced my config with the one from the OwnCloud docs:
http://doc.owncloud.org/server/7.0/admin_manual/installation/configuration_nginx.html

Also, I updated my ssl_ciphers setting to match the line on this page:
https://scotthelme.co.uk/a-plus-rating-qualys-ssl-test/

And voila. Owncloud on Android uploads succesfully!

It probably hasn't much to do with ssl_certificates, but I figured it wouldn't hurt either.

So, for me this is solved! 👍

@LukeOwlclaw
Copy link

This thread is very messed up. What is the actual issue here?

I suggest that anybody who has an issue starts its own github issue.

If it is about instant uploads not working, please also do this:

Download this app and run it:
https://play.google.com/store/apps/details?id=lt.andro.broadcastlogger

After starting the service and taking a picture you should see:
"android.hardware.action.NEW_PICTURE" in the list.

Does it show up?

Closing this thread. Sorry, @binarykitchen, please open a new issue if the problem still occurs and if "android.hardware.action.NEW_PICTURE" DOES show up. If it does NOT: Your problem is already known: #6

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

No branches or pull requests

9 participants