fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.94k stars 285 forks source link

Pluto 0.14 crashes on Julia 1.6 (windows 10 64bit) #1058

Closed rick2047 closed 3 years ago

rick2047 commented 3 years ago

Sorry for the vague title, but I don't know what the root cause it. My pluto notebook has a single statement in it, using Plots. But Pluto just hangs there, and I see this error in the REPL

Opening http://localhost:1234/?secret=Ue0rj9wo in your default browser... ~ have fun!

Press Ctrl+C in this terminal to stop Pluto

ERROR: julia: -t,--threads=<n> must be an integer >= 1
┌ Warning: Response function to message of type complete failed
└ @ Pluto C:\Users\paresh\.julia\packages\Pluto\bn5CN\src\webserver\WebServer.jl:355
┌ Warning: Reading WebSocket client stream failed for unknown reason:
│   parentbody =
│    Dict{Any, Any} with 5 entries:
│      "client_id"  => "jqfo2m"
│      "body"       => Dict{Any, Any}("query"=>"sq")
│      ⋮            => ⋮
│   exception =
│    TaskFailedException
│    Stacktrace:
│      [1] wait
│        @ .\task.jl:317 [inlined]
│      [2] fetch(p::Pluto.Promise{Pluto.WorkspaceManager.Workspace})
│        @ Pluto ~\.julia\packages\Pluto\bn5CN\src\evaluation\Tokens.jl:90
│      [3] get_workspace
│        @ ~\.julia\packages\Pluto\bn5CN\src\evaluation\WorkspaceManager.jl:139 [inlined]
│      [4] response_complete(🙋::Pluto.ClientRequest)
│        @ Pluto ~\.julia\packages\Pluto\bn5CN\src\webserver\REPLTools.jl:65
│      [5] process_ws_message(session::Pluto.ServerSession, parentbody::Dict{Any, Any}, clientstream::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│        @ Pluto ~\.julia\packages\Pluto\bn5CN\src\webserver\WebServer.jl:353
│      [6] (::Pluto.var"#194#204"{Pluto.ServerSession, Base.RefValue{Function}})(clientstream::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│        @ Pluto ~\.julia\packages\Pluto\bn5CN\src\webserver\WebServer.jl:166
│      [7] upgrade(f::Pluto.var"#194#204"{Pluto.ServerSession, Base.RefValue{Function}}, http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; binary::Bool)
│        @ HTTP.WebSockets ~\.julia\packages\HTTP\IAI92\src\WebSockets.jl:160
│      [8] upgrade
│        @ ~\.julia\packages\HTTP\IAI92\src\WebSockets.jl:142 [inlined]
│      [9] (::Pluto.var"#193#203"{Pluto.ServerSession, Base.RefValue{Function}, HTTP.Handlers.Router{Symbol("##414")}})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│        @ Pluto ~\.julia\packages\Pluto\bn5CN\src\webserver\WebServer.jl:148
│     [10] handle
│        @ ~\.julia\packages\HTTP\IAI92\src\Handlers.jl:269 [inlined]
│     [11] #4
│        @ ~\.julia\packages\HTTP\IAI92\src\Handlers.jl:345 [inlined]
│     [12] macro expansion
│        @ ~\.julia\packages\HTTP\IAI92\src\Servers.jl:367 [inlined]
│     [13] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#193#203"{Pluto.ServerSession, Base.RefValue{Function}, HTTP.Handlers.Router{Symbol("##414")}}}}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
│        @ HTTP.Servers .\task.jl:406
│ 
│        nested task error: TaskFailedException
│ 
│            nested task error: Unable to read host:port string from worker. Launch command exited with error?
│            Stacktrace:
│             [1] worker_from_id(pg::Distributed.ProcessGroup, i::Int64)
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:1082
│             [2] worker_from_id
│               @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:1079 [inlined]
│             [3] #remote_do#154
│               @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\remotecall.jl:486 [inlined]
│             [4] remote_do
│               @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\remotecall.jl:486 [inlined]
│             [5] kill
│               @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\managers.jl:675 [inlined]
│             [6] create_worker(manager::Distributed.LocalManager, wconfig::Distributed.WorkerConfig)
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:593
│             [7] setup_launched_worker(manager::Distributed.LocalManager, wconfig::Distributed.WorkerConfig, launched_q::Vector{Int64})
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:534
│             [8] (::Distributed.var"#41#44"{Distributed.LocalManager, Vector{Int64}, Distributed.WorkerConfig})()
│               @ Distributed .\task.jl:406
│ 
│            caused by: Unable to read host:port string from worker. Launch command exited with error?
│            Stacktrace:
│             [1] read_worker_host_port(io::Base.PipeEndpoint)
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:324
│             [2] connect(manager::Distributed.LocalManager, pid::Int64, config::Distributed.WorkerConfig)
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\managers.jl:524
│             [3] create_worker(manager::Distributed.LocalManager, wconfig::Distributed.WorkerConfig)
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:589
│             [4] setup_launched_worker(manager::Distributed.LocalManager, wconfig::Distributed.WorkerConfig, launched_q::Vector{Int64})
│               @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:534
│             [5] (::Distributed.var"#41#44"{Distributed.LocalManager, Vector{Int64}, Distributed.WorkerConfig})()
│               @ Distributed .\task.jl:406
│        Stacktrace:
│          [1] sync_end(c::Channel{Any})
│            @ Base .\task.jl:364
│          [2] macro expansion
│            @ .\task.jl:383 [inlined]
│          [3] addprocs_locked(manager::Distributed.LocalManager; kwargs::Base.Iterators.Pairs{Symbol, Vector{String}, Tuple{Symbol}, NamedTuple{(:exeflags,), Tuple{Vector{String}}}})
│            @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:480
│          [4] addprocs(manager::Distributed.LocalManager; kwargs::Base.Iterators.Pairs{Symbol, Vector{String}, Tuple{Symbol}, NamedTuple{(:exeflags,), Tuple{Vector{String}}}})
│            @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\cluster.jl:444
│          [5] addprocs(np::Int64; restrict::Bool, kwargs::Base.Iterators.Pairs{Symbol, Vector{String}, Tuple{Symbol}, NamedTuple{(:exeflags,), Tuple{Vector{String}}}})   
│            @ Distributed C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Distributed\src\managers.jl:443
│          [6] create_workspaceprocess(; compiler_options::Pluto.Configuration.CompilerOptions)
│            @ Pluto.WorkspaceManager ~\.julia\packages\Pluto\bn5CN\src\evaluation\WorkspaceManager.jl:116
│          [7] make_workspace(::Tuple{Pluto.ServerSession, Pluto.Notebook}; force_offline::Bool)
│            @ Pluto.WorkspaceManager ~\.julia\packages\Pluto\bn5CN\src\evaluation\WorkspaceManager.jl:48
│          [8] make_workspace
│            @ ~\.julia\packages\Pluto\bn5CN\src\evaluation\WorkspaceManager.jl:39 [inlined]
│          [9] #8
│            @ ~\.julia\packages\Pluto\bn5CN\src\evaluation\WorkspaceManager.jl:137 [inlined]
│         [10] macro expansion
│            @ ~\.julia\packages\Pluto\bn5CN\src\evaluation\Tokens.jl:83 [inlined]
│         [11] (::Pluto.var"#2#3"{Pluto.WorkspaceManager.var"#8#10"{Tuple{Pluto.ServerSession, Pluto.Notebook}}, Pluto.Promise{Pluto.WorkspaceManager.Workspace}})()       
│            @ Pluto .\task.jl:406
└ @ Pluto C:\Users\paresh\.julia\packages\Pluto\bn5CN\src\webserver\WebServer.jl:174

If this is useful, these are the packages installed

(@v1.6) pkg> st
      Status `C:\Users\paresh\.julia\environments\v1.6\Project.toml`
  [587475ba] Flux v0.12.1
  [28b8d3ca] GR v0.57.1
  [a98d9a8b] Interpolations v0.13.1
  [ff71e718] MixedModels v3.5.0
  [5fb14364] OhMyREPL v0.5.10
  [58dd65bb] Plotly v0.3.0
  [91a5bcdd] Plots v1.11.2
  [c3e4b0f8] Pluto v0.14.0
  [7f904dfe] PlutoUI v0.7.1
  [295af30f] Revise v3.1.14
fonsp commented 3 years ago

What is the command you used to launch Pluto? Are you able to open a notebook? Loading plots is supposed to take a long time on windows (15 minutes), how long did you wait?

Does 1+1 work?

flaviomorelli commented 3 years ago

I have the same problem. I am using Julia 1.6 and I just updated to 0.14. I am able to open a notebook. However, when running code, Pluto gets stuck. In the REPL, I get the same error message as @rick2047 after launching Pluto. 1+1 does not work for me and neither does importing packages with using. Importing packages directly in the REPL works fine. I already restarted the REPL several times, but that does not work either.

flaviomorelli commented 3 years ago

Downgrading to 0.12.21 solved the problem for me.

EDIT: Just to clarify, I'm using macOS Catalina, not WIndows.

rick2047 commented 3 years ago

@fonsp I have exactly the same behavior as @flaviomorelli . I used simple commands to run Pluto.

julia> using Pluto
julia> Pluto.run()
haozhangphd commented 3 years ago

looks like it is related to #990.

Do you get anything from ENV["JULIA_NUM_THREADS"]? Also what do you get if you run the following?

import Pluto
get(ENV, "JULIA_NUM_THREADS", string(Pluto.Configuration.roughly_the_number_of_physical_cpu_cores()))
rick2047 commented 3 years ago

I ran both the commands, they returned empty strings


julia> ENV["JULIA_NUM_THREADS"]

""

julia> import Pluto

julia> get(ENV, "JULIA_NUM_THREADS", string(Pluto.Configuration.roughly_the_number_of_physical_cpu_cores()))

""
fonsp commented 3 years ago

Can you check whether the problem is fixed by doing:

julia> ]
pkg> activate --temp
pkg> add Pluto#fix-1058
julia> import Pluto
julia> Pluto.run()
rick2047 commented 3 years ago

yup, Pluto#fix-1058 works. I can open notebooks and do 1+1 and plotting. So that seems to fix it.