[Homescreen] Empty or incomplete homescreen after a full flash

RESOLVED FIXED in Firefox OS v2.2

Status

Firefox OS
Gaia::Build
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: julienw, Assigned: ochameau)

Tracking

unspecified
2.2 S3 (9jan)
x86_64
Linux

Firefox Tracking Flags

(tracking-b2g:backlog, b2g-v2.2 fixed)

Details

(Whiteboard: [systemsfe])

Attachments

(7 attachments)

(Reporter)

Description

4 years ago
I full flashed my Flame-kk to nightly, and after the FTU I got an empty homescreen.

Here are the error messages I have:

11-21 17:49:27.386  1108  1108 E Homescreen: Content JS ERROR: Bookmark store: Cannot get access to the Store 
11-21 17:49:27.636   206   617 W GeckoConsole: [JavaScript Error: "IndexedDB UnknownErr: ActorsParent.cpp:6088"]
11-21 17:49:28.316   206   617 W GeckoConsole: [JavaScript Error: "IndexedDB UnknownErr: ActorsParent.cpp:6088"]
11-21 17:49:28.406  1108  1108 E Homescreen: Content JS ERROR: Bookmark store: Cannot get access to the Store 
11-21 17:49:28.406  1108  1108 I Homescreen: Content JS LOG: No single variant configuration file found 
11-21 17:49:33.336  1108  1108 W Homescreen: [JavaScript Error: "TypeError: orgEntries[0].detail is undefined" {file: "app://verticalhome.gaiamobile.org/gaia_build_defer_index.js" line: 354}]
11-21 17:49:33.336  1108  1108 W Homescreen: [JavaScript Error: "uncaught exception: [object Object]"]


It worked properly after a full reboot.

Asking for a blocking status because this could happen after a normal OTA.
(Reporter)

Comment 1

4 years ago
Actually after a full reboot I don't have all applications. For example I don't have the Dialer nor Contacts.
Julien, looks like an issue with the single variant customization?  I've seen this when I got my file wrong.
(Reporter)

Comment 3

4 years ago
I don't use any customization :/ I simply used the normal "./build.sh && ./flash.sh" process. I use a "userbuild" type build.
Ben, any ideas?
Flags: needinfo?(bent.mozilla)
That IDB message is telling us that a database was invalidated and that it canceled at least one transaction that was in progress. That can either happen due to a process crash or when something tries to clear private data for an app (maybe during app uninstall?).
Flags: needinfo?(bent.mozilla)
Julien, have you seen this again?
Flags: needinfo?(felash)
Whiteboard: [systemsfe]
(Reporter)

Comment 7

4 years ago
I think it's ok now. We can close and I'll reopen if I see it again.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(felash)
Resolution: --- → WORKSFORME
blocking-b2g: 2.2? → ---
I have seen it recently again.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
I feel it may be a Gaia build system issue.

1. If I |./build.sh && ./flash.sh| on a previously built tree, then the described issue exposed. And after reboot I have some applications missing (Marketplace, for example)

2. If I clean the Gaia tree and then build, |make -C gaia/ clean really-clean && ./build.sh && ./flash.sh|, Homescreen is properly populated after first boot, and I have no missing app.

3. If after this I re-do step 1, then it's in the same state after FTU: no icon on homescreen, some apps missing after rebooting.
blocking-b2g: --- → 2.2?
Created attachment 8539194 [details]
2014-12-19-11-29-30.png

This is a screenshot after step 3 (after reboot) in previous comment. Build was userdebug, so this is a production Gaia. Notice the apps that are missing.
Changing component per comment 9: as much as I could reproduce, it looks like everytime I |make -C gaia/ clean really-clean|, it fixes the issue.
Component: Gaia::Homescreen → Gaia::Build
Flags: needinfo?(ricky060709)
Flags: needinfo?(poirot.alex)
Created attachment 8539199 [details]
Log from a broken build
Created attachment 8539201 [details]
Log from a working build
Lets not block on a gaia build issue. If this is an issue a user can hit during upgrade please renom.
blocking-b2g: 2.2? → backlog
(Assignee)

Comment 15

4 years ago
If you happen to reproduce it again, could you please compute a diff between the broken and working profile?

$ cp -r profile profile-broken
$ make really-clean
$ make
$ diff -r profile-broken profile

(I haven't seen any explicit error in the log)
Flags: needinfo?(poirot.alex)
(Reporter)

Comment 16

4 years ago
I just got the issue by flashing the pvtbuild for Hamachi (so it's a shallow-flash, with all data removed beforehand).

That's why I think it's not necessarily a gaia build issue.
Summary: [Homescreen] Empty homescreen after a full flash → [Homescreen] Empty or incomplete homescreen after a full flash
It seems to be an issue in incremental build after introducing rebuild feature in bug 969215. However, I've tested by diff profile in every incremental build. If issue can be reproduced without specified device, it will be a Gaia:Build issue.

You should try it as Alex mentioned on comment 15. Thanks!
Flags: needinfo?(ricky060709)
Created attachment 8541485 [details] [diff] [review]
gaia-profile.diff

Diff generated between both gaia profile.
Flags: needinfo?(ricky060709)
Flags: needinfo?(poirot.alex)
(In reply to Ricky Chien [:rickychien] from comment #17)
> It seems to be an issue in incremental build after introducing rebuild
> feature in bug 969215. However, I've tested by diff profile in every
> incremental build. If issue can be reproduced without specified device, it
> will be a Gaia:Build issue.
> 
> You should try it as Alex mentioned on comment 15. Thanks!

STR:

> $ make -C gaia/ clean really-clean 
> $ ./build.sh
> $ cp -a gaia/profile/ gaia-profile-ok
> $ ./build.sh
> $ cp -a gaia/profile/ gaia-profile-broken
> $ LANG=C diff -r gaia-profile-ok/ gaia-profile-broken/ > gaia-profile.diff
The installTime / updateTime in webapps.json will be different each time, so we can say two profiles are same.
Flags: needinfo?(ricky060709)
(In reply to Ricky Chien [:rickychien] from comment #20)
> The installTime / updateTime in webapps.json will be different each time, so
> we can say two profiles are same.

And nothing makes you wondering why we have some applications that are missing ?

Only in gaia-profile-ok/webapps: bluetooth.gaiamobile.org
Only in gaia-profile-ok/webapps: bookmark.gaiamobile.org
Only in gaia-profile-ok/webapps: callscreen.gaiamobile.org
Only in gaia-profile-ok/webapps: default_theme.gaiamobile.org
Only in gaia-profile-ok/webapps: emergency-call.gaiamobile.org
Only in gaia-profile-ok/webapps: fl.gaiamobile.org
Only in gaia-profile-ok/webapps: fm.gaiamobile.org
Only in gaia-profile-ok/webapps: marketplace.firefox.com
Only in gaia-profile-ok/webapps: network-alerts.gaiamobile.org
Only in gaia-profile-ok/webapps: pdfjs.gaiamobile.org
Only in gaia-profile-ok/webapps: ringtones.gaiamobile.org
Only in gaia-profile-ok/webapps: video.gaiamobile.org
Flags: needinfo?(ricky060709)
Which gaia commit version you used? Please update to latest gaia and try again.
I tried your STR but didn't get such missing.
Flags: needinfo?(ricky060709)
fa225ad6ee36a8d9f3f3d26340ef85c70c845b58
Created attachment 8541574 [details] [diff] [review]
gaia-profile-ricky.diff

Weird...submit my gaia-profile.diff.

You cound update gonk-misc repo and others to make sure that issue happens in latest version.
Pass B2G_UPDATER=1 and B2G_UPDATE_CHANNEL=nightly-flame can reproduce it. I'm going to find out the root cause.
Assignee: nobody → ricky060709
Flags: needinfo?(poirot.alex)
Sorry, I mess up something... There are some failures while running ./build.sh so that cause empty result in profile/webapps/. ni Alex again.
Flags: needinfo?(poirot.alex)
(Assignee)

Updated

4 years ago
Assignee: ricky060709 → poirot.alex
Flags: needinfo?(poirot.alex)
(Assignee)

Comment 27

4 years ago
Created attachment 8542202 [details] [review]
Pull request 27047

It looks like it is somewhat intermitently failing when using ./build.sh.
I don't get why it is intermittent, looks like it should just always fail on non-clobbered builds.

It fails because ./build.sh codepath remove the profile folder, whithout cleaning build_stage, so that apps appear to build uptodate in build stage and are not copied again in profile folder.

Ricky, I cleaned a lot of stuff in this patch, please review carefully.
One big refactoring I'm doing here is to avoid calling getWebapp() everywhere, whereas we already called have a valid webapp object computed!

Thanks Alex and Julien for the detailed report!!
Attachment #8542202 - Flags: review?(ricky060709)
Comment on attachment 8542202 [details] [review]
Pull request 27047

I saw some uuid apps are built in profile/webapps. (see my diffs results)

Only in HEAD^/webapps: {76dc1451-8855-40bc-ae8b-ade4db9b69a8}
Only in HEAD^/webapps: {996bfc2a-899d-4abe-894e-06858e5267dc}
Only in HEAD/webapps: in_app_pay_test.gaiamobile.org
Only in HEAD/webapps: marketplace.allizom.org.gaiamobile.org
Only in HEAD/webapps: marketplace-dev.allizom.org.gaiamobile.org
Only in HEAD^/webapps: marketplace.firefox.com
Only in HEAD/webapps: marketplace.firefox.com.gaiamobile.org
Only in HEAD/webapps: mochitest.gaiamobile.org
Only in HEAD^/webapps: packaged.marketplace.allizom.org
Only in HEAD^/webapps: packaged.marketplace-dev.allizom.org
Files HEAD/webapps/privacy-panel.gaiamobile.org/application.unzip/resources/about.json and HEAD^/webapps/privacy-panel.gaiamobile.org/application.unzip/resources/about.json differ
Files HEAD/webapps/settings.gaiamobile.org/application.unzip/resources/gaia_commit.txt and HEAD^/webapps/settings.gaiamobile.org/application.unzip/resources/gaia_commit.txt differ
Files HEAD/webapps/webapps.json and HEAD^/webapps/webapps.json differ

I think there is an incorrect logic in rebuild.js line:127.  
put "|| !webapp.profileDirectoryFile.exists()" will copy all of uuid apps into profile/webapps.

Just fix it and test it with your diff-build.sh then set r? again thanks!!
Attachment #8542202 - Flags: review?(ricky060709)
Although I guess that the profile folder is removed during incremental build, I still cannot reproduce it in my env.

Alexandre Poirot, could you reproduce such failure and make sure your patch doesn't break incremental build with ./build.sh? Thanks!
(Assignee)

Comment 30

4 years ago
Comment on attachment 8542202 [details] [review]
Pull request 27047

Oh... this is such a mess.
We compute the folder name from everywhere,
I'm wondering if we have some race condition on this codepath.
Here is some more work in order to ensure that the folder name used in profile is computed in one unique place, utils-xpc.js!
Also I discovered that we save the uuid mapping file in stage and we never use it...?!?
Attachment #8542202 - Flags: review?(ricky060709)
Comment on attachment 8542202 [details] [review]
Pull request 27047

It works very well on my mac after trying three times of ./diff_build.sh. And also thanks for your a bit of refactoring :)

Remember to fix nits on Github and make sure it passes on Try. Thanks!
Attachment #8542202 - Flags: review?(ricky060709) → review+
(In reply to Alexandre Poirot [:ochameau] from comment #30)
> Comment on attachment 8542202 [details] [review]
> Pull request 27047
> 
> Oh... this is such a mess.
> We compute the folder name from everywhere,
> I'm wondering if we have some race condition on this codepath.
> Here is some more work in order to ensure that the folder name used in
> profile is computed in one unique place, utils-xpc.js!
> Also I discovered that we save the uuid mapping file in stage and we never
> use it...?!?
See https://bugzilla.mozilla.org/show_bug.cgi?id=1058555#c19
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
Master: https://github.com/mozilla-b2g/gaia/commit/af2d1e31f4c4bd0438984794b0139e72ce7d45a2
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
status-b2g-v2.2: --- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S3 (9jan)
(Assignee)

Comment 34

4 years ago
Alex, could you confirm that the build system works fine now in your daily usage?
Flags: needinfo?(lissyx+mozillians)
It looks like it is fixed, I cannot reproduce the issue anymore now.
Flags: needinfo?(lissyx+mozillians)
(Reporter)

Comment 36

4 years ago
I still had an issue when flashing latest gecko+gaia for Flame-kk.

Gaia-Rev        82b534791a72ad59c78363df80459e18d35b48f8
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/d480b3542cc2
Build-ID        20150108160401


It has also other issues now that I try to reflash it to see if it's only intermittent, I have an issue with the Settings API...
(Reporter)

Comment 37

4 years ago
Forget previous comment, I have a change in my shallow_flash script where I don't delete user data, so maybe the phone was in that state before the flash, I don't really know.
We still have reports that this is broken on v2.2 at least: https://bugzilla.frenchmozilla.org/show_bug.cgi?id=623
Flags: needinfo?(taz)
Flags: needinfo?(ricky060709)
Hi, do you have time to take a look? thanks =)
Flags: needinfo?(ricky060709) → needinfo?(poirot.alex)
(Assignee)

Comment 40

3 years ago
(In reply to Ricky Chien [:rickychien] from comment #39)
> Hi, do you have time to take a look? thanks =)

Not really...
Flags: needinfo?(poirot.alex) → needinfo?(ricky060709)
blocking-b2g: backlog → ---
tracking-b2g: --- → backlog
Created attachment 8590057 [details] [review]
[gaia] RickyChien:rebuild-profile-removed > mozilla-b2g:master
Comment on attachment 8590057 [details] [review]
[gaia] RickyChien:rebuild-profile-removed > mozilla-b2g:master

Since I cannot reproduce on my machine and according to comment 27, I submitted this patch for fixing rebuild problem if someone deletes profile in somewhere.

Patch is a simple workaround to ensure gecko build.sh doesn't break gaia build. Please take a look and verify it kindly thanks!
Flags: needinfo?(ricky060709)
Attachment #8590057 - Flags: review?(poirot.alex)
(Assignee)

Comment 43

3 years ago
Comment on attachment 8590057 [details] [review]
[gaia] RickyChien:rebuild-profile-removed > mozilla-b2g:master

I'm not used to reproduce this issue, but this modification makes sense.
Attachment #8590057 - Flags: review?(poirot.alex) → review+
We are still getting reports for this behavior from time to time ... Is it possible there is still rare cases?
(Reporter)

Comment 46

3 years ago
I got it with a master PVT build from last week; after the flash the homescreen was empty, then I rebooted and I missed some icons (and they were not ordered at all), notably Phone and Contacts. They were accessible when searching for them in the rocket bar.

Unfortunately I didn't try again with the same build to know if this was a build problem or a race; and I didn't look at logcat..
FWIW I just had this happen a few minutes ago when flashing mozilla-central gaia+gecko using flash_pvt.py. When reflashing the same gaia+gecko, it went away and I got my homescreen icons back.
You need to log in before you can comment on or make changes to this bug.