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

ERROR: connect: connection refused (ECONNREFUSED) when opening new window #128

Closed
kleskjr opened this issue Jun 29, 2018 · 7 comments
Closed

Comments

@kleskjr
Copy link

kleskjr commented Jun 29, 2018

I can't go around a problem of using PlotlyJS from my terminal (works fine in Atom). The issue is reported before JuliaPlots/PlotlyJS.jl#33, and similarly #82 . The thing is that even locally, I am not able to open a window with Blink.Window()

julia> Blink.Window()
ERROR: connect: connection refused (ECONNREFUSED)
Stacktrace:
 [1] try_yieldto(::Base.##298#299{Task}, ::Task) at ./event.jl:189
 [2] wait() at ./event.jl:234
 [3] wait(::Condition) at ./event.jl:27
 [4] stream_wait(::TCPSocket, ::Condition, ::Vararg{Condition,N} where N) at ./stream.jl:42
 [5] wait_connected(::TCPSocket) at ./stream.jl:258
 [6] connect at ./stream.jl:983 [inlined]
 [7] connect(::IPv4, ::Int64) at ./socket.jl:742
 [8] #try_connect#4(::Float64, ::Int64, ::Function, ::IPv4, ::Vararg{Any,N} where N) at /home/nic/.julia/v0.6/Blink/src/AtomShell/process.jl:62
 [9] #init#5(::Bool, ::Function) at /home/nic/.julia/v0.6/Blink/src/AtomShell/process.jl:76
 [10] (::Blink.AtomShell.#kw##init)(::Array{Any,1}, ::Blink.AtomShell.#init) at ./<missing>:0
 [11] #shell#8(::Bool, ::Function) at /home/nic/.julia/v0.6/Blink/src/AtomShell/process.jl:114
 [12] Blink.AtomShell.Window() at /home/nic/.julia/v0.6/Blink/src/AtomShell/window.jl:37

The machine is under Ubuntu 18.04, tried both with Julia 0.6.2 and 0.6.3. Using xvfb-run julia and Blink.Atom.install() brought no success. Also increasing the input parameter values in function try_connect(args...; interval = 0.5, attempts = 300) didn't help. Any idea for a workaround is welcome.

@kleskjr
Copy link
Author

kleskjr commented Jun 29, 2018

I just installed the older ubuntu (16.04) in a virtual box and everythingworked fine, while a virtual newer Ubuntu (18.04) has the same issue as the local machine. Is it possible that the problem is in some blocked connections on a system level?

@pfitzseb
Copy link
Member

That's almost certainly the case -- you could try looking for a port you know is free and set the BLINK_PORT environment variable to that before loading Blink.

@fqroldan
Copy link

fqroldan commented Jul 5, 2018

I have the same problem as the op. How would I go about locating a free port and setting the BLINK_PORT environment variable to it?

@twavv
Copy link
Member

twavv commented Oct 7, 2018

It seems that the ECONNREFUSED happens because the electron process dies immediately, and might just be a red herring for not having a complete enough system (in terms of libraries).

I tried running electron manually. You can get the binary path via

julia> Blink.AtomShell.electron()
"/root/.julia/packages/Blink/vKGzM/deps/atom/electron"

I saw that it kept complaining about nonexistant libraries. I ended up installing...

  • libgtk-3-0
  • libxss1
  • libgconf-2-4
  • libnss3
  • libasound2
  • libx11-xcb1

and finally got it to work.

@fqroldan
Copy link

fqroldan commented Oct 7, 2018

Yes! Works for me as well

@mbauman
Copy link
Contributor

mbauman commented May 30, 2019

Just as another breadcrumb: this can happen if you're forwarding X11 over a slow connection and you hit the timeout before Julia's able to connect to the electron app. #199 should help this case.

@twavv
Copy link
Member

twavv commented Jul 30, 2019

Closing this. Please open a new issue if you're having problems. :^)

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

No branches or pull requests

5 participants