Forum archive
TKLBAM fails with gdocs backend
Basically, TKLBAM fails with the gdocs backend but I've almost managed to get it working by installing new versions of duplicity and python-gdata. But not quite... read below for where where I'm at. Please note that there might be some discrepancies in my description as my terminal scroll buffer filled up and as I've tried quite a few things and am going on memory I had to retry things which may have yielded different results to the first attempt given all that went on before!
So... in the beginning I downloaded my profile for my turnkey-wordpress-13.0-wheezy-amd64 virtual appliance (running in VirtualBox) from the HUB using
tklbam-init API-KEY
Backed up the downloaded profile from the registry, and copied the backup for possible subsequent modification:
cp -pR /var/lib/tklbam/profile /etc/tklbam/hub-profile
Then created a custom profile using the hub-profile dirindex.conf:
tklbam-internal create-profile /etc/tklbam/nonhub-profile /etc/tklbam/hub-profile/dirindex.conf
Then disconnected from the HUB (--solo) and loaded my custom profile (--force-profile) just created into the registry (/var/lib/tklbam):
tklbam-init --solo --force-profile=/etc/tklbam/nonhub-profile
So far so good, but then when I go to make a backup:
tklbam-backup --address gdocs://USER:PASS@gmail.com/path/to/backup
Got this error
BackendException: Google Docs backend requires Google Data APIs Python Client Library (see http://code.google.com/p/gdata-python-client/).
and realised I needed python-gdata from the eror message and reading this so that Duplicity can support the gdocs storage backend. Found it already package for Debian so installed it:
apt-get update && apt-get install python-gdata
That fixed this error but then got a new error "'DocsClient' object has no attribute 'get_everything'":
# export PASSPHRASE=$(cat /var/lib/tklbam/secret)
# duplicity --verbosity=5 --archive-dir=/var/cache/duplicity cleanup --force gdocs://USER:PASS@gmail.com/path/to/backup
Backend error detail: Traceback (most recent call last):
[...]
File "/usr/lib/tklbam/deps/lib/python2.7/dist-packages/duplicity/backends/gdocsbackend.py", line 182, in __handle_error
raise BackendException(message)
BackendException: Error while fetching remote entries: 'DocsClient' object has no attribute 'get_everything'.
After some googling found someone who had a similar error so I thought that I needed a newer version of python-gdata. I tried these versions of the package
python-gdata_2.0.18+dfsg-1_all.deb python-gdata_2.0.18+dfsg1-2_all.deb
but neither of them fixed the problem.
So after further research here found out that duplicity probably also needed updating. Found out that wheezy-backports had this new version of duplicity backported so added
deb http://ftp.uk.debian.org/debian wheezy-backports main
to my apt sources (/etc/apt/sources.list.d/sources.list) and then installed it (forcing the release to the wheezy-backports release with the "-t" option otherwise it won't be installed automatically):
apt-get update && apt-get install -t wheezy-backports duplicity
This still didn't fix the error but I then realised that tklbam runs its own version of duplicity!
/usr/lib/tklbam/deps/bin/duplicity
rather than the vanilla one
/usr/bin/duplicity
So backed up /usr/lib/tklbam/deps/bin/duplicity:
mv /usr/lib/tklbam/deps/bin/duplicity /usr/lib/tklbam/deps/bin/duplicity.v.0.6.18
and replaced it with a script which calls through to the backported duplicity (version 0.6.24-1~bpo70+1 in /usr/bin/duplicity) by creating a shelll script called duplicity in this directory (/usr/lib/tklbam/deps/bin) and making it executable:
cat >| /usr/lib/tklbam/deps/bin/duplicity <<'END' #!/bin/sh export PYTHONPATH="" /usr/bin/duplicity $@ END chmod +x /usr/lib/tklbam/deps/bin/duplicity
And voila tklbam-backup now worked!
Although, initially I did have a different error:
ImportError: cannot import name progress
since I didn't set
export PYTHONPATH=""
which meant that python wasn't using the vanilla libraries but probalby those in /usr/lib/tklbam/deps/lib/python2.7.
In the longer term could a new version of tklbam be released either including or using the vanilla backported duplicity?
Thanks in advance!