Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWAs sometimes crash immediately on first opening, and then work normally after re-opening. #488

Open
awdwyn opened this issue Apr 21, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@awdwyn
Copy link

awdwyn commented Apr 21, 2024

Description

On a fresh boot, or sometimes after the PC has been idle for a while, opening a PWA (any of them) will show the window briefly and then immediately close. Re-opening the app (almost always, but not guaranteed) will work normally.

Steps to Reproduce

  1. Open PWA from launcher or console
  2. See error

Additional Information

This is from journalctl showing the result of the failure while opening my bitwarden webUI PWA. No other logs show anything.

20:51:27.070 UTC user@1000.service app-FFPWA\x2d01HVY51HGCWXJCCYJ8AZ6533P4-1274414f271e4424a5dbff7594ede7bc.scope: Consumed 1.263s CPU time.
20:51:29.104 UTC user@1000.service 20:51:29 [INFO] Patching the runtime
20:51:29.104 UTC user@1000.service 20:51:29 [INFO] Runtime patched!
20:51:29.104 UTC user@1000.service 20:51:29 [INFO] Patching the profile
20:51:29.106 UTC user@1000.service 20:51:29 [INFO] Profile patched!
20:51:29.106 UTC user@1000.service 20:51:29 [INFO] Launching the web app
20:51:29.120 UTC user@1000.service app-FFPWA\x2d01HVY51HGCWXJCCYJ8AZ6533P4-c070ff37ae0748aa812f5e7c3bd65276.scope: Couldn't move process 7862 to requested cgroup '/user.slice/user-1000.slice/user@1000.service/app.slice/app-FFPWA\x2d01HVY51HGCWXJCCYJ8AZ6533P4-c070ff37ae0748aa812f5e7c3bd65276.scope': No such process
20:51:29.120 UTC user@1000.service app-FFPWA\x2d01HVY51HGCWXJCCYJ8AZ6533P4-c070ff37ae0748aa812f5e7c3bd65276.scope: Failed to add PIDs to scope's control group: No such process
20:51:29.120 UTC user@1000.service app-FFPWA\x2d01HVY51HGCWXJCCYJ8AZ6533P4-c070ff37ae0748aa812f5e7c3bd65276.scope: Failed with result 'resources'.
20:51:29.120 UTC user@1000.service Failed to start Bitwarden Web App.

Next I opened a terminal and used firefoxpwa site launch 01HVTD62EA2KY9QPTGS64EBKS1 -- --jsconsole to load my unRAID webUI. The error occured again, displaying the following in the browser console:

1713733303001	addons.xpi	WARN	Checking /home/[REDACTED]/.local/share/firefoxpwa/runtime/distribution/extensions for addons
TypeError: currentPlacements is undefined CustomizableUI.sys.mjs:3632:11
    get inDefaultState resource:///modules/CustomizableUI.sys.mjs:3632
    get inDefaultState resource:///modules/CustomizableUI.sys.mjs:4539
    _updateResetButton resource:///modules/CustomizeMode.sys.mjs:1535
    observe resource:///modules/CustomizeMode.sys.mjs:1655
    set resource://pwa/utils/xPref.jsm:37
    configureSettings file:///home/[REDACTED]/.local/share/firefoxpwa/profiles/01HVTD62D9XQDRJ333N8ZCXP0P/chrome/pwa/content/browser.jsm:1866
    configureAll file:///home/[REDACTED]/.local/share/firefoxpwa/profiles/01HVTD62D9XQDRJ333N8ZCXP0P/chrome/pwa/content/browser.jsm:1779
    PwaBrowser file:///home/[REDACTED]/.local/share/firefoxpwa/profiles/01HVTD62D9XQDRJ333N8ZCXP0P/chrome/pwa/content/browser.jsm:17
    <anonymous> file:///home/[REDACTED]/.local/share/firefoxpwa/profiles/01HVTD62D9XQDRJ333N8ZCXP0P/chrome/pwa/content/browser.jsm:2099
    loadUserScript resource://pwa/chrome.jsm:118
    handleEvent resource://pwa/chrome.jsm:97
Uncaught TypeError: this._button is null
    init chrome://browser/content/browser-addons.js:1171
    onDOMContentLoaded chrome://browser/content/browser.js:1670
browser-addons.js:1171:5
    init chrome://browser/content/browser-addons.js:1171
    onDOMContentLoaded chrome://browser/content/browser.js:1670
NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAppStartup.secondsSinceLastOSRestart]
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.sys.mjs:1756
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.sys.mjs:1864
    BG_observe resource:///modules/BrowserGlue.sys.mjs:1086
    _delayedStartup chrome://browser/content/browser.js:2112
BrowserGlue.sys.mjs:1765:15
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.sys.mjs:1765
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.sys.mjs:1864
    BG_observe resource:///modules/BrowserGlue.sys.mjs:1086
    _delayedStartup chrome://browser/content/browser.js:2112
TypeError: error loading dynamically imported module: chrome://global/content/elements/moz-button-group.mjs
Loading failed for the module with source “chrome://global/content/elements/moz-button-group.mjs”. browser.xhtml
Loading failed for the module with source “chrome://global/content/elements/moz-toggle.mjs”. browser.xhtml
AboutHomeStartupCache: requestCache called with no _procManager! BrowserGlue.sys.mjs:5958:16
    requestCache resource:///modules/BrowserGlue.sys.mjs:5958
    cacheNow resource:///modules/BrowserGlue.sys.mjs:5913
    _cacheTask resource:///modules/BrowserGlue.sys.mjs:5757
    _runTask resource://gre/modules/DeferredTask.sys.mjs:341
    _timerCallback resource://gre/modules/DeferredTask.sys.mjs:312
    _timerCallback resource://gre/modules/DeferredTask.sys.mjs:331
    callback resource://gre/modules/DeferredTask.sys.mjs:179

Environment

[REDACTEDs]-pc:/home/[REDACTED]
15:10 [REDACTED]: neofetch
                   -`                     
                  .o+`                   OS: Arch Linux x86_64 
                 `ooo/                   Host: Z790 AORUS ELITE AX 
                `+oooo:                  Kernel: 6.8.7-arch1-1 
               `+oooooo:                 Uptime: 1 hour, 2 mins 
               -+oooooo+:                Packages: 1394 (pacman), 8 (flatpak) 
             `/:-:++oooo+:               Shell: bash 5.2.26 
            `/++++/+++++++:              Resolution: 3440x1440 
           `/++++++++++++++:             DE: Plasma 6.0.4 
          `/+++ooooooooooooo/`           WM: kwin 
         ./ooosssso++osssssso+`          Theme: Breeze-Dark [GTK2], Breeze [GTK3] 
        .oossssso-````/ossssss+`         Icons: breeze-dark [GTK2/3] 
       -osssssso.      :ssssssso.        Terminal: BlackBox 
      :osssssss/        osssso+++.       CPU: 13th Gen Intel i7-13700K (24) @ 5.300GHz 
     /ossssssss/        +ssssooo/-       GPU: NVIDIA GeForce RTX 4070 Ti 
   `/ossssso+/:-        -:/+osssso+-     Memory: 6422MiB / 31924MiB 
  `+sso+:-`                 `.-/+oso:    GPU Driver: NVIDIA 550.76 
 `++:.                           `-/+/
 .`                                 `/                           
                                                                 

Project versions:

  • Extension version: 2.11.1
  • Native version: 2.11.1
  • Runtime version: 125.0.1
  • Firefox version: 125.0.1
REDACTED]s-pc:/home/[REDACTED]
15:08 [REDACTED]: sudo pacman -Qs firefox
[sudo] password for [REDACTED]: 
local/firefox 125.0.1-1
    Standalone web browser from mozilla.org
local/firefox-pwa 2.11.1-1
    A tool to install, manage and use Progressive Web Apps (PWAs) in Mozilla Firefox (native component)

Other

My user.js automatically enables css styling within firefox, and turns off the tabs:

user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
user_pref("browser.tabs.inTitlebar", 0);

and userChrome.css centers the title and turns off the hamburger menu button:

@-moz-document url('chrome://browser/content/browser.xhtml') {
    /* Horizontally center the title element */
    .site-info > .tab-label-container {
        position: relative;
        margin-left: auto;
        margin-right: auto;
        left: 9rem;
    }
}
#navigator-toolbox {
    visibility: collapse;
}
@awdwyn awdwyn added the bug Something isn't working label Apr 21, 2024
@hofleverancier
Copy link

I have also experienced this, in my case though I'm convinced it only occurs when I do a reboot without closing the PWA manually, in other words, when it is killed.

@filips123
Copy link
Owner

filips123 commented Apr 30, 2024

@awdwyn Does it happen on every fresh boot or only sometimes? I think I experienced this in the past, but not frequently, which makes it harder to fix.

There are some problems with session restore (so, maybe it's really because of killing PWAs before), so this issue might be related, but I don't know why it happens. The error in CustomizableUI seems to be caused because PWAsForFirefox sets some preferences during startup, but I don't know why the error then occurs. (Edit: This error sometimes also happens normally, so I think it's not the issue here.) I'm also not sure why the other errors happen.

I will try to fix this in the future when I rewrite the UserChrome part, but it will probably take a while.

@filips123 filips123 added the help wanted Extra attention is needed label Apr 30, 2024
@awdwyn
Copy link
Author

awdwyn commented May 1, 2024

@filips123 It's almost a guaranteed thing on a fresh reboot. I just rebooted this machine and the first two PWAs I opened both did the open->crash->reopen->ok loop, but after that the other PWAs I opened were fine. I don't expect to see the bug again until either another reboot or extended suspend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: To Do
Development

No branches or pull requests

3 participants