crash in java.lang.IllegalArgumentException: account is null at android.accounts.AccountManager.getUserData(AccountManager.java:322)

VERIFIED FIXED in Firefox 14

Status

()

Firefox for Android
Android Sync
VERIFIED FIXED
6 years ago
7 months ago

People

(Reporter: nhirata, Assigned: rnewman)

Tracking

({crash})

unspecified
mozilla15
ARM
Android
crash
Points:
---

Firefox Tracking Flags

(firefox14 verified, firefox15 verified, blocking-fennec1.0 +)

Details

(Whiteboard: [native-crash][qa+], crash signature)

Attachments

(2 attachments)

This bug was filed from the Socorro interface and is 
report bp-10607757-e464-40ac-a5a6-e1a122120409 .
============================================================= 
java.lang.IllegalArgumentException: account is null
	at android.accounts.AccountManager.getUserData(AccountManager.java:322)
	at org.mozilla.gecko.sync.syncadapter.SyncAdapter.getClientsCount(SyncAdapter.java:452)
	at org.mozilla.gecko.sync.syncadapter.SyncAdapter.getSyncInterval(SyncAdapter.java:315)
	at org.mozilla.gecko.sync.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:302)
	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:167)

Updated

6 years ago
Whiteboard: [native-crash]
I've seen this 5 times today

Comment 2

6 years ago
In fact, it was hit by only two users (two different OSes) from 14.0a1/20120408.
(Assignee)

Comment 3

6 years ago
Stealing this. This isn't supposed to be possible.
Component: General → Android Sync
Product: Fennec Native → Mozilla Services
QA Contact: general → android-sync
Version: Firefox 14 → unspecified
(Assignee)

Comment 5

6 years ago
The short-term issue here is that we're being handed a 'null' account (one that includes no fields, so we can't sync with it), but our backoff code isn't aware of this error case.

Should be a trivial fix.

The root cause is having more than one Fennec installed; I don't think Android deals well with authenticators that attach metadata to the account (in that I think it stores metadata per-authenticator, and we have multiple authenticators), and so we end up with a blank account object when we're asked to sync.

Suggesting softblocker to avoid crash reports.
blocking-fennec1.0: --- → ?
(Assignee)

Comment 6

6 years ago
Not critical; not a common (or actually supported) scenario.
Severity: critical → normal
blocking-fennec1.0: ? → +
(Assignee)

Updated

6 years ago
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Whiteboard: [native-crash] → [native-crash][reviewed, being tested]
(Assignee)

Comment 7

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/ca8d60bd5994

Thanks for testing, Chenxia.

This fix will correctly and quietly skip the sync if we get a blank Account object. It also disables syncing this product.

QA: to repro, you need two versions of Fennec installed. Verify that when the second syncs, it produces log output "No credentials attached to account. Aborting sync.", and that afterwards only one box is checked in the account settings app. The other version of Fennec should sync correctly.

Behavior with only one Fennec installed should be unchanged.
Whiteboard: [native-crash][reviewed, being tested] → [native-crash]
Target Milestone: --- → mozilla15
(Assignee)

Comment 8

6 years ago
Created attachment 618437 [details] [diff] [review]
Patch.

Low-risk fix for an edge case, avoids crash submissions.

Happy to let this bake on m-c for a couple days; just flagging so I don't forget about it!
Attachment #618437 - Flags: review+
Attachment #618437 - Flags: approval-mozilla-aurora?
Tested and works as expected.

STR

- Install two versions of Android Firefox (e.g., Fennec-debug and Nightly)
- Set up sync through the Firefox version that is *not* being tested for the fix (if both versions have the fix, it doesn't matter)
- Go to Settings > Accounts > (Firefox Sync account)
- Under "Data & Synchronization," only the Firefox version that Sync was set up through will be checked.
- Check the box for the Firefox version that is being tested. Sync should be kicked off automatically; if not, force a sync.

Expected:
No errors in the logs. In "Data & Synchronization" the newly checked Firefox version should be unchecked again.

Previous errors:
Fennec would "stop unexpectedly." Errors show up in the logs for "account is null".
Whiteboard: [native-crash] → [native-crash][landed on github]
(Assignee)

Comment 10

6 years ago
Removing GitHub annotation: this is in mozilla-inbound, which is why there's a target milestone set.
Whiteboard: [native-crash][landed on github] → [native-crash]
https://hg.mozilla.org/mozilla-central/rev/ca8d60bd5994
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Attachment #618437 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 12

6 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/14173aceb23e
status-firefox14: --- → fixed
Whiteboard: [native-crash] → [native-crash][qa+]
This crash doesn't occur anymore on the latest Aurora and Nightly builds. Closing bug as verified fixed on:

Firefox 15.0a1 (2012-05-29)
Firefox 14.0a2 (2012-05-29)

Device: Galaxy Nexus
OS: Android 4.0.2
Status: RESOLVED → VERIFIED
status-firefox14: fixed → verified
status-firefox15: --- → verified
Component: Android Sync → Android Sync
Product: Mozilla Services → Android Background Services

Updated

7 months ago
Product: Android Background Services → Firefox for Android
You need to log in before you can comment on or make changes to this bug.