android icon indicating copy to clipboard operation
android copied to clipboard

Image upload fails after removing the image one time (UNKNOWN_ERROR)

Open togglecode opened this issue 9 years ago • 12 comments

Actual behaviour

  • Upload an image
  • Remove the image after upload
  • Upload same image again
  • Upload get's failed, and you will get the same error again even if you "retry" the upload

Expected behaviour

-upload should work even after removing and reuploading

Steps to reproduce

  1. upload image
  2. remove the image (from the App)
  3. Try to re-upload the image

Environment data

Android version: 6.0.0

Device model: Moto G3

Nextcloud app version: 1.4.1(stable) but I also tried it on master branch

Nextcloud server version: https://demo.nextcloud.com

Logs

Nextcloud log (data/nextcloud.log)

I/ServerNameIndicator: SNI done, hostname: demo.nextcloud.com
D/skia: --- SkImageDecoder::Factory returned null
D/GetRemoteUserInfoOperation: Successful response: {"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},"data":{"enabled":"true","quota":{"free":135740416,"used":7074735,"total":142815151,"relative":4.95,"quota":-3},"email":null,"displayname":"admin"}}}
D/ExistenceCheckRemoteOperation: Existence check for https://demo.nextcloud.com/testcloud/remote.php/webdav/Photos/ targeting for  existence finished with HTTP status 200
D/UploadFileOperation: Checking name collision in server
D/OwnCloudClient #60: REQUEST HEAD /testcloud/remote.php/webdav/Photos/IMG_20170209_154333058_HDR.jpg
D/ExistenceCheckRemoteOperation: Existence check for https://demo.nextcloud.com/testcloud/remote.php/webdav/Photos/IMG_20170209_154333058_HDR.jpg targeting for  existence finished with HTTP status 404(FAIL)
I/RefreshFolderOperation: Checked [email protected]/testcloud/Photos/ : not changed
V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg status:UPLOAD_IN_PROGRESS result:-1)
V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status=UPLOAD_IN_PROGRESS
D/UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg
D/UploadsStorageManager: notifyObserversNow
D/RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
E/UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg to /Photos/IMG_20170209_154333058_HDR.jpg: Operation finished with HTTP status code -1 (fail)
D/FileDisplayActivity: Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
D/OwnCloudClient #61: REQUEST GET /testcloud/ocs/v1.php/apps/files_sharing/api/v1/shares
D/UploadsStorageManager: updateDataseUploadResult uploadResult: com.owncloud.android.lib.common.operations.RemoteOperationResult@7fa80b2 upload: com.owncloud.android.operations.UploadFileOperation@48b3803
V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status:UPLOAD_FAILED and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg status:UPLOAD_IN_PROGRESS result:-1)
V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status=UPLOAD_FAILED
D/UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg
D/UploadsStorageManager: notifyObserversNow
D/FileUploader: NotifyUploadResult with resultCode: UNKNOWN_ERROR

togglecode avatar Mar 03 '17 16:03 togglecode

Fixed in 1.4.2 RC1, due soon :P

On Fri, Mar 3, 2017 at 5:02 PM, togglecode [email protected] wrote:

Actual behaviour

  • Upload an image
  • Remove the image after upload
  • Upload same image again
  • Upload get's failed, and you will get the same error again even if you "retry" the upload

Expected behaviour

-upload should work even after removing and reuploading Steps to reproduce

  1. upload image
  2. remove the image (from the App)
  3. Try to re-upload the image

Environment data

Android version: 6.0.0

Device model: Moto G3

Nextcloud app version: 1.4.1(stable) but I also tried it on master branch

Nextcloud server version: https://demo.nextcloud.com Logs Nextcloud log (data/nextcloud.log)

