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

OneDrive vaults don't remain unlocked, breaking automatic photo uploads #495

Closed
2 tasks done
yfunk opened this issue May 24, 2023 · 3 comments
Closed
2 tasks done
Labels
type:bug Something isn't working
Milestone

Comments

@yfunk
Copy link

yfunk commented May 24, 2023

Please agree to the following

Summary

Even with auto-lock disabled, OneDrive vaults don't remain permanently unlocked due to authentication issues. As a result, automatic photo uploads will silently break after around a day without a new photo being taken.

System Setup

- Android: Android 13 (API 33)
- Cryptomator: 1.9.1

Cloud Type

OneDrive

Steps to Reproduce

  1. Add / create vault located in OneDrive
  2. Disable Automatic locking (When screen is disabled: Off and Lock after: Never)
  3. Enable Automatic photo upload (Activate: On, Upload instant: On, Upload only using WIFI: On, Upload videos: On) and select root directory of OneDrive vault for upload
  4. Unlock vault
  5. Take a picture (uploads as expected)
  6. Wait for around a day without taking a new picture (~18 hours when I last tested, could be even less)
  7. Take another picture (upload fails silently)

Expected Behavior

Vault remains permanently unlocked (Lock after: Never) to allow for continuous automatic photo upload to the OneDrive vault. Any new picture is uploaded immediately (Upload instant: On) after being taken.

Actual Behavior

When taking a new picture after some time has elapsed since the last picture was taken (~18 hours when I last tested, could be even less), the upload fails silently.

After taking a picture:

  • The "Automatic photo upload running" notification is displayed (but its status never updates to display the progress bar)
  • The "Vaults unlocked: 1" notification disappears shortly after

Nothing will be uploaded, even when taking more pictures afterwards – the upload failed silently and the vault locked silently. The only way to get the upload to work again is to open the Cryptomator app:

  • Upon opening the app, the vault is displayed as locked
  • When pressing it to unlock, a small 'Authenticating' toast notification is displayed (I assume for the cloud service, OneDrive in my case)
  • The app prompts for authentication for decrypting the vault
  • After successfully authenticating and decrypting the vault, the automatic photo upload starts again and pictures are uploaded successfully

Reproducibility

Always

Relevant Log Output

