Skip to content

Occasional Net::HTTPBadResponse after sending first message #4

@gkaklas

Description

@gkaklas

When sending a message with simple_client.rb sometimes it works fine, but other times I get these errors and the program exits after sending the message:

#<Thread:0x000055c9759eba80@/home/user/.gem/ruby/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:471 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        13: from /home/user/.gem/ruby/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
        12: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/client.rb:140:in `block in start_listener_thread'
        11: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/client.rb:162:in `listen_forever'
        10: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/client.rb:223:in `sync'
         9: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:126:in `sync'
         8: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:610:in `request'
         7: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:610:in `loop'
         6: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:614:in `block in request'
         5: from /usr/lib/ruby/2.5.0/net/http.rb:1464:in `request'
         4: from /usr/lib/ruby/2.5.0/net/http.rb:1491:in `transport_request'
         3: from /usr/lib/ruby/2.5.0/net/http.rb:1491:in `catch'
         2: from /usr/lib/ruby/2.5.0/net/http.rb:1494:in `block in transport_request'
         1: from /usr/lib/ruby/2.5.0/net/http/response.rb:29:in `read_new'
/usr/lib/ruby/2.5.0/net/http/response.rb:42:in `read_status_line': wrong status line: "0" (Net::HTTPBadResponse)
Traceback (most recent call last):
        14: from examples/simple_client.rb:78:in `<main>'
        13: from examples/simple_client.rb:78:in `loop'
        12: from examples/simple_client.rb:87:in `block in <main>'
        11: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/room.rb:140:in `send_text'
        10: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:289:in `send_message'
         9: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:241:in `send_message_event'
         8: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:610:in `request'
         7: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:610:in `loop'
         6: from /home/user/.gem/ruby/2.5.0/gems/matrix_sdk-0.0.3/lib/matrix_sdk/api.rb:614:in `block in request'
         5: from /usr/lib/ruby/2.5.0/net/http.rb:1464:in `request'
         4: from /usr/lib/ruby/2.5.0/net/http.rb:1491:in `transport_request'
         3: from /usr/lib/ruby/2.5.0/net/http.rb:1491:in `catch'
         2: from /usr/lib/ruby/2.5.0/net/http.rb:1494:in `block in transport_request'
         1: from /usr/lib/ruby/2.5.0/net/http/response.rb:29:in `read_new'
/usr/lib/ruby/2.5.0/net/http/response.rb:42:in `read_status_line': wrong status line: "" (Net::HTTPBadResponse)

By running it a few times, I noticed that this either happens after the first message that is sent after the client is started or it doesn't happen at all. If it happens, it usually takes a few extra seconds to send the message, but it is delivered successfully just before exiting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions