Recently I have been testing out Duplicity to set up backups for my personal server hosting this site. Duplicity is quite complex when you first start using it, but fortunately there are various tools and projects to help set it up. I have been using the excellent Stouts Backup ansible role, which installs duplicity along with Duply.
Tonight I noticed that the backups on my test Vagrant box, which had been working perfectly before, suddenly stopped working.
I was seeing the following error:
BackendException: No connection to backend
I found a blog post describing a similar problem, which suggested setting the AWS signature to version 4 in the duply configuration file.
Unfortunately, this didn’t help, but after some experimenting I noticed that s3cmd had also stopped working…
[root@dev vagrant]# s3cmd ls
ERROR: S3 error: 403 (RequestTimeTooSkewed): The difference between the request time and the current time is too large.
I then checked the date on my VagrantBox and noticed it was 2 days in the past…
[root@dev vagrant]# date
Tue 10 Nov 01:25:12 EST 2015
So I installed NTP using another Ansible role, and forced an update of the time.
S3cmd started working…
[root@dev vagrant]# s3cmd ls
2015-11-08 23:38 s3://something-backups
2008-12-19 18:47 s3://something-test
As did duply and duplicity…
[root@dev vagrant]# /usr/local/bin/duply /etc/duply/mysql backup
Start duply v1.9.1, time is 2015-11-12 21:35:28.
Using profile '/etc/duply/mysql'.
Using installed duplicity version 0.6.24, python 2.7.5, gpg 2.0.22 (Home: ~/.gnupg), awk 'GNU Awk 4.0.2', bash '4.2.46(1)-release (x86_64-redhat-linux-gnu)'.
Signing disabled. Not GPG_KEY entries in config.
Checking TEMP_DIR '/tmp' is a folder (OK)
Checking TEMP_DIR '/tmp' is writable (OK)
TODO: reimplent tmp space check
Test - Encryption with passphrase (OK)
Test - Decryption with passphrase (OK)
Test - Compare (OK)
Cleanup - Delete '/tmp/duply.27408.1447364128_*'(OK)
--- Start running command PRE at 21:35:28.678 ---
Running '/etc/duply/mysql/pre' - OK
--- Finished state OK at 21:35:28.955 - Runtime 00:00:00.276 ---
--- Start running command BKP at 21:35:28.969 ---
Reading globbing filelist /etc/duply/mysql/exclude
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Mon Nov 9 20:18:33 2015
--------------[ Backup Statistics ]--------------
StartTime 1447364129.99 (Thu Nov 12 21:35:29 2015)
EndTime 1447364130.11 (Thu Nov 12 21:35:30 2015)
ElapsedTime 0.13 (0.13 seconds)
SourceFiles 1
SourceFileSize 777926 (760 KB)
NewFiles 0
NewFileSize 0 (0 bytes)
DeletedFiles 0
ChangedFiles 1
ChangedFileSize 777926 (760 KB)
ChangedDeltaSize 0 (0 bytes)
DeltaEntries 1
RawDeltaSize 211 (211 bytes)
TotalDestinationSizeChange 315 (315 bytes)
Errors 0
-------------------------------------------------
--- Finished state OK at 21:35:30.834 - Runtime 00:00:01.864 ---
--- Start running command POST at 21:35:30.852 ---
Running '/etc/duply/mysql/post' - OK
--- Finished state OK at 21:35:30.889 - Runtime 00:00:00.036 ---
Voila. Problem solved!