android icon indicating copy to clipboard operation
android copied to clipboard

Unable auto-uploading to "End-to-End encrypted" folder structure with "Use Subfolders" activated

Open simonsan opened this issue 3 years ago • 0 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Setup auto-upload to E2E encrypted folder structure with "Use Subfolders" activated
  2. Wait for it to start
  3. Watch it creating folders in the encrypted root/or not creating the folder structure at all
  4. See "Unknown error" in Uploads tab

Expected behaviour

Should create

  • the folder structure based on month and year and
  • be able to upload to the right folder correspondingly

Actual behaviour

Creates the month folder in the encrypted root dir and isn't able to upload anything. Fails even if the folder structure is created manually, in this case: root/2022/08/. Deactivating "Use Subfolders" fixes the problem.

For completeness: Encrypted folder is on external storage (via SFTP).

Android version

11

Device brand and model

Murena Fairphone 4

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

3.20.3

Nextcloud server version

24.0.3

Using a reverse proxy?

Yes

Android logs

08-03 16:03:29.878  8238  8288 D OwnCloudClient #0: REQUEST POST /ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/null
08-03 16:03:29.879  8238  8288 D AdvancedSslSocketFactory: Creating SSL Socket with remote <host>:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@c1f796d
08-03 16:03:29.880  8238  8288 D AdvancedSslSocketFactory:  ... with connection timeout 5000 and socket timeout 60000
08-03 16:03:29.881  8238  8288 I ServerNameIndicator: SSLSocket implementation: org.conscrypt.Java8EngineSocket
08-03 16:03:29.881  8238  8288 I ServerNameIndicator: SNI done, hostname: <host>
08-03 16:03:30.361  8238  8288 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/OpenCamera/IMG_20220803_160325.jpg to /nc-ext/MediaUpload/77f9b8fad5ad4ccd901eedd8b6f665ec/2022/08/IMG_20220803_160325.jpg: Unexpected exception
08-03 16:03:30.361  8238  8288 E UploadFileOperation: com.owncloud.android.operations.UploadException: Forbidden! Please try again later.)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.utils.EncryptionUtils.lockFolder(EncryptionUtils.java:805)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.operations.UploadFileOperation.encryptedUpload(UploadFileOperation.java:483)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.operations.UploadFileOperation.run(UploadFileOperation.java:450)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:187)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.files.services.FileUploader.uploadFile(FileUploader.java:640)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at com.owncloud.android.files.services.FileUploader$ServiceHandler.handleMessage(FileUploader.java:1396)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at android.os.Handler.dispatchMessage(Handler.java:106)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at android.os.Looper.loop(Looper.java:223)
08-03 16:03:30.361  8238  8288 E UploadFileOperation: 	at android.os.HandlerThread.run(HandlerThread.java:67)
08-03 16:03:30.362  8238  8288 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult(mSuccess=false, mHttpCode=-1, mHttpPhrase=null, mException=com.owncloud.android.operations.UploadException: Forbidden! Please try again later.), mCode=UNKNOWN_ERROR, message=null, getLogMessage=Unexpected exception) upload: com.owncloud.android.operations.UploadFileOperation@312a8b0
08-03 16:03:30.369  8238  8288 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/OpenCamera/IMG_20220803_160325.jpg with status:UPLOAD_FAILED and result:UNKNOWN (old:/storage/emulated/0/DCIM/OpenCamera/IMG_20220803_160325.jpg status:UPLOAD_IN_PROGRESS result:-1)
08-03 16:03:30.369  8238  8288 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/OpenCamera/IMG_20220803_160325.jpg with status=UPLOAD_FAILED
08-03 16:03:30.375  8238  8288 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/OpenCamera/IMG_20220803_160325.jpg
08-03 16:03:30.375  8238  8288 D UploadsStorageManager: notifyObserversNow
08-03 16:03:30.376  8238  8288 D FileUploader: NotifyUploadResult with resultCode: UNKNOWN_ERROR
08-03 16:03:30.386  8238  8288 D FileUploader: Stopping command after id 46

Server error logs

No errors.

Additional information

/e/-OS version 1.2-r-20220726206059-stable-FP4

Kernel version: 4.19.157-perf-gfdb7ef01a6c7

simonsan avatar Aug 03 '22 14:08 simonsan