Timeout on sftp command 'ls -1'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
We use Duplicity to backup our Linux fileserver, with incremental backups every hour from 9 am to 7 pm and a full backup once a week. Recently, these backups have been started to fail while trying to get the existing file list on the target server via SFTP. At first, they mostly succeeded after a random amount of tries, now they fail at almost all times:
$ duplicity incr --asynchronous-
Running 'sftp backup@
sftp command: 'mkdir /srv/backups/
sftp command: 'cd /srv/backups/
sftp command: 'ls -1'
Timeout waiting for response
Running 'sftp backup@
Running 'sftp backup@
[ ... several more attempts ... ]
Running 'sftp backup@
sftp command: 'mkdir /srv/backups/
sftp command: 'cd /srv/backups/
sftp command: 'ls -1'
Timeout waiting for response
Running 'sftp backup@
Giving up trying to execute 'sftp backup@
Using temporary directory /tmp/duplicity-
Traceback (most recent call last):
File "/usr/bin/
with_
File "/usr/bin/
fn()
File "/usr/bin/
globals.
File "/usr/lib/
backend_
File "/usr/lib/
l = self.run_
File "/usr/lib/
raise BackendExceptio
BackendException: Error running 'sftp backup@
It seems that the initial 'ls -1' issued via SFTP is already taking too long, having to download a list of over 17.000 files. Running with --verbosity=9 showed that sftp 'ls -1' was indeed returning a list of files, but stopped transferring it right in the middle of some filename, presumably because it ran into the timeout.
What I have already tried to remedy this:
1. --ssh-options=
2. Deleting some of the older backups chains and raising volsize to 50 MB helped for a short time, but the timeouts soon started to crop up again.
3. Setting the global timeout value in globals.py to "timeout = 60", up from the default of 30.
No. 3 has actually been working now for the last couple of days, but is rather a hack/workaround rather than a real solution. Perhaps the best thing to do would be to add an --sftp-timeout or --timeout option to override the global setting? I would happily provide a patch if the developers agree to this solution.
Duplicity version: 0.5.06 (the same timeout code seems to be present in 0.6.13 as well)
Python version: 2.4.4
OS Distro and version: Debian GNU/Linux 4.0 (etch)
Target filesystem: Linux
I can reproduce the problem with --verbosity=9 if requested.
Changed in duplicity: | |
assignee: | Kenneth Loafman (kenneth-loafman) → nobody |
status: | In Progress → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
You just found a bug in the documentation, and in the code. There is a --timeout option, but it does not actually set anything appropriate. Plus, it seems to be missing in the man page. Will get it fixed. Thanks!