Closed Bug 1177920 Opened 9 years ago Closed 9 years ago

isSyncActive: "account must not be null" when forcing a sync

Categories

(Android Background Services Graveyard :: Firefox Accounts, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1135281

People

(Reporter: mhaigh, Unassigned, Mentored)

References

Details

(Whiteboard: [lang=java])

When forcing a sync on nightly I'm getting a crash: https://etherpad.mozilla.org/zN8AN26vbM
Assignee: mhaigh → nobody
Component: General → Firefox Accounts
Flags: needinfo?(nalexander)
Product: Firefox for Android → Android Background Services
Summary: Crash on force sync → isSyncActive: "account must not be null" when forcing a sync
Good grief.  I certainly don't see this locally.

I guess the first thing to understand is what Android version you're running, and then we'll start digging in to which SyncStatusListener implementation is returning null in getAccount().  I wonder if we can annotate that so it's not possible?
Flags: needinfo?(nalexander)
This could be a good first bug.  To track it down, you'll want to find all implementors of SyncStatusListener [1] and figure out (and if possible, assert that they don't) which could return null from getAccount().  Based on mhaigh's log, it looks like FxAccountStatusFragment itself is wrong.  I don't really understand how this could happen in regular usage, but there are always edge cases...

[1] I see 4 in IntelliJ.  Start with https://dxr.mozilla.org/mozilla-central/search?q=SyncStatusListener&case=true&redirect=true to see them.
Mentor: nalexander, vivekb.balakrishnan
Whiteboard: [lang=java][good first bug]
Running Android 5.0 on my SGS5 (SM-G900F).  Also seen on my N7 running 5.1.1.  Both of these are running local dev builds (tip:#8c5ada29852a)
Blocks: 1178804
I'm also running into this using a Nexus 9 (Android 5.1.1).
Thanks for confirmation sebastian.  vivek, can you start doing the research on this?  Sounds like our Activity/Fragment life-cycle is busted on Android 5.
Flags: needinfo?(vivekb.balakrishnan)
I'm on it
Flags: needinfo?(vivekb.balakrishnan)
(In reply to Nick Alexander :nalexander (PTO July 17-27) from comment #5)
> Thanks for confirmation sebastian.  vivek, can you start doing the research
> on this?  Sounds like our Activity/Fragment life-cycle is busted on Android
> 5.

I installed a Nightly build from http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/2015-07-13-03-02-04-mozilla-central-android-api-11/fennec-42.0a1.multi.android-arm.apk.

Nexus 6, Android 5.1.1.

Start Fennec, "Sign in to Firefox" from first run, create new Firefox Account, verify on Desktop.  Firefox > Settings > Sync, observe "Your account needs to be verified".  Tap "Sync now", successful Sync occurs.

Hard kill Fennec and Fennec Sync activities.  Start Fennec, go to Settings > Sync, tap "Sync now", successful Sync occurs.
As agreed over irc, this definitely is not a good first bug and needs some investigation.
Whiteboard: [lang=java][good first bug] → [lang=java]
Would this be a good next bug that I could take up? I've worked on and submitted a bug although admittedly a long time ago.
(In reply to swaroop.rao from comment #9)
> Would this be a good next bug that I could take up? I've worked on and
> submitted a bug although admittedly a long time ago.

If you have an Android 5 device, a little investigation would go a long way.
Would be happy to investigate and yes, I've got a Nexus 6 running 5.1.1, but it looks like you have already done some investigation on the same platform. Is there anything else specifically that you would like me to investigate?
The original problem seems to be buried deep in C++ land. Specifically, the lines 110 from the logs attached by mhaigh. 

F/art     ( 3169): art/runtime/runtime.cc:289]   native: #16 pc 002c52b1  /data/dalvik-cache/arm/data@app@org.mozilla.fennec_martyn-1@base.apk@classes.dex (Java_org_mozilla_gecko_sqlite_SQLiteBridge_sqliteCallWithDb__JLjava_lang_String_2_3Ljava_lang_String_2_3J+172)
F/art     ( 3169): art/runtime/runtime.cc:289]   at org.mozilla.gecko.sqlite.SQLiteBridge.sqliteCallWithDb(Native method)
F/art     ( 3169): art/runtime/runtime.cc:289]   at org.mozilla.gecko.sqlite.SQLiteBridge.internalQuery(SQLiteBridge.java:245)
F/art     ( 3169): art/runtime/runtime.cc:289]   at org.mozilla.gecko.sqlite.SQLiteBridge.rawQuery(SQLiteBridge.java:139)
F/art     ( 3169): art/runtime/runtime.cc:289]   at org.mozilla.gecko.sqlite.SQLiteBridge.query(SQLiteBridge.java:133)
F/art     ( 3169): art/runtime/runtime.cc:289]   at 

NIing jchen to shed some light on this.
Flags: needinfo?(nchen)
The log says one of the query params is null, and it looks to be the same as bug 1135281 that landed recently. Please reopen if this is still reproducible in latest Nightly.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(nchen)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.