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

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

Closed
RyanZim opened this issue May 7, 2018 · 22 comments
Closed

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

RyanZim opened this issue May 7, 2018 · 22 comments
Labels

Comments

@RyanZim
Copy link

RyanZim commented May 7, 2018

  • 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?)

@ckerr
Copy link
Member

ckerr commented May 7, 2018

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?

@RyanZim
Copy link
Author

RyanZim commented May 8, 2018

BTW, here is the logging output I get:

$ ELECTRON_ENABLE_LOGGING=true npm start

> electron-quick-start@1.0.0 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.

@alice-em
Copy link

alice-em commented May 8, 2018

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

> Wonder-Reader@0.5.2 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

@ckerr
Copy link
Member

ckerr commented May 8, 2018

@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.

@alice-em
Copy link

alice-em commented May 8, 2018

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.

@RyanZim
Copy link
Author

RyanZim commented May 8, 2018

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

@Klooven
Copy link

Klooven commented May 15, 2018

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)

@peterdanis
Copy link

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.

@Klooven
Copy link

Klooven commented Jul 24, 2018

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

@wamoyo
Copy link

wamoyo commented Oct 24, 2018

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.

@ioev
Copy link

ioev commented Nov 9, 2018

Same issue running Ubuntu 18.04/18.10 through VMWare 14.1.3, Intel(R) UHD Graphics 630. Running "npm start" from the terminal locks up after a few seconds, sometimes rendering the entire VM unresponsive to mouse input (but can alt-tab to the terminal and control-c to restore it.) Running as suggested "npm start > /dev/null" solves the problem, but running with "--disable-gpu" does not.

@SudoHenk
Copy link

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.

@CharlesBunders
Copy link

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

@maurimura
Copy link

Same here.

Debian 9.6 Node v11.1.0 Electron 3.0.9

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

@JPustkuchen
Copy link

JPustkuchen commented Nov 30, 2018

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.

@kuun
Copy link

kuun commented Dec 5, 2018

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

@fmiceli24
Copy link

Same here. --disable-gpu workaround.

Ubuntu 14.04, Gnome. Electron version 3.0.0

@sdetweil
Copy link

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

@maurimura
Copy link

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!

@sdetweil
Copy link

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

@sofianguy
Copy link
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.

@sofianguy sofianguy added the blocked/need-info ❌ Cannot proceed without more information label Aug 9, 2019
@sofianguy
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests