Duplicity does not cache gdocs verification code

Bug #1662037 reported by Owen Jacob
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Invalid
Undecided
Unassigned

Bug Description

Duplicity 0.7.10
Python 2.7.5
PyDrive 1.3.1
CentOS 7

I am using Duplicity to perform a daily backup of a file server to a regular Google Drive account. I've written a basic script to perform the backup based on several blog posts (such as the one here: http://rockhopper.dk/linux/software/backing-up-to-google-drive-with-duplicity/) and the Duplicity man page.

The backup works perfectly and it stores 1GB encrypted files in the users Google Drive as per the below however everytime I run the backup I am always prompted for a verification code. The gdrive.cache file is never created and I have not been able to track down why this is. I've ensured the permissions are correct and duplicity can write to the directory and the script is run as root.

Many thanks in advance for your help
Owen

The script:

#!/bin/bash

cd /root/.duplicity/

export PASSPHRASE=[Passphrase]
export GOOGLE_DRIVE_SETTINGS=/root/.duplicity/gdrive

duplicity incr --full-if-older-than 3M --volsize 1024 --asynchronous-upload --exclude-device-files --exclude-other-filesystems -v8 /home gdocs://address@hidden/Backup

unset PASSPHRASE
unset GOOGLE_DRIVE_SETTINGS

The gdrive settings file:

client_config_backend: settings
client_config:
 client_id: [Client ID].apps.googleusercontent.com
 client_secret: [Client Secret]
save_credentials: True
save_credentials_backend: file
save_credentials_file: gdrive.cache
get_refresh_token: True

Revision history for this message
Symphorien Gibol (s-gibol) wrote :

I am affected by the same issue.
My gdrive settings file contains the same as above (except redacted parts of course). The cache file does not exist either, despite correct permissions.

Revision history for this message
Owen Jacob (owen.jacob) wrote :

I'm still having the same issue on this setup:

Duplicity: 0.7.16
Python: 2.7.5
PyDrive: 1.3.1
CentOS: 7.4.1708

@Symphorien can you post the versions of software you are using please?

Revision history for this message
Symphorien Gibol (s-gibol) wrote :

Debian testing (buster)
duplicity 0.7.17-1
PyDrive==1.3.1
python 2.7.15-3

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

It should if you set GOOGLE_CREDENTIALS_FILE prior to running.

Changed in duplicity:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: none → 0.7.18
Revision history for this message
Symphorien Gibol (s-gibol) wrote :

I tried:
export GOOGLE_CREDENTIALS_FILE=~/credentials.cache

but then running duplicity twice still asks for authentication twice.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Hmmm, not sure what's going on.

Please post the command line you use and the pydrive settings file you use.

Revision history for this message
Symphorien Gibol (s-gibol) wrote :

backup script:

export GNUPGHOME=~/gpg
export GOOGLE_DRIVE_SETTINGS=~/credentials
export GOOGLE_CREDENTIALS_FILE=~/credentials.cache
export TARGET='gdocs://<email address hidden>/backup'
export PASSPHRASE=redacted
duplicity \
        --verbosity warning \
        --encrypt-sign-key 039F1C39 \
        --exclude-device-files \
        --include-filelist ~/files.txt \
        --exclude-other-filesystems \
        --full-if-older-than 1M \
        --log-file /var/log/duplicity.log \
        --asynchronous-upload \
        --name vps \
        --no-print-statistics \
        / \
        $TARGET

credential file:

client_config_backend: settings
client_config:
   client_id: redacted.apps.googleusercontent.com
   client_secret: redacted
save_credentials: True
save_credentials_backend: file
save_credentials_file: /root/backup/gdrive.cache
get_refresh_token: True

the folder /root/backup exists.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

When you run the backup script, are you running as root, or sudo'ing into root?

Revision history for this message
Symphorien Gibol (s-gibol) wrote :

I use the shell given by sudo -i.
I also tried within the shell given by su, same behavior.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Duplicity is not the one that handles the authentication, so we'll have to report this to the gdata maintainers at https://github.com/google/gdata-python-client.

Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
importance: Medium → Undecided
milestone: 0.7.18 → none
status: In Progress → Invalid
Revision history for this message
Symphorien Gibol (s-gibol) wrote :

Replacing

export GOOGLE_DRIVE_SETTINGS=~/credentials

by

export GOOGLE_DRIVE_SETTINGS=$HOME/credentials

fixes the bug.

It is a bit annoying that if the file does not exist, no warning is printed.
I let the bug open as a reminder that adding such a warning would be nice, but feel free to close it if the current behavior seems correct to you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.