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

Autoupload doesn't work at all with Nextcloud App Beta 20170101 #498

Closed
OlivierS1 opened this issue Jan 3, 2017 · 22 comments
Closed

Autoupload doesn't work at all with Nextcloud App Beta 20170101 #498

OlivierS1 opened this issue Jan 3, 2017 · 22 comments

Comments

@OlivierS1
Copy link

Actual behaviour

-Nextcloud App Beta 20170101

I have been trying to make Auto upload work, but couldn't.
I couldn't find information regarding the newly redesigned feature but I think I understand how it is supposed to work.
I am not sure this feature is complete and support autoupload yet.

Expected behaviour

-Tell us what should happen

  • Under Auto uploads, I choose the relevant folder such as Camera, either from the internal storage or SD card,
  • I configure the Auto upload preferences:
    -- Storage location.
    -- Upload via Wifi only.
    -- Use subfolders
    • Original file will be... Moved to app folder.

Once setup, when I use camera and take a picture or video, nothing is being uploaded by Nextcloud app.
It's like Nextcloud doesn't know a picture was taken and doesn't do anything.

Steps to reproduce

  1. See step above.

Environment data

Android version:
6.0

Device model:
LG-G3

Stock or customized system:
Stock

Nextcloud app version:
Nextcloud Beta 20170101

Nextcloud server version:
OC 9.1.1

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here
@k-304
Copy link

k-304 commented Jan 4, 2017

Im using Android 6, Beta20170101 and Nextcloud 11. No Pictures are uploaded to my Nextcloud.
The Serverlog shows the following lines:

{"reqId":"olZk+WqwwC1yrKUb6Fqz","remoteAddr":"xy.xy.228.118","app":"admin_audit","message":"Login successful: \"user\"","level":1,"time":"2017-01-04T08:36:10+00:00","method":"GET","url":"\/nextcloud\/ocs\/v1.php\/cloud\/users\/user?format=json","user":"user","version":"11.0.0.10"}

{"reqId":"olZk+WqwwC1yrKUb6Fqz","remoteAddr":"xy.xy.228.118","app":"no app in context","message":"CSRF check failed","level":0,"time":"2017-01-04T08:36:10+00:00","method":"GET","url":"\/nextcloud\/ocs\/v1.php\/cloud\/users\/user?format=json","user":"user","version":"11.0.0.10"}

@ncyclon
Copy link

ncyclon commented Jan 7, 2017

Same problem on Samsung Galaxy S6, Android 6.0.1, ver. 20170106.

2017/01/07 14:12:19
Preferences : onSaveInstanceState(Bundle) starting

2017/01/07 14:12:19
Preferences : onStop() ending

2017/01/07 14:12:24
Preferences : onStart() starting

2017/01/07 14:12:24
Preferences : onResume() starting

2017/01/07 14:12:28
com.owncloud.android.files.InstantUploadBroadcastReceiver : Received: android.hardware.action.NEW_PICTURE

2017/01/07 14:12:28
com.owncloud.android.files.InstantUploadBroadcastReceiver : New photo received

2017/01/07 14:12:28
com.owncloud.android.files.InstantUploadBroadcastReceiver : Instant picture upload disabled, ignoring new picture

2017/01/07 14:12:28
com.owncloud.android.files.InstantUploadBroadcastReceiver : OFFICIAL processed: android.hardware.action.NEW_PICTURE

2017/01/07 14:12:29
Preferences : onPause() ending

2017/01/07 14:12:29
LogHistoryActivity : onCreate(Bundle) starting

2017/01/07 14:12:29
LogHistoryActivity : onStart() starting

2017/01/07 14:12:29
LogHistoryActivity : onResume() starting

2017/01/07 14:12:29
Preferences : onSaveInstanceState(Bundle) starting

2017/01/07 14:12:29
Preferences : onStop() ending

@OlivierS1
Copy link
Author

Nextcloud Beta 2017010: Auto upload still doesn't work at all.

I have two camera folders Nextcloud app is watching, one on the internal storage and the other on the external SD card.
As far I can tell, both "Auto upload" configurations are enabled, The cloud icon on the top right side of the folder is blue and photo once taken will appear in the preview once "Auto upload" has been updated.
New photos are detected, but according to following log, "Instant upload" is disabled somewhere.
Is it possible there is supposed to be a main switch (Enable/Disable check box) which would normally appear under "Auto upload Settings" that would be preventing the upload to take place?
Nevertheless, no transfer is taking place and the "Uploads" folder remains empty.

Truncated Content of currentLog.txt:

2017/01/10 02:26:30
UploadListActivity : onStop() ending

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : Received: android.hardware.action.NEW_PICTURE

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : New photo received

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : Instant picture upload disabled, ignoring new picture

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : OFFICIAL processed: android.hardware.action.NEW_PICTURE

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : Received: com.android.camera.NEW_PICTURE

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : New photo received

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : Instant picture upload disabled, ignoring new picture

2017/01/10 02:26:37
com.owncloud.android.files.InstantUploadBroadcastReceiver : UNOFFICIAL processed: com.android.camera.NEW_PICTURE

