plotly / Dash.jl

Dash for Julia - A Julia interface to the Dash ecosystem for creating analytic web applications in Julia. No JavaScript required.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOError: stream is closed or unusable

mariok90 opened this issue · comments

I started to experiment with Dash.jl and tried to run the examples. When I run

app = dash(external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"])

app.layout = html_div() do
    dcc_input(id = "my-id", value="initial value", type = "text"),
    html_div(id = "my-div")
end

callback!(app, Output("my-div", "children"), Input("my-id", "value")) do input_value
    "You've entered $(input_value)"
end

run_server(app)

I can load the page and the plot is displayed but the REPL shows an error message:

[ Info: Listening on: 127.0.0.1:8050
┌ Error: error handling request
│   exception =
│    IOError: stream is closed or unusable
│    Stacktrace:
│     [1] check_open at .\stream.jl:328 [inlined]
│     [2] uv_write_async(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:959
│     [3] uv_write(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:922     
│     [4] unsafe_write(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:1005│     [5] unsafe_write at C:\Users\Mario\.julia\packages\HTTP\IAI92\src\ConnectionPool.jl:171 [inlined]
│     [6] unsafe_write at .\io.jl:622 [inlined]
│     [7] write at .\io.jl:645 [inlined]
│     [8] startwrite(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at C:\Users\Mario\.julia\packages\HTTP\IAI92\src\Streams.jl:87
│     [9] handle(::HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#4#5"{Array{String,1},Int64,HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#7#8"{Dash.var"#65#67"{Dash.DashApp},HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#1#2"{Dash.HttpHelpers.Router,Dash.HandlerState}}}}}}, ::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at C:\Users\Mario\.julia\packages\HTTP\IAI92\src\Handlers.jl:278
│     [10] #4 at C:\Users\Mario\.julia\packages\HTTP\IAI92\src\Handlers.jl:345 [inlined]
│     [11] macro expansion at C:\Users\Mario\.julia\packages\HTTP\IAI92\src\Servers.jl:367 [inlined]
│     [12] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#4#5"{Array{String,1},Int64,HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#7#8"{Dash.var"#65#67"{Dash.DashApp},HTTP.Handlers.RequestHandlerFunction{Dash.HttpHelpers.var"#1#2"{Dash.HttpHelpers.Router,Dash.HandlerState}}}}}}},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at .\task.jl:356└ @ HTTP.Servers C:\Users\Mario\.julia\packages\HTTP\IAI92\src\Servers.jl:373

This happens to several examples I have found. So it seems to be a generel problem with my setup/installation. However, the dashboard stays responsive and the callback still works.

In case it helps, my installed versions are:

  [1b08a953] Dash v0.1.3
  [1b08a953] DashCoreComponents v1.12.0
  [1b08a953] DashHtmlComponents v1.1.1

Hi @mariok90, thanks for reporting this issue. I believe it may be a duplicate of #67, which seems to be related to waralex/Dashboards.jl#18.

We previously suspected (in #67) that this issue is related to HTTP.jl, which Dash.jl relies upon. A PR was recently merged there that might address this problem.

HTTP v0.9.2 should have this fix; and it was recently merged.

HTTP v0.9.2 should have this fix; and it was recently merged.

Thanks @clarkevans! I came to the same conclusion in my reply above, and @waralex is already aware too. If this does the trick, we'll likely be able to close #67 and #80.

This issue is probably outdated. Closing.

Please open a new issue if a similar problem is found using the latest Dash.jl version.