Skip to content

Error trying to connect to websocket (unhandled exception) #13

@leith

Description

@leith

Expecting
To connect a websocket via async-websockets running on falcon-guard (or falcon)

Result
Socket closes with code 1006, this trace is printed to the falcon log:

18.55s     warn: Async::Task [oid=0xe484] [ec=0xe2e0] [pid=91248] [2022-08-05 07:14:37 +0000]
               | Task may have ended with unhandled exception.
               |   ArgumentError: wrong number of arguments (given 1, expected 0)
               |   → /var/lib/gems/2.7.0/gems/async-io-1.33.0/lib/async/io/stream.rb:216 in `close'
               |     /var/lib/gems/2.7.0/gems/protocol-http-0.22.6/lib/protocol/http/body/readable.rb:75 in `ensure in call'
               |     /var/lib/gems/2.7.0/gems/protocol-http-0.22.6/lib/protocol/http/body/readable.rb:75 in `call'
               |     /var/lib/gems/2.7.0/gems/async-http-0.56.6/lib/async/http/protocol/http1/server.rb:82 in `each'
               |     /var/lib/gems/2.7.0/gems/async-http-0.56.6/lib/async/http/server.rb:56 in `accept'
               |     /var/lib/gems/2.7.0/gems/async-io-1.33.0/lib/async/io/server.rb:32 in `block in accept_each'
               |     /var/lib/gems/2.7.0/gems/async-io-1.33.0/lib/async/io/ssl_socket.rb:145 in `block in accept'
               |     /var/lib/gems/2.7.0/gems/async-1.30.3/lib/async/task.rb:261 in `block in make_fiber'
               |   Caused by RuntimeError: No async task available!
               |   → /var/lib/gems/2.7.0/gems/async-1.30.3/lib/async/task.rb:189 in `current'
               |     /var/lib/gems/2.7.0/gems/async-http-0.56.6/lib/async/http/body/hijack.rb:78 in `read'
               |     /var/lib/gems/2.7.0/gems/protocol-http-0.22.6/lib/protocol/http/body/readable.rb:86 in `each'
               |     /var/lib/gems/2.7.0/gems/rack-2.2.4/lib/rack/body_proxy.rb:41 in `method_missing'
               |     /var/lib/gems/2.7.0/gems/rack-2.2.4/lib/rack/body_proxy.rb:41 in `method_missing'
               |     /var/lib/gems/2.7.0/gems/guard-2.18.0/bin/_guard-core:in `each'

Offlist conversation with @ioquatix seems to indicate the problem is here, as we've ended up with an Async::IO instance, which doesn't take any arguments for its close() method.

Presumably the same thing will apply on line 90.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions