A promise chain failed to handle a rejection: can't access property "updateCount", updateManager is undefined - stack: lastBrowserUpdateDate@resource:///modules/UrlbarProviderSearchTips.jsm:415:7
Categories
(Firefox :: Address Bar, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr68 | --- | unaffected |
| firefox72 | --- | unaffected |
| firefox73 | --- | unaffected |
| firefox74 | --- | fixed |
People
(Reporter: robwu, Assigned: bugzilla)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
I updated my checkout, ran a test and encountered an unrelated failure at https://searchfox.org/mozilla-central/rev/803a42f24c8714631ed81cb824ea1c1a803cb7b8/browser/components/urlbar/UrlbarProviderSearchTips.jsm#415
$ ./mach test toolkit/components/extensions/test/browser/browser_ext_themes_dynamic_getCurrent.js
Unexpected Results
------------------
toolkit/components/extensions/test/browser/browser_ext_themes_dynamic_getCurrent.js
FAIL A promise chain failed to handle a rejection: can't access property "updateCount", updateManager is undefined - stack: lastBrowserUpdateDate@resource:///modules/UrlbarProviderSearchTips.jsm:415:7
_maybeShowTipForUrl@resource:///modules/UrlbarProviderSearchTips.jsm:284:22
onLocationChange@resource:///modules/UrlbarProviderSearchTips.jsm:253:10
onLocationChange@chrome://browser/content/browser.js:5462:32
callListeners@chrome://browser/content/tabbrowser.js:827:31
_callProgressListeners@chrome://browser/content/tabbrowser.js:841:22
updateCurrentBrowser@chrome://browser/content/tabbrowser.js:1069:12
_setupEventListeners/<@chrome://browser/content/tabbrowser.js:5310:16
set selectedIndex@chrome://global/content/elements/tabbox.js:208:14
set selectedPanel@chrome://global/content/elements/tabbox.js:227:7
set selectedIndex@chrome://global/content/elements/tabbox.js:559:11
set selectedItem@chrome://global/content/elements/tabbox.js:579:35
set selectedTab@chrome://global/content/elements/tabbox.js:98:11
set selectedTab@chrome://browser/content/tabbrowser.js:316:7
_blurTab@chrome://browser/content/tabbrowser.js:3866:31
_beginRemoveTab@chrome://browser/content/tabbrowser.js:3524:12
removeTab@chrome://browser/content/tabbrowser.js:3407:15
Tester_waitForWindowsState@chrome://mochikit/content/browser-test.js:432:16
nextTest@chrome://mochikit/content/browser-test.js:821:10
Tester_start/<@chrome://mochikit/content/browser-test.js:352:14
Rejection date: Mon Jan 20 2020 12:58:37 GMT+0100 (Central European Standard Time) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 265
Stack trace:
resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:265
chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
chrome://mochikit/content/browser-test.js:Tester_execTest:1097
chrome://mochikit/content/browser-test.js:nextTest/<:925
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:808
FAIL A promise chain failed to handle a rejection: can't access property "updateCount", updateManager is undefined - stack: lastBrowserUpdateDate@resource:///modules/UrlbarProviderSearchTips.jsm:415:7
_maybeShowTipForUrl@resource:///modules/UrlbarProviderSearchTips.jsm:284:22
onLocationChange@resource:///modules/UrlbarProviderSearchTips.jsm:253:10
onLocationChange@chrome://browser/content/browser.js:5462:32
callListeners@chrome://browser/content/tabbrowser.js:827:31
_callProgressListeners@chrome://browser/content/tabbrowser.js:841:22
_callProgressListeners@chrome://browser/content/tabbrowser.js:5746:46
onLocationChange@chrome://browser/content/tabbrowser.js:6164:14
_callProgressListeners@resource://gre/modules/RemoteWebProgress.jsm:75:31
onLocationChange@resource://gre/modules/RemoteWebProgress.jsm:119:10
Rejection date: Mon Jan 20 2020 12:58:38 GMT+0100 (Central European Standard Time) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 265
Stack trace:
resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:265
chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
chrome://mochikit/content/browser-test.js:Tester_execTest:1097
chrome://mochikit/content/browser-test.js:nextTest/<:925
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:808
| Reporter | ||
Comment 1•6 years ago
|
||
Harry, could you take a look?
You should investigate why updateManager is void, and either ensure that it's not void, or update the check to account for a void updateManager.
To unblock my local testing, I changed UrlbarProviderSearchTips.jsm by replacing
if (updateManager.updateCount) {
with
if (updateManager && updateManager.updateCount) {
| Assignee | ||
Comment 2•6 years ago
|
||
browser_ext_themes_dynamic_getCurrent.js fails on my machine, but for seemingly unrelated reasons. Neither adding your suggested fix nor disabling UrlbarProviderSearchTips.jsm altogether fixes the failure. I'm not seeing anything in the console related to UrlbarProviderSearchTips. What platform are you on? Do you have any unusual environment variables set?
(The failure I encounter is as follows, if this helps your own testing:)
Unexpected Results
------------------
toolkit/components/extensions/test/browser/browser_ext_themes_dynamic_getCurrent.js
FAIL {
"colors": null,
"images": null,
"properties": null
} - Expected: 0, Actual: 3 -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1292
chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testHandler:59
chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testResult:73
resource://specialpowers/SpecialPowersChild.jsm:listener:2075
resource://specialpowers/SpecialPowersChild.jsm:loadExtension/<:2017
resource://specialpowers/SpecialPowersChild.jsm:receiveMessage:242
JSWindowActor query*resource://specialpowers/SpecialPowersParent.jsm:resultListener:929
resource://gre/modules/ExtensionCommon.jsm:emit:327
resource://gre/modules/Extension.jsm:receiveMessage:1820
FAIL {
"colors": null,
"images": null,
"properties": null
} - Expected: 0, Actual: 3 -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1292
chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testHandler:59
chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testResult:73
resource://specialpowers/SpecialPowersChild.jsm:listener:2075
resource://specialpowers/SpecialPowersChild.jsm:loadExtension/<:2017
resource://specialpowers/SpecialPowersChild.jsm:receiveMessage:242
| Reporter | ||
Comment 3•6 years ago
|
||
I was testing on Linux, using an artifact build straight from the tip of the tree.
I was investigating the error that you've reported, when I encountered this reported error. That unrelated error is https://bugzilla.mozilla.org/show_bug.cgi?id=1581886
| Assignee | ||
Comment 4•6 years ago
|
||
Hm, I still can't reproduce this using Linux. I'm posting your suggested null-check fix. It doesn't hurt since lastBrowserUpdateDate has a fallback to checking ProfileAge. Dao, you use artifact builds on Linux: would you mind running ./mach test toolkit/components/extensions/test/browser/browser_ext_themes_dynamic_getCurrent.js to see if you get this failure?
| Assignee | ||
Comment 5•6 years ago
|
||
Updated•6 years ago
|
| Reporter | ||
Comment 6•6 years ago
|
||
This issue is not specific to unit tests. When I run the (artifact built) browser (./mach run --temp-profile), the global JS console contains the following message:
While creating services from category 'profile-after-change', could not create service for entry 'nsUpdateServiceStub', contract ID '@mozilla.org/updates/update-service-stub;1'
When I run the relevant code snippet (to simulate the behavior of the lazy getter of updateManager), I get the following error:
Cc["@mozilla.org/updates/update-manager;1"].getService(Ci.nsIUpdateManager)
[Exception... "ServiceManager::GetService returned failure code:" nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1" data: no] debugger eval code:1:45
The error above is generic. I can get a more specific error by invoking the internal implementation:
Components.manager.getServiceByContractID("@mozilla.org/updates/update-manager;1", Ci.nsIUpdateManager)
[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIServiceManager.getServiceByContractID]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1" data: no]
That might be a starting point for investigation.
| Reporter | ||
Comment 7•6 years ago
|
||
Mystery solved: My .mozconfig contains ac_add_options --disable-updater .
When MOZ_UPDATER= is used (e.g. via ac_add_options --disable-updater in .mozconfig), then the update service is not included at all, and updateManager is also going to be void. This is the cause of my problem, and to fix that, a null-check is the proper fix.
I had set this flag a while ago because I was debugging an issue related to it, but never removed it.
This option is commonly used on distribution builds for Linux, where updates are managed through the system's package manager instead of Firefox's auto-update mechanism.
| Assignee | ||
Comment 8•6 years ago
|
||
Thanks for looking into this Rob. I'll go ahead and push the null-check patch when it's reviewed.
Comment 10•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Description
•