{"action":"created","issue":{"url":"https://api.github.com/repos/net-ssh/net-ssh/issues/411","repository_url":"https://api.github.com/repos/net-ssh/net-ssh","labels_url":"https://api.github.com/repos/net-ssh/net-ssh/issues/411/labels{/name}","comments_url":"https://api.github.com/repos/net-ssh/net-ssh/issues/411/comments","events_url":"https://api.github.com/repos/net-ssh/net-ssh/issues/411/events","html_url":"https://github.com/net-ssh/net-ssh/issues/411","id":167199916,"number":411,"title":"connection is nil during do_request","user":{"login":"kt97679","id":3466350,"avatar_url":"https://avatars.githubusercontent.com/u/3466350?v=3","gravatar_id":"","url":"https://api.github.com/users/kt97679","html_url":"https://github.com/kt97679","followers_url":"https://api.github.com/users/kt97679/followers","following_url":"https://api.github.com/users/kt97679/following{/other_user}","gists_url":"https://api.github.com/users/kt97679/gists{/gist_id}","starred_url":"https://api.github.com/users/kt97679/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kt97679/subscriptions","organizations_url":"https://api.github.com/users/kt97679/orgs","repos_url":"https://api.github.com/users/kt97679/repos","events_url":"https://api.github.com/users/kt97679/events{/privacy}","received_events_url":"https://api.github.com/users/kt97679/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-23T19:41:38Z","updated_at":"2016-07-23T20:37:39Z","closed_at":null,"body":"Hi folks,\r\n\r\nI'm using net-ssh as part of my tool https://github.com/kt97679/one-ssh. Sometime I see following error:\r\n<pre>\r\n/home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/channel.rb:574:in `do_request': undefined method `send_message' for nil:NilClass (NoMethodError)\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:588:in `channel_request'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/session.rb:67:in `block in register_callbacks'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:85:in `call'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `block in fire'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `map'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `fire'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/connection.rb:321:in `block in register_data_handler'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:85:in `call'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `block in fire'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `map'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/callbacks.rb:41:in `fire'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/em-ssh-0.7.0/lib/em-ssh/connection.rb:140:in `receive_data'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run_machine'\r\n        from /home/kirill.timofeev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run'\r\n        from /home/kirill.timofeev/git/one-ssh/lib/ossh.rb:334:in `run'\r\n        from /home/kirill.timofeev/git/one-ssh/lib/ossh.rb:409:in `run'\r\n        from /home/kirill.timofeev/bin/ossh:10:in `<main>'\r\n</pre>\r\n\r\nFrom what I see this is caused by the nil value in the @connection in the Channel.\r\n\r\nPlease advise if this is expected behavior and I need to handle it somehow in my tool.\r\n\r\nThanks,\r\nKirill."},"comment":{"url":"https://api.github.com/repos/net-ssh/net-ssh/issues/comments/234738868","html_url":"https://github.com/net-ssh/net-ssh/issues/411#issuecomment-234738868","issue_url":"https://api.github.com/repos/net-ssh/net-ssh/issues/411","id":234738868,"user":{"login":"kt97679","id":3466350,"avatar_url":"https://avatars.githubusercontent.com/u/3466350?v=3","gravatar_id":"","url":"https://api.github.com/users/kt97679","html_url":"https://github.com/kt97679","followers_url":"https://api.github.com/users/kt97679/followers","following_url":"https://api.github.com/users/kt97679/following{/other_user}","gists_url":"https://api.github.com/users/kt97679/gists{/gist_id}","starred_url":"https://api.github.com/users/kt97679/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kt97679/subscriptions","organizations_url":"https://api.github.com/users/kt97679/orgs","repos_url":"https://api.github.com/users/kt97679/repos","events_url":"https://api.github.com/users/kt97679/events{/privacy}","received_events_url":"https://api.github.com/users/kt97679/received_events","type":"User","site_admin":false},"created_at":"2016-07-23T20:37:39Z","updated_at":"2016-07-23T20:37:39Z","body":"I changed channel.rb as follows:\r\n<pre>\r\n574c574\r\n<           connection.send_message(msg)\r\n---\r\n>           connection.send_message(msg) if @connection\r\n</pre>\r\nThis solves my issue, but I'm not sure if this is a right fix."}}
{"actor":{"display_login":"kt97679"}}