I	20230524112036.709	PhotoContentJob	Job started!
I	20230524112036.859	PhotoContentJob	Added file to UploadList
D	20230524112036.859	PhotoContentJob	Added file to UploadList /storage/emulated/0/DCIM/Camera/PXL_20230524_092024135.jpg
I	20230524112036.880	AutoUploadService	Starting background upload
I	20230524112036.892	PhotoContentJob	Job rescheduled!
I	20230524112036.893	PhotoContentJob	Service is destroyed
D	20230524112036.913	OkHttp	--> GET https://graph.microsoft.com/v1.0/drives/e01d9419821f8d80/items/E01D9419821F8D80!20675:/60-ezOAIEUTH4iI_xFP5x9cy-qgLwwOmnzIoXLIzOC9TGbWXuqy3.c9r: http/1.1 (unknown length)
D	20230524112036.913	OkHttp	SdkVersion: graph-java/v5.47.0
D	20230524112036.913	OkHttp	Accept: */*
D	20230524112036.913	OkHttp	SdkVersion: graph-java-core/v2.0.16 (featureUsage=0), android/33
D	20230524112036.913	OkHttp	client-request-id: eb6c8f33-11f8-4b42-b088-582ed11a0cba
D	20230524112036.913	OkHttp	--> END GET
D	20230524112037.168	OkHttp	<-- 401 Unauthorized https://graph.microsoft.com/v1.0/drives/e01d9419821f8d80/items/E01D9419821F8D80!20675:/60-ezOAIEUTH4iI_xFP5x9cy-qgLwwOmnzIoXLIzOC9TGbWXuqy3.c9r: (254ms)
D	20230524112037.169	OkHttp	Transfer-Encoding: chunked
D	20230524112037.169	OkHttp	Vary: Accept-Encoding
D	20230524112037.169	OkHttp	Strict-Transport-Security: max-age=31536000
D	20230524112037.169	OkHttp	request-id: 13486e6e-f23f-4ad2-ad94-489c728235d1
D	20230524112037.169	OkHttp	client-request-id: eb6c8f33-11f8-4b42-b088-582ed11a0cba
D	20230524112037.169	OkHttp	x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"FR1PEPF0000099E"}}
D	20230524112037.169	OkHttp	Date: Wed, 24 May 2023 09:20:34 GMT
D	20230524112037.169	OkHttp	<-- END HTTP
E	20230524112037.213	CrashLogging	org.cryptomator.domain.exception.authentication.WrongCredentialsException: Authentication failed
	at org.cryptomator.data.cloud.onedrive.OnedriveCloudContentRepository.throwWrongCredentialsExceptionIfRequired(OnedriveCloudContentRepository.kt:45)
	at org.cryptomator.data.cloud.onedrive.OnedriveCloudContentRepository.throwWrappedIfRequired(OnedriveCloudContentRepository.kt:33)
	at org.cryptomator.data.cloud.InterceptingCloudContentRepository.exists(InterceptingCloudContentRepository.kt:95)
	at org.cryptomator.data.repository.DispatchingCloudContentRepository.exists(DispatchingCloudContentRepository.kt:92)
	at org.cryptomator.data.cloud.crypto.CryptoImplDecorator.assertCryptoFileAlreadyExists(CryptoImplDecorator.kt:250)
	at org.cryptomator.data.cloud.crypto.CryptoImplDecorator.writeShortNameFile(CryptoImplDecorator.kt:430)
	at org.cryptomator.data.cloud.crypto.CryptoImplVaultFormat7.write(CryptoImplVaultFormat7.kt:460)
	at org.cryptomator.data.cloud.crypto.CryptoCloudContentRepository.write(CryptoCloudContentRepository.kt:90)
	at org.cryptomator.data.cloud.crypto.CryptoCloudContentRepository.write(CryptoCloudContentRepository.kt:21)
	at org.cryptomator.data.repository.DispatchingCloudContentRepository.write(DispatchingCloudContentRepository.kt:149)
	at org.cryptomator.presentation.service.AutoUploadService.writeCloudFile(AutoUploadService.java:219)
	at org.cryptomator.presentation.service.AutoUploadService.upload(AutoUploadService.java:206)
	at org.cryptomator.presentation.service.AutoUploadService.upload(AutoUploadService.java:199)
	at org.cryptomator.presentation.service.AutoUploadService.upload(AutoUploadService.java:175)
	at org.cryptomator.presentation.service.AutoUploadService.lambda$startBackgroundImageUpload$1$org-cryptomator-presentation-service-AutoUploadService(AutoUploadService.java:109)
	at org.cryptomator.presentation.service.AutoUploadService$$ExternalSyntheticLambda1.run(Unknown Source:6)
	at java.lang.Thread.run(Thread.java:1012)

ErrorCode: 9U45:KFFO
Opening the app and unlocking vault
I	20230524112134.248	App	Cryptomator v1.9.1 (2807) "Google Play Edition" started on android 13 / API33 using a Pixel 6
D	20230524112134.248	App	appId org.cryptomator
D	20230524112134.263	ActivityLifecycle	onCreate org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
I	20230524112134.267	Database	Configure v12
I	20230524112134.267	Database	Open v12
V	20230524112134.284	FragmentLifecycle	onCreate VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
V	20230524112134.284	FragmentLifecycle	onCreateView VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
V	20230524112134.286	FragmentLifecycle	onViewCreated VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
V	20230524112134.287	FragmentLifecycle	onActivityCreated VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
V	20230524112134.287	FragmentLifecycle	onStart VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112134.287	ActivityLifecycle	onStart org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
I	20230524112134.289	ActivityLifecycle	onResume org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
V	20230524112134.290	FragmentLifecycle	onResume VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112134.290	ActivityLifecycle	onResumeFragments org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
D	20230524112134.290	GetVaultListUseCase	started 4d104e3c
D	20230524112134.290	PresenterLifecycle	resume org.cryptomator.presentation.presenter.VaultListPresenter@9626541
D	20230524112134.291	GetVaultListUseCase	finished 4d104e3c
D	20230524112134.299	CryptorsService	created
D	20230524112134.302	AutoUploadService	created
I	20230524112134.327	App	Cryptors service connected
I	20230524112134.328	App	Cryptors service connected
I	20230524112134.328	App	Auto upload service connected
D	20230524112134.339	GetVaultListUseCase	started 4d104e3d
D	20230524112134.339	GetVaultListUseCase	finished 4d104e3d
D	20230524112140.608	GetVaultListUseCase	started 4d104e3e
D	20230524112140.610	GetVaultListUseCase	finished 4d104e3e
V	20230524112141.536	FragmentLifecycle	onPause VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112141.536	ActivityLifecycle	onPause org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
D	20230524112141.536	PresenterLifecycle	pause org.cryptomator.presentation.presenter.VaultListPresenter@9626541
D	20230524112141.546	ActivityLifecycle	onCreate org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
V	20230524112141.547	FragmentLifecycle	onCreate UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
V	20230524112141.548	FragmentLifecycle	onCreateView UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
V	20230524112141.548	FragmentLifecycle	onViewCreated UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
V	20230524112141.548	FragmentLifecycle	onActivityCreated UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
V	20230524112141.548	FragmentLifecycle	onStart UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112141.549	ActivityLifecycle	onStart org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112141.549	GetUnverifiedVaultConfigUseCase	started 4d106aaa
I	20230524112141.549	ActivityLifecycle	onResume org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
V	20230524112141.550	FragmentLifecycle	onResume UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112141.550	ActivityLifecycle	onResumeFragments org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112141.550	PresenterLifecycle	resume org.cryptomator.presentation.presenter.UnlockVaultPresenter@bfbc268
D	20230524112141.563	OkHttp	--> GET https://graph.microsoft.com/v1.0/me/drive/root http/1.1 (unknown length)
D	20230524112141.563	OkHttp	SdkVersion: graph-java/v5.47.0
D	20230524112141.563	OkHttp	Accept: */*
D	20230524112141.563	OkHttp	SdkVersion: graph-java-core/v2.0.16 (featureUsage=0), android/33
D	20230524112141.563	OkHttp	client-request-id: 79b7be43-06c4-48eb-8257-57a40d27c698
D	20230524112141.563	OkHttp	--> END GET
D	20230524112141.860	OkHttp	<-- 401 Unauthorized https://graph.microsoft.com/v1.0/me/drive/root (296ms)
D	20230524112141.861	OkHttp	Transfer-Encoding: chunked
D	20230524112141.861	OkHttp	Vary: Accept-Encoding
D	20230524112141.861	OkHttp	Strict-Transport-Security: max-age=31536000
D	20230524112141.861	OkHttp	request-id: 389dbcac-7727-481b-b0ac-c8830764e0bf
D	20230524112141.861	OkHttp	client-request-id: 79b7be43-06c4-48eb-8257-57a40d27c698
D	20230524112141.861	OkHttp	x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"FR1PEPF000007A5"}}
D	20230524112141.862	OkHttp	Date: Wed, 24 May 2023 09:21:38 GMT
D	20230524112141.862	OkHttp	<-- END HTTP
D	20230524112141.871	GetUnverifiedVaultConfigUseCase	failed 4d106aaa
V	20230524112141.886	FragmentLifecycle	onPause UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112141.886	ActivityLifecycle	onPause org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112141.886	PresenterLifecycle	pause org.cryptomator.presentation.presenter.UnlockVaultPresenter@bfbc268
D	20230524112141.890	ActivityLifecycle	onCreate org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112141.895	ActivityLifecycle	onStart org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
I	20230524112141.896	ActivityLifecycle	onResume org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112141.896	ActivityLifecycle	onResumeFragments org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112141.896	PresenterLifecycle	resume org.cryptomator.presentation.presenter.AuthenticateCloudPresenter@2c3f308
V	20230524112141.929	FragmentLifecycle	onStop VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112141.929	ActivityLifecycle	onStop org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
D	20230524112141.929	ActivityLifecycle	onSaveInstanceState org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
V	20230524112141.961	FragmentLifecycle	onStop UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112141.962	ActivityLifecycle	onStop org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112141.962	ActivityLifecycle	onSaveInstanceState org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
I	20230524112142.901	AuthenticateCloudPresenter	Successfully authenticated
D	20230524112142.914	GetUsernameUseCase	started 4d106c03
D	20230524112142.921	OkHttp	--> GET https://graph.microsoft.com/v1.0/me/drive http/1.1 (unknown length)
D	20230524112142.921	OkHttp	SdkVersion: graph-java/v5.47.0
D	20230524112142.921	OkHttp	Accept: */*
D	20230524112142.921	OkHttp	SdkVersion: graph-java-core/v2.0.16 (featureUsage=0), android/33
D	20230524112142.921	OkHttp	client-request-id: 07cb2686-7f6a-4fb2-b53a-d91cdd18b49d
D	20230524112142.921	OkHttp	--> END GET
D	20230524112143.323	OkHttp	<-- 200 OK https://graph.microsoft.com/v1.0/me/drive (401ms)
D	20230524112143.323	OkHttp	Cache-Control: no-store
D	20230524112143.323	OkHttp	Transfer-Encoding: chunked
D	20230524112143.324	OkHttp	Vary: Accept-Encoding
D	20230524112143.324	OkHttp	Strict-Transport-Security: max-age=31536000
D	20230524112143.324	OkHttp	request-id: 33f36923-459c-4917-ae8d-5999bfd89c2b
D	20230524112143.324	OkHttp	client-request-id: 07cb2686-7f6a-4fb2-b53a-d91cdd18b49d
D	20230524112143.324	OkHttp	x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"FR1PEPF000007AB"}}
D	20230524112143.324	OkHttp	OData-Version: 4.0
D	20230524112143.324	OkHttp	Date: Wed, 24 May 2023 09:21:40 GMT
D	20230524112143.324	OkHttp	<-- END HTTP
D	20230524112143.359	GetUsernameUseCase	finished 4d106c03
D	20230524112143.360	AddOrChangeCloudConnectionUseCase	started 4d106c03
D	20230524112143.363	AddOrChangeCloudConnectionUseCase	finished 4d106c03
D	20230524112143.365	ActivityLifecycle	finish org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112143.405	ActivityLifecycle	onPause org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112143.405	PresenterLifecycle	pause org.cryptomator.presentation.presenter.AuthenticateCloudPresenter@2c3f308
D	20230524112143.412	ActivityLifecycle	onRestart org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
V	20230524112143.413	FragmentLifecycle	onStart VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112143.413	ActivityLifecycle	onStart org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
D	20230524112143.414	ActivityLifecycle	onRestart org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
V	20230524112143.414	FragmentLifecycle	onStart UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112143.414	ActivityLifecycle	onStart org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112143.415	GetUnverifiedVaultConfigUseCase	started 4d106aab
I	20230524112143.416	ActivityLifecycle	onResume org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
V	20230524112143.417	FragmentLifecycle	onResume UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112143.418	ActivityLifecycle	onResumeFragments org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112143.418	PresenterLifecycle	resume org.cryptomator.presentation.presenter.UnlockVaultPresenter@bfbc268
D	20230524112143.417	OkHttp	--> GET https://graph.microsoft.com/v1.0/me/drive/root http/1.1 (unknown length)
D	20230524112143.418	OkHttp	SdkVersion: graph-java/v5.47.0
D	20230524112143.418	OkHttp	Accept: */*
D	20230524112143.418	OkHttp	SdkVersion: graph-java-core/v2.0.16 (featureUsage=0), android/33
D	20230524112143.418	OkHttp	client-request-id: 30fb1d10-1141-4d08-b2bc-b0ebf56bc099
D	20230524112143.418	OkHttp	--> END GET
D	20230524112143.453	ActivityLifecycle	onStop org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112143.454	ActivityLifecycle	onDestroy org.cryptomator.presentation.ui.activity.AuthenticateCloudActivity@cdfd2bb
D	20230524112143.454	PresenterLifecycle	destroy org.cryptomator.presentation.presenter.AuthenticateCloudPresenter@2c3f308
[...]
D	20230524112144.804	GetUnverifiedVaultConfigUseCase	finished 4d106aab
D	20230524112144.813	BiometricAuthentication	Show biometric auth prompt
D	20230524112144.813	PrepareUnlockUseCase	started 4d106aaa
[...]
D	20230524112145.298	PrepareUnlockUseCase	finished 4d106aaa
D	20230524112147.189	BiometricAuthentication	Authentication finished successfully
V	20230524112147.197	Progress	UNKNOWN_MIMETYPE -1%
D	20230524112147.198	UnlockVaultUsingMasterkeyUseCase	started 4d106aaa
D	20230524112147.540	UnlockVaultUsingMasterkeyUseCase	finished 4d106aaa
D	20230524112147.540	ActivityLifecycle	finish org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
V	20230524112147.562	FragmentLifecycle	onPause UnlockVaultFragment{1ef1b38} (b41622f8-3dce-4755-b69d-21a7f928bc49 id=0x7f0a0123 tag=UnlockVaultFragment)
D	20230524112147.563	ActivityLifecycle	onPause org.cryptomator.presentation.ui.activity.UnlockVaultActivity@7b3aa25
D	20230524112147.563	PresenterLifecycle	pause org.cryptomator.presentation.presenter.UnlockVaultPresenter@bfbc268
D	20230524112147.576	GetRootFolderUseCase	started 4d104e3c
D	20230524112147.577	GetRootFolderUseCase	finished 4d104e3c
I	20230524112147.577	ActivityLifecycle	onResume org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
V	20230524112147.578	FragmentLifecycle	onResume VaultListFragment{7ad9b1c} (3c3c3e6b-fca5-4f95-8ca4-af02ccf18cd2 id=0x7f0a0123)
D	20230524112147.579	GetVaultListUseCase	started 4d104e3f
D	20230524112147.579	ActivityLifecycle	onResumeFragments org.cryptomator.presentation.ui.activity.VaultListActivity@6b35bb7
D	20230524112147.579	PresenterLifecycle	resume org.cryptomator.presentation.presenter.VaultListPresenter@9626541
D	20230524112147.579	GetVaultListUseCase	finished 4d104e3f
D	20230524112147.580	UpdateVaultParameterIfChangedRemotelyUseCase	started 4d104e3d
D	20230524112147.580	UpdateVaultParameterIfChangedRemotelyUseCase	finished 4d104e3d
D	20230524112147.591	GetVaultListUseCase	started 4d104e40
D	20230524112147.591	GetVaultListUseCase	finished 4d104e40
V	20230524112147.603	Progress	COMPLETED -1%
I	20230524112147.608	AutoUploadService	Starting background upload