2017/01/10 02:26:39
BaseActivity : onRestart() start

@ncyclon
Copy link

ncyclon commented Jan 10, 2017

Try to install beta from Google play.

@AndyScherzinger
Copy link
Member

@ncyclon that is a "huge" difference the "beta" from Google Play is just the release candidates (of the upcoming stable releases) which is something different. The real beta is only available on f-droid and is a beta version that can run in parallel and contains any feature/change that is ready for review (and many of them won't be in the next stable but any other future stable release).

@bajaka
Copy link

bajaka commented Jan 11, 2017

I have the same situation here on a Oneplus 3 using Android 6.0.1 (OxygenOS 3.2.8) using beta version 20170106. I see similar logging including the "Instant picture upload disabled, ignoring new picture" message.

@OlivierS1
Copy link
Author

Beta version 20170202 doesn't have a fix for the Auto upload feature.

Here is the content of the log:

2017/02/02 20:50:48
com.owncloud.android.files.InstantUploadBroadcastReceiver : Received: android.hardware.action.NEW_PICTURE

2017/02/02 20:50:48
com.owncloud.android.files.InstantUploadBroadcastReceiver : New photo received

2017/02/02 20:50:48
com.owncloud.android.files.InstantUploadBroadcastReceiver : Instant picture upload disabled, ignoring new picture

2017/02/02 20:50:48
com.owncloud.android.files.InstantUploadBroadcastReceiver : OFFICIAL processed: android.hardware.action.NEW_PICTURE

2017/02/02 20:50:49
com.owncloud.android.files.InstantUploadBroadcastReceiver : Received: com.android.camera.NEW_PICTURE

2017/02/02 20:50:49
com.owncloud.android.files.InstantUploadBroadcastReceiver : New photo received

2017/02/02 20:50:49
com.owncloud.android.files.InstantUploadBroadcastReceiver : Instant picture upload disabled, ignoring new picture

2017/02/02 20:50:49
com.owncloud.android.files.InstantUploadBroadcastReceiver : UNOFFICIAL processed: com.android.camera.NEW_PICTURE

@tobiasKaminsky
Copy link
Member

InstantUploadBroadcastReceiver:61 on Beta is

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {...}

On my emulator with Nougat it still goes into the if branch, although if I manually execute Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP on the breakpoint it says "false". Which is the expected behaviour.
This seems to be the reason why here the output of the BroadcastReceiver is shown, even if the AutoUpload is used.

@tobiasKaminsky
Copy link
Member

@OlivierS1 tomorrow there will be a new beta with a significant change on autoupload, maybe you want to give it a try?

@OlivierS1
Copy link
Author

Can't wait to get my hand on it.

@OlivierS1
Copy link
Author

I just checked the update as I am in Western Canada. It turns out the update is available.
Here are my first feedbacks:

  • Downloaded the APK via the app, but APK coudn't install. It happened also last night when trying to install 20170202.

-Installed APK 20170204:

  • Made sure normal Nextcloud app doesn't have auto upload enabled.
  • Went back onto Nextcloud Beta 20170204 and setup camera folder location for autoupload.
  • I didn't touch "Storage path": Left it to default Unknown.
  • Went to camera app and took a picture..

Now upload is underway.
On my Server, I do not have the default folder "InstantUpload" because it makes sharing files unmanageable. I usually use my account name at the end of the folder name to differentiate it.
Maybe because of it, it seems all my pictures in the Camera folder are being uploaded.

  • Most photos seem to upload properly but I get lots of them that fails.
    Clearing all of them from the upload folder I proceed with a single camera capture:
    Once a single photo is taken, I go back into Upload folder and I see two version of the same file trying to be uploaded.
    The first one is loaded into the default "Instantupload/Camera" folder and seems succesful, while the seconf tryies to upload to "Instantupload/Camera/2017/02" which fails.
    I have setup "Original file will be..." to "Move to app folder" and it is probably the reason why I get double upload with one failure.

@OlivierS1
Copy link
Author

So far I am happy with the result but I need to explore Nextcloud beta 20170204 in more depth, especially with both local and external SD support.

@OlivierS1
Copy link
Author

More feedback:

I have remapped my "Remote folder: location to "InstantUpload_Olivier".
Now I have the following issues:

Nextcloud app 20170204 doesn't want to stop uploading:
In the upload folder I have now 2 different folders in the list (I don't know if it is the source or the destination folders):
1: "InstantUpload/Camera"
2: "InstantUpload_Olivier/2017/02"

Closing Nextcloud app then starting it again forces upload of the entire folder again.

@mario
Copy link
Contributor

mario commented Feb 4, 2017

@OlivierS1 uploading the same image twice fails due to another bug that we're working on nextcloud/android-library#33. I would assume though that there should be only one upload though :) @tobiasKaminsky?

@OlivierS1
Copy link
Author

@mario I can't stop the failed uploads. Even though I have cleared them from the "upload" menu, they reappear.

Here is some part of the log I have edited which shows activity of one of the uploaded files.
I don't know if it is related to the issue you mentioned.
The following repeats many times and seems to be triggered when the app is opened or accessing the content of the "Upload" menu.

2017/02/04 21:35:23
SimpleFactoryManager : getClientFor(OwnCloudAccount ... :

2017/02/04 21:35:23
OwnCloudClient #130 : Creating OwnCloudClient

2017/02/04 21:35:23
SimpleFactoryManager : new client {Olivier@NNNNNNN/owncloud, 52365176}

2017/02/04 21:35:23
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/20170110_022943.jpg status:UPLOAD_IN_PROGRESS result:-1)

2017/02/04 21:35:23
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status=UPLOAD_IN_PROGRESS

2017/02/04 21:35:23
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/20170110_022943.jpg

2017/02/04 21:35:23
UploadsStorageManager : notifyObserversNow

2017/02/04 21:35:23
SimpleFactoryManager : getClientFor(OwnCloudAccount ... :

2017/02/04 21:35:23
OwnCloudClient #131 : Creating OwnCloudClient

2017/02/04 21:35:23
SimpleFactoryManager : new client {Olivier@NNNNNNN/owncloud, 122482257}

2017/02/04 21:35:23
OwnCloudClient #131 : REQUEST HEAD /owncloud/remote.php/webdav/InstantUpload/Camera/

2017/02/04 21:35:23
ExistenceCheckRemoteOperation : Existence check for https://NNNNNNN/owncloud/remote.php/webdav/InstantUpload/Camera/ targeting for existence finished with HTTP status 200

2017/02/04 21:35:24
UploadFileOperation : Checking name collision in server

2017/02/04 21:35:24
OwnCloudClient #131 : REQUEST HEAD /owncloud/remote.php/webdav/InstantUpload/Camera/20170110_022943.jpg

2017/02/04 21:35:24
ExistenceCheckRemoteOperation : Existence check for https://NNNNNNN/owncloud/remote.php/webdav/InstantUpload/Camera/20170110_022943.jpg targeting for existence finished with HTTP status 404(FAIL)

2017/02/04 21:35:24
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/20170110_022943.jpg status:UPLOAD_IN_PROGRESS result:-1)

2017/02/04 21:35:24
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status=UPLOAD_IN_PROGRESS

2017/02/04 21:35:24
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/20170110_022943.jpg

2017/02/04 21:35:24
UploadsStorageManager : notifyObserversNow

2017/02/04 21:35:24
UploadFileOperation : Upload of /storage/emulated/0/DCIM/Camera/20170110_022943.jpg to /InstantUpload/Camera/20170110_022943.jpgResultCode(UNKNOWN_ERROR): Operation finished with HTTP status code -1 (fail)

2017/02/04 21:35:24
UploadsStorageManager : updateDataseUploadResult uploadResult: com.owncloud.android.lib.common.operations.RemoteOperationResult@456b6 upload: com.owncloud.android.operations.UploadFileOperation@b088fb7

2017/02/04 21:35:24
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status:UPLOAD_FAILED and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/20170110_022943.jpg status:UPLOAD_IN_PROGRESS result:-1)

2017/02/04 21:35:24
UploadsStorageManager : Updating /storage/emulated/0/DCIM/Camera/20170110_022943.jpg with status=UPLOAD_FAILED

2017/02/04 21:35:24
UploadsStorageManager : updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/20170110_022943.jpg

2017/02/04 21:35:24
UploadsStorageManager : notifyObserversNow

2017/02/04 21:35:24
FileUploader : NotifyUploadResult with resultCode: UNKNOWN_ERROR

2017/02/04 21:35:24
FileUploader : Stopping command after id 63

@mario
Copy link
Contributor

mario commented Feb 5, 2017

@OlivierS1 thanks, working on it - found the issue.

@mario
Copy link
Contributor

mario commented Feb 28, 2017

@OlivierS1 please confirm this has been fixed :)

@OlivierS1
Copy link
Author

@mario It seems I am able to perform autoupload but Nextcloud app beta 20170228 doesn't behave the same way as Nextcloud 1.4.2.RC1 based on android-debug.apk from Feb 24 2017.

I tried to record a video and had file moved to App folder, and the files appeared twice in the phone Camera folder within Nextcloud account.
However, only one file was actually uploaded to server.
I do not seem to have this issue with 1.4.2 RC1.
To sum up, I do not trust Nextcloud beta (or nightly) 20170228 to do the work reliably.
Autoupload does seem to work but the video is partially uploaded because it is moved during recording. This issue was resolved in 1.4.2 RC.

@mario
Copy link
Contributor

mario commented Feb 28, 2017

@OlivierS1 I'm hoping beta will catch up with this branch tomorrow, so please test it then :)

@OlivierS1
Copy link
Author

Nightly (Beta ) 20170301 doesn't seem to have the fix. Video files remain corrupted.

@mario
Copy link
Contributor

mario commented Mar 1, 2017

Super strange. WIll investigate this today.

@mario
Copy link
Contributor

mario commented Oct 15, 2017

Fixed.

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

7 participants