How do I disable SSH timeouts?

Status
Not open for further replies.

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
I've been trying to back up my data off freenas to a linux box. So on the linux box I use rsnapshot, which leverages rsync to create backups. My problem is that after a lengthy period of time I keep getting this reported from my client side:

Code:
packet_write_wait: Connection to 10.0.0.220 port 22: Broken pipe
rsync: connection unexpectedly closed (1224956372 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [receiver=3.1.2]
rsync: connection unexpectedly closed (395016 bytes received so far) [generator]
rsync error: unexplained error (code 255) at io.c(235) [generator=3.1.2]
ERROR: /usr/bin/rsync returned 255 while processing backup@10.0.0.220:/mnt/Storage/data/
/usr/bin/logger -p user.err -t rsnapshot[2308] /usr/bin/rsnapshot -c \
	freenas_rsnapshot.conf daily: ERROR: /usr/bin/rsync returned 255 while \
	processing backup@10.0.0.220:/mnt/Storage/data/
touch /mnt/FreeNAS_Backup/daily.0/
rm -f /home/backup/scripts/rsnapshot.pid
/usr/bin/logger -p user.err -t rsnapshot[2308] /usr/bin/rsnapshot -c \
	freenas_rsnapshot.conf daily: ERROR: /usr/bin/rsnapshot -c \
	freenas_rsnapshot.conf daily: completed, but with some errors



I believe this error is on the server side. On my client side I have this inside of /etc/ssh/ssh_conf:

Code:
	ServerAliveInterval 60
	ServerAliveCountMax 10


On FreeNAS, I'm not sure where the correct files are, or if toggling SSH from the GUI actually restarts the service to re-read the config file or not. On FreeNAS, I've edited
Code:
/etc/ssh/sshd_config


and I've set this:
Code:
ClientAliveInterval 60
ClientAliveCountMax 10


Am I mixing up the ClientAliveInterval and ClientAliveCountMax with the server versions? Like should the server alive ones be on FreeNAS and the client alive ones be on the client side?

So I'm thinking I've either mixed those up, or toggling the SSH service on FreeNAS doesn't actually re-read the config file, or the SSH config file for freeNAS is in some other weird location. What do you think?
 
Joined
Dec 29, 2014
Messages
1,135
I don't think it is SSH timing out your connections. Those parameters are for keepalives, not for connection termination. My guess would be that there is a firewall involved somewhere that has a maximum time that a TCP connection can stay open, even with active traffic.
 

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
Nah no firewall. Debian box on my LAN connecting through gigabit switch to FreeNAS box.
 
Joined
Dec 29, 2014
Messages
1,135

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
I did come across that post already, however I think an important take-away is in that post is says "(code 12)" where as in my disconnection I get "(code 255)"

I didn't find this:
https://lxadm.com/Rsync_exit_codes

Which states:

Code:
If you're seeing exit code 255 after running rsync, it can mean rsync just passed exit code from a command it used to connect - typically SSH.


What I'm going to do is just start an SSH session from the client to the server and see if it ever times out, and use -vvv options.
 
Joined
Dec 29, 2014
Messages
1,135
rsync error: error in rsync protocol data stream (code 12)

255 may be the exit code you are getting from the rsynch process on your side, but the above message was listed in your output. That is why that post sounded more relevant to me.
 

ninjai

Explorer
Joined
Apr 6, 2015
Messages
98
Right, I didn't notice that.

You can also get this error if you specify a remote path that doesn't exist.

I am beginning to wonder if there's some data that's being moved around in my jails while I'm running rsync, so when rsync goes to copy that file or directory, it's no longer there. I'm copying everything off my NAS, jails and all. so I do the full jail paths in my rsync job. Any data in there that's dynamic or moves around?

Edit:

For example...
Code:
ERROR: Warning! Recursion error in native_cp_al("/mnt/FreeNAS_Backup/daily.0/backups/mnt/Storage/Jails/dns/proc/3680", "/mnt/FreeNAS_Backup/daily.1/backups/mnt/Storage/Jails/dns/proc/3680")



I'm willing to bet this is the cause and I should be excluding these directories.
 
Status
Not open for further replies.
Top