I/ServerNameIndicator: SNI done, hostname: demo.nextcloud.com D/skia: --- SkImageDecoder::Factory returned null D/GetRemoteUserInfoOperation: Successful response: {"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},"data":{"enabled":"true","quota":{"free":135740416,"used":7074735,"total":142815151,"relative":4.95,"quota":-3},"email":null,"displayname":"admin"}}} D/ExistenceCheckRemoteOperation: Existence check for https://demo.nextcloud.com/testcloud/remote.php/webdav/Photos/ targeting for existence finished with HTTP status 200 D/UploadFileOperation: Checking name collision in server D/OwnCloudClient #60: REQUEST HEAD /testcloud/remote.php/webdav/Photos/IMG_20170209_154333058_HDR.jpg D/ExistenceCheckRemoteOperation: Existence check for https://demo.nextcloud.com/testcloud/remote.php/webdav/Photos/IMG_20170209_154333058_HDR.jpg targeting for existence finished with HTTP status 404(FAIL) I/RefreshFolderOperation: Checked [email protected]/testcloud/Photos/ : not changed V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg status:UPLOAD_IN_PROGRESS result:-1) V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status=UPLOAD_IN_PROGRESS D/UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg D/UploadsStorageManager: notifyObserversNow D/RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED E/UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg to /Photos/IMG_20170209_154333058_HDR.jpg: Operation finished with HTTP status code -1 (fail) D/FileDisplayActivity: Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED D/OwnCloudClient #61: REQUEST GET /testcloud/ocs/v1.php/apps/files_sharing/api/v1/shares D/UploadsStorageManager: updateDataseUploadResult uploadResult: com.owncloud.android.lib.common.operations.RemoteOperationResult@7fa80b2 upload: com.owncloud.android.operations.UploadFileOperation@48b3803 V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status:UPLOAD_FAILED and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg status:UPLOAD_IN_PROGRESS result:-1) V/UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg with status=UPLOAD_FAILED D/UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170209_154333058_HDR.jpg D/UploadsStorageManager: notifyObserversNow D/FileUploader: NotifyUploadResult with resultCode: UNKNOWN_ERROR

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/710, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWsoFjbmzwks8nOMYKqybZi-sGTZsCks5riDmagaJpZM4MSbmu .

mario avatar Mar 03 '17 16:03 mario

Oh that's good to hear @mario . May I ask how I can test it? because now it throws me an OC exception as JSONException: No value for quota.

togglecode avatar Mar 03 '17 16:03 togglecode

Which Nc server version do you have? On Fri, 3 Mar 2017 at 17:45, togglecode [email protected] wrote:

Oh that's good to hear @mario https://github.com/mario . May I ask how I can test it? because now it throws me an OC exception as JSONException: No value for quota.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/710#issuecomment-284005356, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWsogflXQgZBiX3r-hcVgxBFDCS0u1ks5riEOWgaJpZM4MSbmu .

mario avatar Mar 03 '17 16:03 mario

well, the demo server is on version 11.0.1.2

togglecode avatar Mar 03 '17 16:03 togglecode

OK. So ... https://play.google.com/store/apps/details?id=com.nextcloud.client&hl=en

But you need to subscribe to a beta version, and version should be 1.14.2 RC1 ;)

mario avatar Mar 03 '17 16:03 mario

oh... but commit f0bbb4b562649ce70178772fd9f922daa90763dd is 1.4.2 RC1 and it gives me this:

D/OwnCloudClient #2: REQUEST GET /abcdtest/ocs/v1.php/cloud/user
D/GetRemoteUserInfoOperation: Successful response: {"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},"data":{"id":"admin","display-name":"admin","email":null}}}
E/GetRemoteUserInfoOperation: Exception while getting OC user information
                              org.json.JSONException: No value for quota
                                  at org.json.JSONObject.get(JSONObject.java:389)
                                  at org.json.JSONObject.getJSONObject(JSONObject.java:609)
                                  at com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.run(GetRemoteUserInfoOperation.java:152)
                                  at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
                                  at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:84)
                                  at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:41)
                                  at android.os.AsyncTask$2.call(AsyncTask.java:295)
                                  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                  at java.lang.Thread.run(Thread.java:818)
![device-2017-03-03-180547]

You can try it:

Server: https://demo.nextcloud.com/abcdtest UN: admin pw: admin

togglecode avatar Mar 03 '17 17:03 togglecode

device-2017-03-03-180547

togglecode avatar Mar 03 '17 17:03 togglecode

Are you building directly from source?

Try master then please :)

mario avatar Mar 03 '17 17:03 mario

Yeah, I am on master, I mean I did a clean checkout/pull from master :D

togglecode avatar Mar 03 '17 17:03 togglecode

Damn it. Will check soon.

On Fri, 3 Mar 2017 at 18:24, togglecode [email protected] wrote:

Yeah, I am on master, I mean I did a clean checkout/pull from master :D

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/nextcloud/android/issues/710#issuecomment-284015834, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWsgTTpnzQvgJPSqVVrRjaTILhQPs_ks5riEzMgaJpZM4MSbmu .

mario avatar Mar 03 '17 17:03 mario

Thanks. shrug Dunno how this one slipped through.

mario avatar Mar 03 '17 17:03 mario

That's the beauty of software engineering :p

togglecode avatar Mar 03 '17 17:03 togglecode