Closed Bug 744441 Opened 12 years ago Closed 12 years ago

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

Categories

(Firefox for Android Graveyard :: Android Sync, defect)

ARM
Android
defect
Not set
normal

Tracking

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

VERIFIED FIXED
mozilla15
Tracking Status
firefox14 --- verified
firefox15 --- verified
blocking-fennec1.0 --- +

People

(Reporter: nhirata, Assigned: rnewman)

Details

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

Crash Data

Attachments

(2 files)

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)
Whiteboard: [native-crash]
I've seen this 5 times today
In fact, it was hit by only two users (two different OSes) from 14.0a1/20120408.
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
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: --- → ?
Not critical; not a common (or actually supported) scenario.
Severity: critical → normal
blocking-fennec1.0: ? → +
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Whiteboard: [native-crash] → [native-crash][reviewed, being tested]
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
Attached patch Patch.Splinter Review
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]
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
Closed: 12 years ago
Resolution: --- → FIXED
Attachment #618437 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/14173aceb23e
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
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: