acaprojects / ruby-engine

Scalable building automation for the internet of things
Other
6 stars 2 forks source link

SSH transport attempts to send data when no shell exists #12

Closed kimburgess closed 6 years ago

kimburgess commented 6 years ago

Interesting one I've noticed on system boot. Logs appear to indicate that the connection is timing out while establishing the interactive shell. Under this failure mode there appears to be an event ordering issues where transmit is still called, without @shell existing.

[error] unhandled exception: undefined method `send_data' for nil:NilClass (performing next tick callback)
/home/aca-apps/ruby-engine/lib/orchestrator/ssh/transport_ssh.rb:238:in `transmit'
/home/aca-apps/ruby-engine/lib/orchestrator/device/processor.rb:451:in `transport_send'
/home/aca-apps/ruby-engine/lib/orchestrator/device/processor.rb:446:in `process_send'
/home/aca-apps/ruby-engine/lib/orchestrator/device/processor.rb:422:in `send_next'
/home/aca-apps/ruby-engine/lib/orchestrator/device/processor.rb:87:in `block in initialize'
/home/aca-apps/ruby-engine/lib/orchestrator/device/command_queue.rb:189:in `perform_pop'
/home/aca-apps/ruby-engine/lib/orchestrator/device/command_queue.rb:29:in `block in initialize'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/reactor.rb:139:in `process_item'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/reactor.rb:132:in `block (2 levels) in process_queue_cb'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/fiber_pool.rb:19:in `block in exec'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/fiber_pool.rb:76:in `block (2 levels) in new_fiber'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/fiber_pool.rb:73:in `loop'
/usr/local/bundle/gems/libuv-4.0.2/lib/libuv/fiber_pool.rb:73:in `block in new_fiber'
04/07/2018 @ 08:27PM ERROR: [::Cisco::CollaborationEndpoint::Sx80] [mod-pera-04-t-01-sx80] failed to initialize SSH shell after 8 seconds
04/07/2018 @ 08:27PM ERROR: [::Cisco::CollaborationEndpoint::Sx80] [essh.transport.session[2add268242e4]] forcing connection closed
stakach commented 6 years ago

This issue is caused when something attempts to send a command before connected has been fired. Could be a user-interface calling a function or a logic module or something occurring in on_load