cuprite icon indicating copy to clipboard operation
cuprite copied to clipboard

500 error, possibly related to web sockets with Ferrum

Open andrewkatz opened this issue 2 years ago • 0 comments

I'm seeing an error that pops up sometimes. Not a consistent issue, but enough to fail our builds every few days.

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
#<Thread:0x00007fb8b0052858 /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/web_socket.rb:30 run> terminated with exception (report_on_exception is true):
/home/runner/work/platform/platform/spec/support/capybara.rb:19:in `puts': undefined method `[]' for nil:NilClass (NoMethodError)

      Kernel.puts "#{log_body['params']['entry']['url']} - #{log_body['params']['entry']['text']}"
                                                ^^^^^^^
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/web_socket.rb:64:in `on_message'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/event_emitter.rb:39:in `block in emit'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/event_emitter.rb:38:in `each'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/event_emitter.rb:38:in `emit'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/hybi.rb:408:in `emit_message'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/hybi.rb:390:in `emit_frame'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/hybi.rb:118:in `parse'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.5/lib/websocket/driver/client.rb:63:in `parse'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/web_socket.rb:39:in `block (2 levels) in initialize'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/web_socket.rb:35:in `loop'
	from /home/runner/work/platform/platform/vendor/bundle/ruby/3.1.0/gems/ferrum-0.13/lib/ferrum/browser/web_socket.rb:35:in `block in initialize'

After that error, the next request attempt times out and we'll see:

No route matches [GET] "/features"
Ferrum::TimeoutError

I figured I would start here as the actual exception is occurring in Capybara, but happy to move this to the Ferrum repo if that's a more appropriate place.

andrewkatz avatar Apr 20 '23 17:04 andrewkatz