android icon indicating copy to clipboard operation
android copied to clipboard

android secondary user -- app crashes on startup after account credentials are provided

Open cguentherTUChemnitz opened this issue 8 years ago • 15 comments

Actual behaviour

  • nextcloud android app crashes hardly (app stopped working) during login on server when running with a secondary android user

Expected behaviour

  • the app should login correctly

Steps to reproduce

  1. use android multi-user capability and create a secondary user https://source.android.com/devices/tech/admin/multi-user
  2. login as secondary user
  3. install nextcloud app (via gplay app store)
  4. open nextcloud app and login into nextcloud server
  5. except the local data access rights requirement
  6. app crashes immediately

after the credentials are stored and the account exists

  1. open nextcloud app --> app crashes immediately

switch back to primary android user --> app works as expected switch back to secondary android user --> app crashed immediately

Environment data

Android version: 8.0.0

Device model: One Plus 3

Stock or customized system: Stock

Nextcloud app version: 3.1.0 (latest gplay app store version)

Nextcloud server version: 13.0.2 (latest official docker-hub version)

Logs

Web server error log

nothing interesting here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here --> no entries created during app crash

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

cguentherTUChemnitz avatar Jun 01 '18 13:06 cguentherTUChemnitz

Can you provide us additional infos via logcat? https://github.com/nextcloud/android/blob/master/README.md#getting-debug-info-via-logcat

tobiasKaminsky avatar Jun 01 '18 13:06 tobiasKaminsky

@AndyScherzinger I know you also have an OnePlus. Somehow I cannot even start the app as a second user, can you try it please?

tobiasKaminsky avatar Jun 04 '18 07:06 tobiasKaminsky

Sorry, i am very busy at the moment. I will look into it and try to provide the necessary logs. I hope i will get into this at the weekend.

cguentherTUChemnitz avatar Jun 07 '18 08:06 cguentherTUChemnitz

Same issue with Android work profile. App works correct in user profile but crashes in work profile during login attempt. Android 8.0.0 Huawei P10

I can try to provide a logfile if you send me the command to use logcat on a windows client

noriyuki41 avatar Jun 07 '18 10:06 noriyuki41

Here ist the part of the logfile concerning nextcloud. logcat_nextcloud.log

noriyuki41 avatar Jun 08 '18 06:06 noriyuki41

 Process: com.nextcloud.client, PID: 4804
06-08 08:04:12.399  4804  7925 E AndroidRuntime: java.lang.SecurityException: get package info: Neither user 1010181 nor current process has android.permission.INTERACT_ACROSS_USERS.
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1945)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1891)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.IAccountManager$Stub$Proxy.getAuthToken(IAccountManager.java:1488)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.AccountManager$11.doWork(AccountManager.java:1749)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.AccountManager$AmsTask.start(AccountManager.java:2240)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.AccountManager.getAuthToken(AccountManager.java:1746)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.AccountManager.getAuthToken(AccountManager.java:1658)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at android.accounts.AccountManager.blockingGetAuthToken(AccountManager.java:1495)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at com.owncloud.android.lib.common.OwnCloudClientFactory.createOwnCloudClient(OwnCloudClientFactory.java:109)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at com.owncloud.android.utils.ConnectivityUtils.isInternetWalled(ConnectivityUtils.java:67)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at com.owncloud.android.files.services.FileUploader$UploadRequester.retryFailedUploads(FileUploader.java:397)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0$FilesSyncHelper(FilesSyncHelper.java:239)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at com.owncloud.android.utils.FilesSyncHelper$$Lambda$0.run(Unknown Source:4)
06-08 08:04:12.399  4804  7925 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:784)

As far as I read, this permission would require that the app is signed via the android system, which is not true if it is installed via gplay/other store.

Anyway, thank you @noriyuki41 for providing the root problem :+1:

tobiasKaminsky avatar Jun 08 '18 07:06 tobiasKaminsky

@tobiasKaminsky so how would/could this be fixed? Or is this not possible?

AndyScherzinger avatar Jun 08 '18 08:06 AndyScherzinger

I found nothing valid. Only other devs who are also out of clue as there are some apps where it is working, but some not.

I tried it on my onePlus3, with LineageOS and installed current App via fdroid on both user "Tobi" and "test". It worked for me without a problem and I can access & download the files.

tobiasKaminsky avatar Jun 08 '18 10:06 tobiasKaminsky

@tobiasKaminsky interesting, that LineageOS is able to run it on a secondary user and the stock OxygenOS is not. Is there some kind of relaxed rights management ongoing on LineageOS?

cguentherTUChemnitz avatar Jun 08 '18 11:06 cguentherTUChemnitz

Good question, but maybe it is more related to fdroid and the priviliged right extension, with which I am installing the apps.

AFAIK @AndyScherzinger has a OnePlus3T with Lineage and Google stuff, maybe he can test.

tobiasKaminsky avatar Jun 08 '18 12:06 tobiasKaminsky

i got the same entries in my logcat:

06-08 06:38:51.934  9631  9677 E AndroidRuntime: FATAL EXCEPTION: Thread-4
06-08 06:38:51.934  9631  9677 E AndroidRuntime: Process: com.nextcloud.client, PID: 9631
06-08 06:38:51.934  9631  9677 E AndroidRuntime: java.lang.SecurityException: get package info: Neither user 1110116 nor current process has android.permission.INTERACT_ACROSS_USERS.
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1942)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:1888)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.IAccountManager$Stub$Proxy.getAuthToken(IAccountManager.java:1488)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.AccountManager$11.doWork(AccountManager.java:1767)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.AccountManager$AmsTask.start(AccountManager.java:2265)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.AccountManager.getAuthToken(AccountManager.java:1763)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.AccountManager.getAuthToken(AccountManager.java:1675)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at android.accounts.AccountManager.blockingGetAuthToken(AccountManager.java:1511)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at com.owncloud.android.lib.common.OwnCloudClientFactory.createOwnCloudClient(OwnCloudClientFactory.java:109)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at com.owncloud.android.utils.ConnectivityUtils.isInternetWalled(ConnectivityUtils.java:67)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0$FilesSyncHelper(FilesSyncHelper.java:238)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at com.owncloud.android.utils.FilesSyncHelper$$Lambda$0.run(Unknown Source:4)
06-08 06:38:51.934  9631  9677 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:764)

@tobiasKaminsky How did you manage to install the app with privileged rights?

cguentherTUChemnitz avatar Jun 11 '18 10:06 cguentherTUChemnitz

Privileged rights is a fdroid extensions: https://f-droid.org/en/packages/org.fdroid.fdroid.privileged/

It basically allows fdroid to install any app, so that you do not have to manually accept every app update. But it should make no difference, I assume.

tobiasKaminsky avatar Jun 14 '18 12:06 tobiasKaminsky

Same here: Huawei MediaTab M5, Android 8.0.0, FDroid, tried both Nextcloud app and Nextcloud Dev app, Nextcloud server 13.0.4. (Works for primary user without issues.)

not-a-user avatar Jun 18 '18 06:06 not-a-user

I have this issue too, using Shelter to manage the work profile. The problem disappeared when I installed nextcloud dev directly into the work profile using f-droid (separate installations, from gplay in my main one, and dev from f-droid in the work profile).

zerodogg avatar Jan 04 '19 22:01 zerodogg

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

stale[bot] avatar May 09 '19 22:05 stale[bot]