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

AppImage launched from .desktop file results in crash/blankscreen #1804

Closed
3 tasks done
jsg2021 opened this issue Oct 8, 2021 · 9 comments
Closed
3 tasks done

AppImage launched from .desktop file results in crash/blankscreen #1804

jsg2021 opened this issue Oct 8, 2021 · 9 comments

Comments

@jsg2021
Copy link

jsg2021 commented Oct 8, 2021

I confirm (by marking "x" in the [ ] below: [x]):


Summary

The appimage when integrated with AppImageLauncher generates a .desktop file that contains --no-sandbox (this is default for appimages built by electron-builder: electron-userland/electron-builder#4496 ) If I run the appimage directly or remove that flag from the .desktop, all is well.

Environment

  • Operating System: Fedora 34
  • Mattermost Desktop App version: 5.0.0rc3
  • Mattermost Server version: 5.37.1

Steps to reproduce
Download a new appimage, double click to make AppImageLauncher integrate it.
Close initial launch (works fine first launch from the AppImageLauncher screen)
Relaunch from UI shortcuts from the .desktop file
Observe dead app.

Expected behavior
no crash/white window

Observed behavior
windows open white or crash

Possible fixes
find a way to not run this line in builder: args.push("--extraAppArgs=--no-sandbox")

@devinbinnie
Copy link
Member

Hi @jsg2021, if the app launches and you get a white screen, are you able to press Ctrl+Shift+I and see if there's anything in the Developer Tools? If the app crashes, do you see any exception output when it does?

@jsg2021
Copy link
Author

jsg2021 commented Oct 8, 2021

On the rc's it crashes before I can open devtools.

@jsg2021
Copy link
Author

jsg2021 commented Oct 8, 2021

To be clear, I don't think its mattermost's fault. I think you've been working towards using the sandbox, so it would make sense that having the sandbox disabled would cause problems.

@jsg2021
Copy link
Author

jsg2021 commented Nov 3, 2021

Hi @jsg2021, if the app launches and you get a white screen, are you able to press Ctrl+Shift+I and see if there's anything in the Developer Tools? If the app crashes, do you see any exception output when it does?

@devinbinnie

Here is the terminal output: (window crashes before dev tools can be brought up)

 /home/jonathan/Applications/mattermost-desktop-5.0.1-linux-x86_64_584005ce34e7524cd0fe53b74a4292a4.AppImage --no-sandbox
/usr/bin/AppImageLauncher: /lib64/libcurl.so.4: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/appimagelauncher/libappimageupdate.so)
10:14:40.042 › Current working directory is /home/jonathan, changing into /tmp/.mount_matter4G8YWn
10:14:40.174 › config.autostart has been configured: false
10:14:40.175 › config.autostart has been configured: false
10:14:40.349 › BrowserView created for server nextthought___TAB_MESSAGING
10:14:40.352 › couldn't show nextthought___TAB_MESSAGING, not ready
10:14:40.352 › [nextthought___TAB...] Loading ****
10:14:40.353 › couldn't show nextthought___TAB_MESSAGING, not ready
[8998:1103/101440.536208:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.org.chromium.Chromium.BaM9gq failed: Operation not permitted (1)
[8998:1103/101440.536288:ERROR:platform_shared_memory_region_posix.cc(253)] Unable to access(W_OK|X_OK) /dev/shm: Operation not permitted (1)
[8998:1103/101440.536321:FATAL:platform_shared_memory_region_posix.cc(255)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.
[9010:1103/101440.564881:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.org.chromium.Chromium.r4U1Vf failed: Operation not permitted (1)
[9010:1103/101440.564980:ERROR:platform_shared_memory_region_posix.cc(253)] Unable to access(W_OK|X_OK) /dev/shm: Operation not permitted (1)
[9010:1103/101440.565009:FATAL:platform_shared_memory_region_posix.cc(255)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.
[9004:1103/101440.569207:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.org.chromium.Chromium.VDTk0q failed: Operation not permitted (1)
[9004:1103/101440.569292:ERROR:platform_shared_memory_region_posix.cc(253)] Unable to access(W_OK|X_OK) /dev/shm: Operation not permitted (1)
[9004:1103/101440.569328:FATAL:platform_shared_memory_region_posix.cc(255)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.
10:14:40.682 › couldn't show nextthought___TAB_MESSAGING, not ready
10:14:40.685 › couldn't show nextthought___TAB_MESSAGING, not ready
10:14:40.687 › config.autostart has been configured: false
[9016:1103/101440.690591:ERROR:platform_shared_memory_region_posix.cc(250)] Creating shared memory in /dev/shm/.org.chromium.Chromium.gCvNBB failed: Operation not permitted (1)
[9016:1103/101440.690663:ERROR:platform_shared_memory_region_posix.cc(253)] Unable to access(W_OK|X_OK) /dev/shm: Operation not permitted (1)
[9016:1103/101440.690699:FATAL:platform_shared_memory_region_posix.cc(255)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.
10:14:40.739 › Main window failed to load: Error: ERR_FAILED (-2) loading 'file:///tmp/.mount_matter4G8YWn/resources/app.asar/renderer/index.html'
(node:8950) UnhandledPromiseRejectionWarning: Error: Render frame was disposed before WebFrameMain could be accessed
    at Object.n.send (electron/js2c/browser_init.js:165:413)
    at Object.b.send (electron/js2c/browser_init.js:161:2492)
    at Object.sendToRenderer (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:59963:33)
    at MattermostView.loadRetry (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61437:21)
    at /tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61406:14
(Use `mattermost-desktop --trace-warnings ...` to show where the warning was created)
(node:8950) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:8950) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
10:14:41.355 › Error getting system idle time: Error: Render frame was disposed before WebFrameMain could be accessed
    at Object.n.send (electron/js2c/browser_init.js:165:413)
    at Object.b.send (electron/js2c/browser_init.js:161:2492)
    at /tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:56
    at Map.forEach (<anonymous>)
    at ViewManager.sendToAllViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:18)
    at Object.sendToMattermostViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:59981:24)
    at UserActivityMonitor.<anonymous> (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:850:19)
    at UserActivityMonitor.emit (events.js:376:20)
    at UserActivityMonitor.sendStatusUpdate (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66351:10)
    at UserActivityMonitor.setActivityState (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66336:12)
10:14:42.356 › Error getting system idle time: Error: Render frame was disposed before WebFrameMain could be accessed
    at Object.n.send (electron/js2c/browser_init.js:165:413)
    at Object.b.send (electron/js2c/browser_init.js:161:2492)
    at /tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:56
    at Map.forEach (<anonymous>)
    at ViewManager.sendToAllViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:18)
    at Object.sendToMattermostViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:59981:24)
    at UserActivityMonitor.<anonymous> (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:850:19)
    at UserActivityMonitor.emit (events.js:376:20)
    at UserActivityMonitor.sendStatusUpdate (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66351:10)
    at UserActivityMonitor.setActivityState (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66336:12)
10:14:43.357 › Error getting system idle time: Error: Render frame was disposed before WebFrameMain could be accessed
    at Object.n.send (electron/js2c/browser_init.js:165:413)
    at Object.b.send (electron/js2c/browser_init.js:161:2492)
    at /tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:56
    at Map.forEach (<anonymous>)
    at ViewManager.sendToAllViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:18)
    at Object.sendToMattermostViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:59981:24)
    at UserActivityMonitor.<anonymous> (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:850:19)
    at UserActivityMonitor.emit (events.js:376:20)
    at UserActivityMonitor.sendStatusUpdate (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66351:10)
    at UserActivityMonitor.setActivityState (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66336:12)
10:14:44.359 › Error getting system idle time: Error: Render frame was disposed before WebFrameMain could be accessed
    at Object.n.send (electron/js2c/browser_init.js:165:413)
    at Object.b.send (electron/js2c/browser_init.js:161:2492)
    at /tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:56
    at Map.forEach (<anonymous>)
    at ViewManager.sendToAllViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:61073:18)
    at Object.sendToMattermostViews (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:59981:24)
    at UserActivityMonitor.<anonymous> (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:850:19)
    at UserActivityMonitor.emit (events.js:376:20)
    at UserActivityMonitor.sendStatusUpdate (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66351:10)
    at UserActivityMonitor.setActivityState (/tmp/.mount_matter4G8YWn/resources/app.asar/index.js:66336:12)
10:14:44.405 › main window closed

~ took 5s ⟩ 

without the no-sandbox flag:

 /home/jonathan/Applications/mattermost-desktop-5.0.1-linux-x86_64_584005ce34e7524cd0fe53b74a4292a4.AppImage             
/usr/bin/AppImageLauncher: /lib64/libcurl.so.4: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/appimagelauncher/libappimageupdate.so)
10:16:31.503 › Current working directory is /home/jonathan, changing into /tmp/.mount_matteroxwhzM
10:16:31.634 › config.autostart has been configured: false
10:16:31.634 › config.autostart has been configured: false
10:16:31.798 › BrowserView created for server nextthought___TAB_MESSAGING
10:16:31.800 › couldn't show nextthought___TAB_MESSAGING, not ready
10:16:31.801 › [nextthought___TAB...] Loading ****
10:16:31.802 › couldn't show nextthought___TAB_MESSAGING, not ready
10:16:32.101 › couldn't show nextthought___TAB_MESSAGING, not ready
10:16:32.105 › couldn't show nextthought___TAB_MESSAGING, not ready
10:16:32.106 › config.autostart has been configured: false
10:16:32.235 › [nextthought___TAB...] finished loading ****
10:16:32.243 › config.autostart has been configured: false
10:16:32.244 › config.autostart has been configured: false
^C
10:16:37.883 › main window closed 

@devinbinnie
Copy link
Member

Thanks for the console output @jsg2021! I've made a ticket to look into this here: https://mattermost.atlassian.net/browse/MM-39874

@devinbinnie
Copy link
Member

@jsg2021 Just giving you an update, I'm kinda confused why electron-builder has this bit hardcoded in there, since it's very very difficult to undo it if you want to. I've left a comment on that issue in order to see if we can make a change to electron-builder in order to make that optional.

@devinbinnie
Copy link
Member

@jsg2021 I've opened an PR with electron-builder myself in order to attempt to make the --no-sandbox field optional, I think that's all we can do for the time being. I've looked into overriding it myself, but outside of working off of a fork of electron-builder, or attempting to completely rebuild the AppImage after the fact, I think this is the best course of action.

@jsg2021
Copy link
Author

jsg2021 commented Nov 17, 2021

Sounds good. Thanks!

@devinbinnie
Copy link
Member

Heh, apparently I took a while to fix this, but it is fixed :D
#2413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants