Skip to content

Electron not working when running in terminal on Ubuntu Linux #12850

Closed

Description

@RyanZim
  • Electron Version: 2.0.0
  • Operating System (Platform and Version): Lubuntu/Ubuntu 17.10
  • Last known working Electron version: 1.8.x

Expected Behavior
Electron should open and be functional when run from the terminal

Actual behavior
Electron either doesn't open, opens to a black screen, or freezes shortly after opening. The command doesn't exit, it just hangs there.

To Reproduce

$ git clone https://github.com/electron/electron-quick-start
$ npm install
$ npm start

Additional Information
If you run npm start > /dev/null, npm start 2> /dev/null, or npm start &> /dev/null, the issue cannot be reproduced. This makes me suspect that there's some bug with streaming to a terminal emulator (perhaps the terminal emulator gives backpressure that electron can't handle?)

Activity

  1. ckerr commented on May 7, 2018

    @ckerr
    Member

    I'm not seeing this when running either 2.0.0 or master in Ubuntu 18.04.

    Could you try the same experiment on a clean system to see if it's reproducible for you there too?

  2. RyanZim commented on May 8, 2018

    @RyanZim
    Author

    BTW, here is the logging output I get:

    $ ELECTRON_ENABLE_LOGGING=true npm start
    
    > [email protected] start /home/ryan/electron-quick-start
    > electron .
    
    [37955:0507/202008.523303:WARNING:browser_main_loop.cc(275)] <unknown>: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
    [37955:0507/202010.278786:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
    

    Spinning up a fresh VM to test further.

  3. alice-em commented on May 8, 2018

    @alice-em

    I'm also getting this issue on ubuntu 18.04 with electron [1.8.4, 1.8.6, 2.0.0].

    This is the log it produces with npm start / electron index.js

    > [email protected] start /home/alice-mod/Documents/git/wonder-reader
    > electron index.js
    
    /home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/electron[13736]: ../../vendor/node/src/async-wrap.cc:399:void node::SetupHooks(const FunctionCallbackInfo<v8::Value> &): Assertion `env->async_hooks_init_function().IsEmpty()' failed.
     1: node::Abort() [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     2: 0x7f340e06edc4 [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     3: 0x7f340e05efd5 [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     4: 0x7f340d69bdc0 [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     5: 0x7f340d7a29d8 [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     6: 0x7f340d7a223e [/home/alice-mod/Documents/git/wonder-reader/node_modules/electron/dist/libnode.so]
     7: 0x267231a843fd
    
  4. ckerr commented on May 8, 2018

    @ckerr
    Member

    @alice-em, saying "app X crashes" is essentially inviting the Electron team to triage arbitrary codebases that they are unfamliar with, so I encourage reporters to follow @RyanZim's example of having a small standalone 'hello world' style app that can be tested with.

    In any case, the env->async_hooks_init_function().IsEmpty() assertion appears to be a duplicate of #10905. The discussion there implies that it's an issue with the natives module rather than an Electron issue.

  5. alice-em commented on May 8, 2018

    @alice-em

    Electron worked on a second attempt with an entirely new project. It must've been something in the api that changed just before 1.8.4 for me to case my particular issue on my first project.

  6. RyanZim commented on May 8, 2018

    @RyanZim
    Author

    @ckerr I spun up a fresh VM of Lubuntu 17.10 and got the same result as #12850 (comment) with electron v2.0.0

  7. Klooven commented on May 15, 2018

    @Klooven

    I'm also having this problem after upgrading from Ubuntu 16.04 to 18.04. Running ELECTRON_ENABLE_LOGGING=true npm start does not give me any messages related to this.

    Using Electron 2.0.0.

    Ps. My app is based on the electron-next skeleton (probably doesn't have anything to do with this)

  8. peterdanis commented on Jun 18, 2018

    @peterdanis

    I can also reproduce the issue with Electron 2.0.2 on Fedora 27 and Ubuntu 18.04.

    My application (https://github.com/peterdanis/wrapbox) works when I build it (as AppImage) and run it from file manager, but hangs after a very short time (1-2s) when started from command line.

    Can be also reproduced by running the default Electron "app" (see picture below), by running yarn electron - this works for 20-30s on my two VMs and than it stops responding.

    By default Electron app I mean:
    image

    I do not have electron installed globally.

  9. Klooven commented on Jul 24, 2018

    @Klooven

    I found this (temporary) solution: #13624 (comment) (use --disable-gpu). It worked for me.

  10. wamoyo commented on Oct 24, 2018

    @wamoyo

    I'm still having the same issue. I want to use electron, but even the sample app opens up with a blank screen:

    screenshot from 2018-10-24 12 38 42

    I'm on Ubuntu 14.04 which is quite old at this point. I'll try again at 18.04. Getting a new machine in November.

    The interesting bit is that slack works just fine on my setup, and I'm almost certain they're running on electron.

  11. 1 remaining item

  12. SudoHenk commented on Nov 10, 2018

    @SudoHenk

    Debian Jessie, Dell XPS 15 9560 with a GTX 1050 using bumblebee seems to having the same problem. Interestingly, I tried both 3.0.8 where the window opens but nothing of the HTML is displayed, and 2.0.2 where everything worked fine. The fix npm start > /dev/null seems to work, but this does not feel like a permanent fix.

  13. CharlesBunders commented on Nov 13, 2018

    @CharlesBunders

    Debian 9.6 Stretch with Node 10.13.0 and Electron 3.0.6 same issue.

  14. maurimura commented on Nov 13, 2018

    @maurimura

    Same here.

    Debian 9.6 Node v11.1.0 Electron 3.0.9

    Works fine using --disable-gpu as @Klooven mentioned.

  15. JPustkuchen commented on Nov 30, 2018

    @JPustkuchen

    I can also confirm this on Ubuntu 18.04 as VMWare Workspace virtual instance.

    As a workaround

    /dev/null
    OR
    -- disable-gpu

    both works for me.

  16. kuun commented on Dec 5, 2018

    @kuun

    I had the same issue when I set display mode as 'Join Displays'.

  17. fmiceli24 commented on Dec 10, 2018

    @fmiceli24

    Same here. --disable-gpu workaround.

    Ubuntu 14.04, Gnome. Electron version 3.0.0

  18. sdetweil commented on Jan 29, 2019

    @sdetweil

    i still see the same bug, electron 2.0.0 or 2.0.16 on Ubuntu 18.04, npm start 2>/dev/null bypass works

  19. maurimura commented on Jan 30, 2019

    @maurimura

    Same here.

    Debian 9.6 Node v11.1.0 Electron 3.0.9

    Works fine using --disable-gpu as @Klooven mentioned.

    Works now in electron v3.1.1. thanks!

  20. sdetweil commented on Jan 30, 2019

    @sdetweil

    does not work with --disable-gpu for me (2.0.0 or 2.0.16)
    npm --enable-transparent-visuals --disable-gpu start $1 &

  21. sofianguy commented on Aug 9, 2019

    @sofianguy
    Contributor

    Thank you for taking the time to report this issue and helping to make Electron better.

    The version of Electron you reported this on has been superseded by newer releases.

    If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

    I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.

    Thanks in advance! Your help is appreciated.

  22. added
    blocked/need-info ❌
    on Aug 9, 2019
  23. sofianguy commented on Aug 19, 2019

    @sofianguy
    Contributor

    Thank you for your issue!

    We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2-0-xblocked/need-info ❌bug 🪲platform/linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions