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

Compatible with Julia 1.x? ("Unsatisfiable requirements detected for package WebSockets") #3

Closed
gubikmic opened this issue Mar 19, 2019 · 5 comments

Comments

@gubikmic
Copy link

Following the example in the Readme the following error occurs:

(v1.1) pkg> add Mux WebIO Interact Widgets UnicodePlots CSV DataFrames
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package WebSockets [104b5d7c]:
 WebSockets [104b5d7c] log:
 ├─possible versions are: [0.0.1-0.0.6, 0.1.0-0.1.2, 0.2.0-0.2.3, 0.3.0, 0.4.0, 0.5.0, 1.0.0-1.0.3, 1.1.0-1.1.1, 1.2.0, 1.3.0-1.3.1, 1.4.0] or uninstalled
 ├─restricted by compatibility requirements with Mux [a975b10e] to versions: [0.0.1-0.0.6, 0.1.0-0.1.2, 0.2.0-0.2.3, 0.3.0, 0.4.0, 0.5.0, 1.0.0-1.0.3, 1.1.0-1.1.1, 1.2.0, 1.3.0-1.3.1, 1.4.0]
 │ └─Mux [a975b10e] log:
 │   ├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.3, 0.3.0-0.3.1, 0.4.0, 0.5.0-0.5.3, 0.6.0] or uninstalled
 │   └─restricted to versions * by an explicit requirement, leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.3, 0.3.0-0.3.1, 0.4.0, 0.5.0-0.5.3, 0.6.0]
 ├─restricted by compatibility requirements with HTTP [cd3eb016] to versions: [0.0.1-0.0.6, 0.1.0-0.1.2, 0.2.0-0.2.3, 0.3.0, 0.4.0, 0.5.0] or uninstalled, leaving only versions: [0.0.1-0.0.6, 0.1.0-0.1.2, 0.2.0-0.2.3, 0.3.0, 0.4.0, 0.5.0]
 │ └─HTTP [cd3eb016] log:
 │   ├─possible versions are: [0.0.1-0.0.2, 0.4.0-0.4.3, 0.5.0, 0.5.2-0.5.5, 0.5.7, 0.6.0-0.6.14, 0.7.0-0.7.1, 0.8.0] or uninstalled
 │   └─restricted to versions 0.8.0 by an explicit requirement, leaving only versions 0.8.0
 └─restricted by julia compatibility requirements to versions: [1.0.0-1.0.3, 1.1.0-1.1.1, 1.2.0, 1.3.0-1.3.1, 1.4.0] or uninstalled — no versions left

Is there any straightforward fix to this?

@piever
Copy link
Owner

piever commented Mar 19, 2019

Looks like you are fixing HTTP to version 0.8 which is not yet compatible with WebSockets, you can either:

(v1.1) pkg> free HTTP

Or use the environment provided by this repository (you may need to pull to get latest master, as I've just updated it). For that just start the REPL inside InteractDemos folder and:

(v1.1) pkg> activate .

(InteractDemos) pkg> instantiate

@gubikmic
Copy link
Author

Hey, thanks for your reply (and sorry my late answer).

This gets me one step further and I can launch and connect to the local webserver but there's still an error when I try to run the examples.

I'll give the full prompts below just to make sure I'm not missing anything:

$ git pull  # or git clone https://github.com/piever/InteractDemos.git and cd into that directory
$ julia
(v1.1) pkg> add Mux WebIO Interact Widgets UnicodePlots CSV DataFrames
(v1.1) pkg> activate .
(InteractDemos) pkg> instantiate
julia> include("main.jl")

Then I connect to localhost:8000 and click on the slider example and the following crash occurs:

[ Info: Listening on: Sockets.InetAddr{IPv4}(ip"0.0.0.0", 8000)
[ Info: Accept (0):  🔗    0↑     0↓    1s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (1):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Closed (1):  💀    0↑     0↓🔒   0s 0.0.0.0:8000:8000 ≣16
┌ Warning: Base.IOError("stream is closed or unusable", 0)
└ @ HTTP.Servers ~/.julia/packages/HTTP/YjRCz/src/Servers.jl:462
[ Info: Accept (2):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (3):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (4):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (5):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (6):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
[ Info: Accept (7):  🔗    0↑     0↓    0s 0.0.0.0:8000:8000 ≣16
Error handling websocket connection:
WebSockets.WebSocketClosedError(" while read(ws|server) BoundsError(UInt8[], (1,))")
Stacktrace:
 [1] try_yieldto(::typeof(Base.ensure_rescheduled), ::Base.RefValue{Task}) at ./event.jl:196
 [2] wait() at ./event.jl:255
 [3] wait(::Condition) at ./event.jl:46
 [4] wait(::Task) at ./task.jl:188
 [5] create_socket(::Dict{Any,Any}) at /Users/mmg/.julia/packages/WebIO/Rk8wc/src/providers/mux.jl:44
 [6] (::getfield(Mux, Symbol("##5#6")){getfield(Mux, Symbol("##27#28")){Array{SubString{String},1}},typeof(WebIO.create_socket)})(::Function, ::Dict{Any,Any}) at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:17
 [7] #1 at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:10 [inlined]
 [8] splitquery(::getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##5#6")){getfield(Mux, Symbol("##27#28")){Array{SubString{String},1}},typeof(WebIO.create_socket)},getfield(Mux, Symbol("##1#2")){typeof(Mux.wclose),getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##17#18")){getfield(Mux, Symbol("##21#22")){Symbol,Int64}},getfield(Mux, Symbol("##19#20")){String}}}}, ::Dict{Any,Any}) at /Users/mmg/.julia/packages/Mux/a0IXM/src/basics.jl:32
 [9] #1 at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:10 [inlined]
 [10] wcatch(::getfield(Mux, Symbol("##1#2")){typeof(Mux.splitquery),getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##5#6")){getfield(Mux, Symbol("##27#28")){Array{SubString{String},1}},typeof(WebIO.create_socket)},getfield(Mux, Symbol("##1#2")){typeof(Mux.wclose),getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##17#18")){getfield(Mux, Symbol("##21#22")){Symbol,Int64}},getfield(Mux, Symbol("##19#20")){String}}}}}, ::Dict{Any,Any}) at /Users/mmg/.julia/packages/Mux/a0IXM/src/websockets_integration.jl:12
 [11] #1 at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:10 [inlined]
 [12] todict at /Users/mmg/.julia/packages/Mux/a0IXM/src/basics.jl:23 [inlined]
 [13] #3 at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:14 [inlined] (repeats 2 times)
 [14] (::getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##3#4")){getfield(Mux, Symbol("##3#4")){typeof(Mux.todict),typeof(Mux.wcatch)},typeof(Mux.splitquery)},getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##5#6")){getfield(Mux, Symbol("##27#28")){Array{SubString{String},1}},typeof(WebIO.create_socket)},getfield(Mux, Symbol("##1#2")){typeof(Mux.wclose),getfield(Mux, Symbol("##1#2")){getfield(Mux, Symbol("##17#18")){getfield(Mux, Symbol("##21#22")){Symbol,Int64}},getfield(Mux, Symbol("##19#20")){String}}}}})(::Tuple{HTTP.Messages.Request,WebSockets.WebSocket{TCPSocket}}) at /Users/mmg/.julia/packages/Mux/a0IXM/src/Mux.jl:10
 [15] (::getfield(Mux, Symbol("##9#10")){Mux.App})(::HTTP.Messages.Request, ::WebSockets.WebSocket{TCPSocket}) at /Users/mmg/.julia/packages/Mux/a0IXM/src/server.jl:49
 [16] upgrade(::getfield(Mux, Symbol("##9#10")){Mux.App}, ::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{TCPSocket}}) at /Users/mmg/.julia/packages/WebSockets/3neZK/src/HTTP.jl:191
 [17] (::getfield(WebSockets, Symbol("#_servercoroutine#11")){WebSockets.ServerWS{HTTP.Servers.http,HTTP.Handlers.HandlerFunction{getfield(Mux, Symbol("##7#8")){Mux.App}},WebSockets.WebsocketHandler{getfield(Mux, Symbol("##9#10")){Mux.App}}}})(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{TCPSocket}}) at /Users/mmg/.julia/packages/WebSockets/3neZK/src/HTTP.jl:399
 [18] handle_stream(::getfield(WebSockets, Symbol("#_servercoroutine#11")){WebSockets.ServerWS{HTTP.Servers.http,HTTP.Handlers.HandlerFunction{getfield(Mux, Symbol("##7#8")){Mux.App}},WebSockets.WebsocketHandler{getfield(Mux, Symbol("##9#10")){Mux.App}}}}, ::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{TCPSocket}}) at /Users/mmg/.julia/packages/HTTP/YjRCz/src/Servers.jl:484
 [19] (::getfield(HTTP.Servers, Symbol("##55#56")){Bool,getfield(WebSockets, Symbol("#_servercoroutine#11")){WebSockets.ServerWS{HTTP.Servers.http,HTTP.Handlers.HandlerFunction{getfield(Mux, Symbol("##7#8")){Mux.App}},WebSockets.WebsocketHandler{getfield(Mux, Symbol("##9#10")){Mux.App}}}},HTTP.ConnectionPool.Transaction{TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{TCPSocket}}})() at ./task.jl:259[ Info: Closed (3):  💀    1↑     1↓🔒  12s 0.0.0.0:8000:8000 ≣16

If you get around to it, it would be nice if you could see if you get the same error. Thanks.

@piever
Copy link
Owner

piever commented Mar 22, 2019

Does the interface keep working despite the error in the console or it stops responding?

@piever
Copy link
Owner

piever commented Mar 23, 2019

I've updated to the latest Mux plus WebSockets and it does seem like there are some WebSockets error happening that break interactivity, I'll see if there is a way to make things more robust.

@gubikmic
Copy link
Author

gubikmic commented Apr 6, 2019

It works now

@gubikmic gubikmic closed this as completed Apr 6, 2019
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

2 participants