AndlyticsProject / andlytics

Google Play - Android Market statistics app
Other
536 stars 181 forks source link

Redundant 'Authentication Failed' notifications #528

Open Ltty opened 11 years ago

Ltty commented 11 years ago

Although app stats can be downloaded again I receive a notification each time Andlytics tries to download stats and then the download fails. It says: Authentication failed. Additional authentication required. If I retry afterwards it works but still shows the notification which is a bit annoying.

nelenkov commented 11 years ago

What version are you using? Can you capture logcat at the time the problem happens?

robertdavidbarker commented 11 years ago

Using version 2.5.6 I am also getting this notification error. Clicking on it just takes me to my google account in a browser - but can't do anything useful there. Quite annoying really.

I managed to manually reproduce this issue by pulling out the internet from my router (i.e phone thought it had a network connection to the router, so attempted things). When plugging internet back in, the notification popped up again. I was also in Accounts & Sync settings and disabling then re-enabling Andlytics background data sync.

So it seems it occurs when internet has a dodgy connection.

Logcat is below:

09-02 09:35:47.847: D/AccountManagerAuthenticator(30841): Opening login URL in browser: https://www.google.com/accounts/TokenAuth?source=android-browser&auth=Error%3Dunknown%0AUrl%3Dhttps%3A%2F%2Fwww.google.com%2Faccounts%2FErrorMsg%3Fid%3Dunknown%26service%3Dgaia%0A&continue=https%3A%2F%2Fplay.google.com%2Fapps%2Fpublish%2F
09-02 09:35:47.847: D/OnDemandProgressBar(10498): release indeterminate drawable android.widget.OnDemandProgressBar@42212a30
09-02 09:35:47.847: D/OnDemandProgressBar(10498): new OnDemandProgressBar android.widget.OnDemandProgressBar@42212a30
09-02 09:35:47.857: D/SizeAdaptiveLayout(10498): com.android.internal.widget.SizeAdaptiveLayout@4215b740child view android.widget.FrameLayout@42243a00 measured out of bounds at 95px clamped to 96px
09-02 09:35:47.877: E/SyncAdapterService(30841): error during sync
09-02 09:35:47.877: E/SyncAdapterService(30841): com.github.andlyticsproject.console.AuthenticationException: Couldn't get developer account ID.
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.console.v2.AccountManagerAuthenticator.authenticateInternal(AccountManagerAuthenticator.java:213)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.console.v2.AccountManagerAuthenticator.authenticateSilently(AccountManagerAuthenticator.java:77)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.console.v2.DevConsoleV2.authenticate(DevConsoleV2.java:348)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.console.v2.DevConsoleV2.authenticateFromScratch(DevConsoleV2.java:327)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.console.v2.DevConsoleV2.getAppInfo(DevConsoleV2.java:102)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.sync.SyncAdapterService.performSync(SyncAdapterService.java:93)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.sync.SyncAdapterService.access$0(SyncAdapterService.java:86)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at com.github.andlyticsproject.sync.SyncAdapterService$SyncAdapterImpl.onPerformSync(SyncAdapterService.java:64)
09-02 09:35:47.877: E/SyncAdapterService(30841):    at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)

Perhaps some intelligence about when to display this error, but storing the fact that it has worked in the passed, so assume it must be a network error.

nelenkov commented 11 years ago

Thanks for the logcat. I will try to reproduce, but that is indeed an error URL, so mostly working as intended :) Still not sure why this happens very often for some users, maybe something on the device is restricting background data? Are you using any such app or system setting?

As for the error itself, there is really no way to know all the error URLs that can be returned, so it's a bit hard to make it intelligent. We originally decided that it would be helpful to open the returned URL in the browser for debugging login issues, but if it is happening every time, it's not that helpful. One way to handle this is to simply add a setting to disable this notification and just fail syncing. If this is really related to restricted background data though, the smarter thing to do would be try to check if any restrictions are applied and simply don't try to sync in that case.

robertdavidbarker commented 11 years ago

I'm not using any data restricting apps, and this is on WiFi so no data usage limits reached.

robertdavidbarker commented 11 years ago

Perhaps you could just cancel the notification when it eventually does work again (and when you enter the app)?

nelenkov commented 11 years ago

That could work, but it will pop up again on the next failed background sync.