Fails "silently" trying to restore an Amazon S3 backup without clock in sync
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
New
|
Undecided
|
Unassigned |
Bug Description
Hi!
I just find out that trying to restore a backup from Amazon S3 in a PC that doesn't have the clock in sync, fails. The error it is not very descriptive of the situation. The error is the following:
(ommited the S3 bucket)
$ duplicity restore --s3-use-new-style -v9 --num-retries 5 's3+http://<my-bucket>/<path>' retore
Using archive dir: /home/rata/
Using backup name: ca450b9de1f3f3a
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Main action: restore
=======
duplicity 0.6.18 (February 29, 2012)
Args: /usr/bin/duplicity restore --s3-use-new-style -v9 --num-retries 5 s3+http://<my-bucket>/<path> retore
Linux lindsay 3.2.0-2-amd64 #1 SMP Sun Apr 15 16:47:38 UTC 2012 x86_64
/usr/bin/python 2.7.2+ (default, Nov 30 2011, 19:22:03)
[GCC 4.6.2]
=======
Using temporary directory /tmp/duplicity-
Registering (mkstemp) temporary file /tmp/duplicity-
Temp has 75120640 available, backup will use approx 34078720.
Local and Remote metadata are synchronized, no sync needed.
0 files exist on backend
0 files exist in cache
Extracting backup chains from list of files: []
Last full backup date: none
Collection Status
-----------------
Connecting with backend: BotoBackend
Archive dir: /home/rata/
Found 0 secondary backup chains.
No backup chains with active signatures found
No orphaned or incomplete backup sets found.
PASSPHRASE variable not set, asking user.
GnuPG passphrase:
Removing still remembered temporary file /tmp/duplicity-
Traceback (most recent call last):
File "/usr/bin/
with_
File "/usr/bin/
fn()
File "/usr/bin/
restore(
File "/usr/bin/
restore_
File "/usr/bin/
backup_chain = col_stats.
File "/usr/lib/
raise CollectionsErro
CollectionsError: No backup chains found
When running collection-status, it also shows a not very clear error:
$ duplicity collection-status --s3-use-new-style -v9 --num-retries 5 's3+http://<my-bucket>/<path>'
Using archive dir: /home/rata/
Using backup name: ca450b9de1f3f3a
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Import of duplicity.
Main action: collection-status
=======
duplicity 0.6.18 (February 29, 2012)
Args: /usr/bin/duplicity collection-status --s3-use-new-style -v9 --num-retries 5 s3+http://<my-bucket>/<path>
Linux lindsay 3.2.0-2-amd64 #1 SMP Sun Apr 15 16:47:38 UTC 2012 x86_64
/usr/bin/python 2.7.2+ (default, Nov 30 2011, 19:22:03)
[GCC 4.6.2]
=======
Local and Remote metadata are synchronized, no sync needed.
0 files exist on backend
0 files exist in cache
Extracting backup chains from list of files: []
Last full backup date: none
Collection Status
-----------------
Connecting with backend: BotoBackend
Archive dir: /home/rata/
Found 0 secondary backup chains.
No backup chains with active signatures found
No orphaned or incomplete backup sets found.
Collection Status
-----------------
Connecting with backend: BotoBackend
Archive dir: /home/rata/
Found 0 secondary backup chains.
No backup chains with active signatures found
No orphaned or incomplete backup sets found.
Using temporary directory /tmp/duplicity-
It really took me a while to realize what was happening here. I realized when trying to use this PC (with clock not in sync) to backup a new file and test a basic backup on Amazon S3 of an unimportant file that it trow this error (with verbose):
$ duplicity --s3-use-new-style -v9 --num-retries 5 bkp-dir/ 's3+http://<my-bucket>/test1'
(quoted the relevant part only, the output its really big. I can attach it if you need it)
AsyncScheduler: running task synchronously (asynchronicity disabled)
Failed to create bucket (attempt #1) '<my-bucket>' failed (reason: S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error>
Also, I can consistently reproduce this: if my clock is not in sync, then this error is shown, if I put it in sync, it works okay.
Btw, to change the clock I used: "date -s <some not in sync date>; hwclock -s". And to get back in sync: "ntpdate-debian" (that is a debian specific command, but ubuntu I think it has it and running ntpdate with appropriate parameters will do the trick too)
It would be really nice if the error shown when trying to restore a backup is nicer and properly tells whats is wrong. It really took me a while to understand the cause =) Perhaps even showing this very same (not nice, but clear) error that is shown when you try to create a backup. But really the trace and "No backup chains found" doesn't say anything to me :S
Please let me know if you need more information or I can help you to test some patch
Thanks a lot,
Rodrigo
Ping ?