The logs are from the moment I took a new picture (upload fails silently), to me opening the app, manually unlocking the vault and the background upload starting again. I omitted ([...]) some of the OkHttp logs of successful requests after unlocking the vault to make everything more readable.

Anything else?

It appears the cause of the problem is that authentication with OneDrive fails after the background upload is started (401 Unauthorized leading to WrongCredentialsException), with the crash (of the whole app?) also leading to the vault being locked. Probably because of using an expired auth token?

My use case for Cryptomator Android is automatically uploading all the pictures I take to an encrypted vault in OneDrive so I can access them on my PC. I don't care about the vault being permanently unlocked, since my pictures are accessible anyway when my phone is unlocked.

This issue unfortunately makes Cryptomator Android pretty useless for me, when it would otherwise be an excellent fit for my use case. Hope we can get this fixed soon 🙂

@yfunk yfunk added the type:bug Something isn't working label May 24, 2023
@SailReal
Copy link
Member

SailReal commented May 24, 2023

You are right, in this case a failed authentication due to a stale token does not result in a token refresh, but it should.

We'll have a look at it.

@SailReal SailReal added this to the 1.10.0 milestone Jun 5, 2023
@SailReal
Copy link
Member

SailReal commented Jun 5, 2023

device-2023-06-05-201053.mp4

Unfortunately, the only solution was to display a notification if the authentication fails during auto upload, as OneDrive in particular requires a UI to update the token. On Android, however, this UI cannot be displayed from anywhere.

At least when you click on the notification, the token is updated and the upload starts immediately. It's not perfect, but IMO it couldn't be any better given these requirements.

@yfunk
Copy link
Author

yfunk commented Jun 15, 2023

I got the first "tap to refresh authentication" notification today, and the process was pretty painless overall. Given the constraints, I agree that this is the best solution to the issue.

Just one small remark: It would be nice if the Cryptomator app used notification channels as proposed in #475 so that the "authentication failed" notification doesn't get stuck in the silent notifications where I put the "vault unlocked" one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants