JuliaGizmos / Blink.jl

Web-based GUIs for Julia
Other
355 stars 74 forks source link

`IOError: connect: connection refused (ECONNREFUSED)` only on VS Code notebook #315

Open jpmvferreira opened 8 months ago

jpmvferreira commented 8 months ago

I'm facing an IOError: connect: connection refused (ECONNREFUSED) error on VS Code notebooks whenever I am trying to create a window using Blink.

This error doesn't take place when running exactly the same code from the Julia REPL in a terminal external to VS Code, nor when calling the Julia binary in a standard .jl file. I've also been able of successfully using Blink from the julia REPL inside of VS Code. What is interesting is that the kernel that I am using in the VS Code notebook is not the one that ships with the Julia extension, but my local kernel. This doesn't seem like an issue of missing libraries, given that I can execute the electron executable present in the ~/.julia/artifacts folder.

To replicate this issue setup an .ipynb notebook with a single cell and the following written in it:

using Blink: Window
w = Window()

Upon running this piece of code, I get the following stacktrace:

IOError: connect: connection refused (ECONNREFUSED)

Stacktrace:
  [1] wait_connected(x::Sockets.TCPSocket)
    @ Sockets [/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:528](https://file+.vscode-resource.vscode-cdn.net/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:528)
  [2] connect
    @ [/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:563](https://file+.vscode-resource.vscode-cdn.net/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:563) [inlined]
  [3] connect(addr::Sockets.IPv4, port::Int64)
    @ Sockets [/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:549](https://file+.vscode-resource.vscode-cdn.net/usr/share/julia/stdlib/v1.9/Sockets/src/Sockets.jl:549)
  [4] try_connect(::Sockets.IPv4, ::Vararg{Any}; interval::Float64, attempts::Int64)
    @ Blink.AtomShell [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:77](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:77)
  [5] try_connect
    @ [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:74](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:74) [inlined]
  [6] init(; debug::Bool)
    @ Blink.AtomShell [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:91](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:91)
  [7] init
    @ [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:85](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:85) [inlined]
  [8] #shell#6
    @ [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:147](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:147) [inlined]
  [9] shell
    @ [~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:138](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/process.jl:138) [inlined]
 [10] #Window#11
    @ [~/.julia/packages/Blink/LhpHk/src/AtomShell/window.jl:100](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/window.jl:100) [inlined]
 [11] Window()
    @ Blink.AtomShell [~/.julia/packages/Blink/LhpHk/src/AtomShell/window.jl:100](https://file+.vscode-resource.vscode-cdn.net/home/undercover/projects/etk/~/.julia/packages/Blink/LhpHk/src/AtomShell/window.jl:100)
 [12] top-level scope
    @ In[1]:2
b0wter commented 4 months ago

I'm having the same problem. I am running Fedora 39 and VS Code version 1.87.0-insider.