Skip to content

Long running SSH connections causing exceptions/failures #38

@CpuID

Description

@CpuID

I have some long running scripts that maintain SSH connections, by virtue that Rye boxes keep the SSH connection open persistently from initial use through to script completion (unless you call disconnect in between).

I seem to get the below after a few minutes:

Failure on thread threadname: connection closed by remote host
/var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/transport/packet_stream.rb:87:in next_packet': connection closed by remote host (Net::SSH::Disconnect) from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/transport/session.rb:172:inpoll_message'
from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/transport/session.rb:167:in loop' from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/transport/session.rb:167:inpoll_message'
from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:454:in dispatch_incoming_packets' from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:216:inpreprocess'
from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:200:in process' from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:164:inloop'
from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:164:in loop_forever' from /var/lib/gems/1.8/gems/net-ssh-2.6.8/lib/net/ssh/connection/session.rb:164:inloop'
from /var/lib/gems/1.8/gems/rye-0.9.8/lib/rye/box.rb:717:in disconnect' from /usr/lib/ruby/1.8/timeout.rb:67:intimeout'
from /var/lib/gems/1.8/gems/rye-0.9.8/lib/rye/box.rb:716:in disconnect' from /var/lib/gems/1.8/gems/rye-0.9.8/lib/rye/box.rb:142:ininitialize'

I have checked the server side, and the auth.log contains:

Sep 17 03:26:54 XXX sshd[31216]: Timeout, client not responding.
Sep 17 03:26:54 XXX sshd[31197]: pam_unix(sshd:session): session closed for user XXX

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