nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.31k stars 1.77k forks source link

Instant upload with multiple accounts set #440

Closed kyn3s closed 7 years ago

kyn3s commented 7 years ago

Actual behaviour

Expected behaviour

Steps to reproduce

  1. Have multiple accounts set on your nextcloud server and mobile android app
  2. Set instant upload for photos. Take a picture with your camera.
  3. Switch from an account to the other one. Take another picture. It will be uploaded to the last account set

Environment data

Android version: 6.0.1

Device model: Samsung S7 edge

Stock or customized system: stock

Nextcloud app version: 1.4.0

Nextcloud server version: 10.0.1

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here
AndyScherzinger commented 7 years ago

basically a duplicate of #25 and solved by #98 which is already part of the beta app published on f-droid. Beware though that this will change in the near future for Android 6 and 5 devices which will be moved to the new auto upload which will always bind instant upload configurations per folder to the account where they have been configured, see https://nextcloud.com/blog/nextcloud-android-client-1.4.0-has-been-released/ for details on auto upload. :)

kyn3s commented 7 years ago

I'll check this for sure. Many thanks, Andy. Take care

Nebukadneza commented 7 years ago

Hello,

could you perhaps elaborate on how to configure this correctly? With CM14.1 (Android 7.1.1) and nextcloud-android 1.4.0 (F-Droid), auto-upload always uploads to the 2nd account — which is wrong in my use-case.

AndyScherzinger commented 7 years ago

Hi @Nebukadneza,

the auto-upload configured saves the account which was active when the auto upload has been activated for a folder. @tobiasKaminsky do you check for the account for which the auto upload folder config has been set?

Nebukadneza commented 7 years ago

Hey,

thanks for the clearification! I’m quite sure I’m doing that right. Is there some kind of fallback to the other server if one could not be reached? One of the servers’ DNS is slow to resolve (… don’t ask) in one of the networks I’m frequently in. Could this be why i see it uploading to the wrong server?

Thanks!

Nebukadneza commented 7 years ago

Hi,

after finally fixing my DNS issues, i can ascertain that it always gets uploaded to the wrong account. I’ve got some logs here …

` [camera does its magic …]

01-06 13:49:43.664 17764 17764 D Util : Parameters: scene-mode-values=auto,asd,landscape,snow,beach,sunset,night,portrait,backlight,sports,steadyphoto,flowers,candlelight,fireworks,party,night-portrait,theatre,action,AR,hdr, scene-mode=auto, selectable-zone-af-values=auto,spot-metering,center-weighted,frame-average, selectable-zone-af=auto, sharpness-step=6, sharpness=12, skinToneEnhancement-values=enable,disable, skinToneEnhancement=0, smooth-zoom-supported=false, snapshot-fd-data-enable=0, snapshot-hdr-values=off,on, snapshot-hdr=off, snapshot-picture-flip=off, supported-live-snapshot-sizes=3200x2400,2592x1944,2048x1536,1920x1080,1600x1200,1280x768,1280x720,1024x768,800x600,864x480,800x480,720x480,640x480,320x240, tintless=enable, touch-af-aec-values=touch-off,touch-on, touch-af-aec=touch-on, vertical-view-angle=49.1, video-flip=off, video-frame-format=yuv420sp, video-hdr-values=off,on, video-hdr=off, video-hfr-values=60,120,off, video-hfr=off, video-size-values=4096x2160,3840x2160,1920x1080,1280x720,864x480,800x480,720x480,640x480,320x240,176x144, video-size=1920x1080, video-skinbeauty-mode=off, video-snapshot-supported=true, video-stabilization-supported=false, voice-face-beauty=0, wb-current-cct=5088, whitebalance-values=auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,twilight,shade,manual-cct, whitebalance=auto, zoom-ratios=100,102,104,107,109,112,114,117,120,123,125,128,131,135,138,141,144,148,151,155,158,162,166,170,174,178,182,186,190,195,200,204,209,214,219,224,229,235,240,246,251,257,263,270,276,282,289,296,303,310,317,324,332,340,348,356,364,373,381,390,400, zoom-supported=true, zoom=0, zsl-values=off,on, zsl=on]

01-06 13:49:43.665 3388 3388 D FileUploader: Starting command with id 1

01-06 13:49:43.669 277 26149 D QCameraParameters: Requested preview size 1440 x 1080 01-06 13:49:43.669 277 26149 D QCameraParameters: int32_t qcamera::QCameraParameters::setVideoSize(const qcamera::QCameraParameters&) size 1920 x 1080 01-06 13:49:43.669 277 26149 D QCameraParameters: int32_t qcamera::QCameraParameters::setVideoSize(const qcamera::QCameraParameters&): persist.oppo.ctsversion is 0, is_cts 0 01-06 13:49:43.669 277 26149 D QCameraParameters: Requested picture size 4160 x 3120 01-06 13:49:43.669 277 26149 D QCameraParameters: requested jpeg thumbnail size 320 x 240 01-06 13:49:43.669 277 26149 D QCameraParameters: int32_t qcamera::QCameraParameters::setJpegThumbnailSize(const qcamera::QCameraParameters&): Could not find optimal size 01-06 13:49:43.669 277 26149 D QCameraParameters: optimal jpeg thumbnail size 320 x 240 01-06 13:49:43.669 277 26149 D QCameraParameters: Param m_bNoDisplayMode = 0 01-06 13:49:43.670 277 26149 D QCameraParameters: setHighResoultion: m_bHighResoultion:0 01-06 13:49:43.670 277 26149 D QCameraParameters: setNormalCaptureMode:0 01-06 13:49:43.670 277 26149 D QCameraParameters: VFB is null 01-06 13:49:43.670 277 26149 D QCameraParameters: int qcamera::QCameraParameters::setAutoRotate(const qcamera::QCameraParameters&) set auto rotate: 0 01-06 13:49:43.670 285 26167 E mm-camera: mct_pipeline_process_set:command=800000e 01-06 13:49:43.670 285 26167 E mm-camera-sensor: module_sensor_event_control_set_parm:2038 fb_mode 0

01-06 13:49:43.672 277 26149 D QCameraParameters: int32_t qcamera::QCameraParameters::setNumOfSnapshot(): nBurstNum = 1, nExpnum = 1 01-06 13:49:43.669 3388 3388 V UploadsStorageManager: Inserting /storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg with status=UPLOAD_IN_PROGRESS 01-06 13:49:43.689 3388 3388 D UploadsStorageManager: storeUpload returns with: content://org.nextcloud/uploads/186 for file: /storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg 01-06 13:49:43.689 3388 3388 D UploadsStorageManager: notifyObserversNow 01-06 13:49:43.698 3388 26036 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg status:UPLOAD_IN_PROGRESS result:-1) 01-06 13:49:43.698 3388 26036 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg with status=UPLOAD_IN_PROGRESS 01-06 13:49:43.711 3388 26036 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170106_134943.jpg 01-06 13:49:43.711 3388 26036 D UploadsStorageManager: notifyObserversNow 01-06 13:49:43.719 791 840 W ActivityManager: android.hardware.action.NEW_PICTURE no longer allowed; dropping from u0a63 01-06 13:49:43.719 3388 26036 D SimpleFactoryManager: getClientFor(OwnCloudAccount ... : 01-06 13:49:43.720 3388 26036 D OwnCloudClient #91: Creating OwnCloudClient 01-06 13:49:43.720 3388 26036 V SimpleFactoryManager: new client {XXX@nextcloud.XXX.de, 144124085} 01-06 13:49:43.727 3388 26036 D OwnCloudClient #91: REQUEST HEAD /remote.php/webdav/AutoPics/2017/01/ 01-06 13:49:43.728 3388 26036 D AdvancedSslSocketFactory: Creating SSL Socket with remote nextcloud.XXX.de:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@c7ae190 01-06 13:49:43.728 3388 26036 D AdvancedSslSocketFactory: ... with connection timeout 10000 and socket timeout 10000 01-06 13:49:43.752 3388 26036 I ServerNameIndicator: SSLSocket implementation: com.android.org.conscrypt.OpenSSLSocketImpl 01-06 13:49:43.752 3388 26036 I ServerNameIndicator: SNI done, hostname: nextcloud.XXX.de 01-06 13:49:43.778 3388 3388 D com.owncloud.android.files.InstantUploadBroadcastReceiver: Received: com.android.camera.NEW_PICTURE 01-06 13:49:43.778 3388 3388 I com.owncloud.android.files.InstantUploadBroadcastReceiver: New photo received 01-06 13:49:43.778 3388 3388 D com.owncloud.android.files.InstantUploadBroadcastReceiver: Instant picture upload disabled, ignoring new picture 01-06 13:49:43.778 3388 3388 D com.owncloud.android.files.InstantUploadBroadcastReceiver: UNOFFICIAL processed: com.android.camera.NEW_PICTURE 01-06 13:49:43.881 3614 26244 I iu.UploadsManager: NEW; upload media id: 11827; iu: -1

01-06 13:49:43.916 277 26130 D NuPlayerDriver: notifyListener_l(0xadc88360), (2, 0, 0), loop setting(0, 0)

01-06 13:49:43.947 17764 17764 V FocusRingRenderer: FOCUS STATE ENTER VIA setRadius(2008942, 204.48)

01-06 13:49:43.964 3614 26244 I iu.UploadsManager: NEW; upload media id: 11829; iu: -1 01-06 13:49:43.977 3614 26244 I iu.UploadsManager: End new media; added: 2, uploading: 2, time: 262 ms 01-06 13:49:44.528 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:44.587 3388 26036 D ExistenceCheckRemoteOperation: Existence check for https://nextcloud.XXX.de/remote.php/webdav/AutoPics/2017/01/ targeting for existence finished with HTTP status 404(FAIL) 01-06 13:49:44.588 3388 26036 D FileUtils: path ....... /AutoPics/2017/01/ 01-06 13:49:44.589 3388 26036 D OwnCloudClient #91: REQUEST MKCOL /remote.php/webdav/AutoPics/2017/01/ 01-06 13:49:45.304 3388 26036 D CreateRemoteFolderOperation: Create directory /AutoPics/2017/01/: Operation finished with HTTP status code 409 (fail) 01-06 13:49:45.305 3388 26036 D FileUtils: path ....... /AutoPics/2017/ 01-06 13:49:45.306 3388 26036 D OwnCloudClient #91: REQUEST MKCOL /remote.php/webdav/AutoPics/2017/ 01-06 13:49:45.532 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:45.919 3388 26036 D CreateRemoteFolderOperation: Create directory /AutoPics/2017/: Operation finished with HTTP status code 409 (fail) 01-06 13:49:45.919 3388 26036 D FileUtils: path ....... /AutoPics/ 01-06 13:49:45.920 3388 26036 D OwnCloudClient #91: REQUEST MKCOL /remote.php/webdav/AutoPics/ 01-06 13:49:46.230 277 26149 D QCameraParameters: update current cct value. old:5088, now:4943 01-06 13:49:46.531 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:46.665 277 26149 D QCameraParameters: update current cct value. old:4943, now:4887 01-06 13:49:46.902 277 26149 D QCameraParameters: update focus position. old:184, now:175 01-06 13:49:46.928 17764 17764 V FocusRingRenderer: FOCUS STATE ENTER VIA setRadius(2011922, 198.0) 01-06 13:49:46.947 269 435 D audio_hw_primary: out_standby: enter: stream (0xb613eec0) usecase(4: audio-ull-playback) 01-06 13:49:46.996 269 435 D hardware_info: hw_info_append_hw_type : device_name = speaker 01-06 13:49:47.062 277 26149 D QCameraParameters: update current cct value. old:4887, now:4831 01-06 13:49:47.148 3388 26036 D CreateRemoteFolderOperation: Create directory /AutoPics/: Operation finished with HTTP status code 201 (success) 01-06 13:49:47.149 3388 26036 D OwnCloudClient #91: REQUEST MKCOL /remote.php/webdav/AutoPics/2017/ 01-06 13:49:47.395 277 26149 D QCameraParameters: update current cct value. old:4831, now:4775 01-06 13:49:47.528 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:47.727 277 26149 D QCameraParameters: update current cct value. old:4775, now:4718 01-06 13:49:48.327 277 26149 D QCameraParameters: update current cct value. old:4718, now:4662 01-06 13:49:48.529 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:49.404 3388 26036 D CreateRemoteFolderOperation: Create directory /AutoPics/2017/: Operation finished with HTTP status code 201 (success) 01-06 13:49:49.405 3388 26036 D OwnCloudClient #91: REQUEST MKCOL /remote.php/webdav/AutoPics/2017/01/ 01-06 13:49:49.528 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:49.565 4486 4511 D QcrilMsgTunnelSocket: readRilMessage: Buffer = [B@77eb22d HexData = [010000000404000011000000514f454d484f4f4bef0308000100000001] 01-06 13:49:49.565 4486 4511 D QcrilMsgTunnelSocket: Rcvd UNSOL response with 28 bytes data for SUB0 01-06 13:49:49.565 4486 4511 D QcrilMsgTunnelSocket: Response ID 525295 is not served in this process. 01-06 13:49:49.565 4486 4511 D QcrilMsgTunnelSocket: To broadcast an Intent via the notifier to external apps 01-06 13:49:49.565 4486 4486 D QcrilMsgTunnelIfaceManager: handleMessage what = 0 01-06 13:49:49.567 791 2817 E ActivityManager: Sending non-protected broadcast com.qualcomm.intent.action.ACTION_UNSOL_RESPONSE_OEM_HOOK_RAW from system 4486:com.qualcomm.qcrilmsgtunnel/1001 pkg com.qualcomm.qcrilmsgtunnel 01-06 13:49:49.567 791 2817 E ActivityManager: java.lang.Throwable 01-06 13:49:49.567 791 2817 E ActivityManager: at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:18037) 01-06 13:49:49.567 791 2817 E ActivityManager: at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:18626) 01-06 13:49:49.567 791 2817 E ActivityManager: at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18717) 01-06 13:49:49.567 791 2817 E ActivityManager: at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:499) 01-06 13:49:49.567 791 2817 E ActivityManager: at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2967) 01-06 13:49:49.567 791 2817 E ActivityManager: at android.os.Binder.execTransact(Binder.java:565) 01-06 13:49:49.728 277 26149 D QCameraParameters: update focus position. old:175, now:168 01-06 13:49:49.746 17764 17764 V FocusRingRenderer: FOCUS STATE ENTER VIA setRadius(2014741, 192.95999) 01-06 13:49:50.460 277 26149 D QCameraParameters: update current cct value. old:4662, now:4718 01-06 13:49:50.528 791 2716 W GnssLocationProvider: Invalid size of GpsSvStatus found: 0. 01-06 13:49:50.838 3388 26036 D CreateRemoteFolderOperation: Create directory /AutoPics/2017/01/: Operation finished with HTTP status code 201 (success) 01-06 13:49:50.887 3388 26036 D CreateFolderOperation: Create directory /AutoPics/ in Database 01-06 13:49:50.920 3388 26036 D CreateFolderOperation: Create directory /AutoPics/2017/ in Database 01-06 13:49:50.952 3388 26036 D CreateFolderOperation: Create directory /AutoPics/2017/01/ in Database 01-06 13:49:50.967 3388 26036 D UploadFileOperation: Checking name collision in server 01-06 13:49:50.969 3388 26036 D OwnCloudClient #91: REQUEST HEAD /remote.php/webdav/AutoPics//2017/01/IMG_20170106_134943.jpg 01-06 13:49:50.995 791 2165 I PowerManagerService: Going to sleep due to power button (uid 1000)... `

I have tried enabling auto-upload on both accounts (to rule out an off-by-one when selecting the account), but to no end. It always uses nextcloud.XXX.de instead of nextcloud.YYY.de (names censored).

Thanks for your work on this nevertheless! -Dario