pydrive backend crashes

Bug #1723890 reported by Kilian Lackhove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

i am using duplicity 0.7.07.1-r0 with pydrive backend and google drive on alpne 3.5 (inside a docker container).
There seems to be a bug in the error handling:

code = _get_code_from_exception(self.backend, operation, e)
File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 348, in _get_code_from_exception
return backend._error_code(operation, e) or log.ErrorCode.backend_error
File "/usr/lib/python2.7/site-packages/duplicity/backends/pydrivebackend.py", line 188, in _error_code
http_status = error.args[0].resp.status

Revision history for this message
Kilian Lackhove (crabman) wrote :

this patch fixes it for me on 0.7.07.1:

--- pydrivebackend.py 2017-08-06 18:25:09.000000000 +0200
+++ pydrivebackend.py 2017-10-29 16:28:54.520091304 +0100
@@ -211,11 +211,7 @@
         if isinstance(error, FileNotUploadedError):
             return log.ErrorCode.backend_not_found
         elif isinstance(error, ApiRequestError):
- http_status = error.args[0].resp.status
- if http_status == 404:
- return log.ErrorCode.backend_not_found
- elif http_status == 403:
- return log.ErrorCode.backend_permission_denied
+ return log.ErrorCode.backend_permission_denied
         return log.ErrorCode.backend_error

 duplicity.backend.register_backend('pydrive', PyDriveBackend)

i have no idea how bzr and launchpad work and don't have the time to figure it out. Is there a git mirror somehwere? If not, feel free to commit this one for me

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

Please upgrade to the current version of duplicity. This will assure that any bugs fixed since your release are available and will fix your issue.

There are three options:

* Release tarball Install - https://launchpad.net/duplicity/+download
* Daily duplicity builds - https://launchpad.net/~duplicity-team/+archive/ubuntu/daily
* Stable duplicity builds - https://launchpad.net/~duplicity-team/+archive/ubuntu/ppa

NOTE: UNinstall duplicity first if it was installed via the distribution repository. For Ubuntu, that would be "sudo apt-get purge duplicity".

Changed in duplicity:
status: New → Invalid
Revision history for this message
Kilian Lackhove (crabman) wrote :

the problem is present in all duplicity versions since the _error_code method hasnt changed.

Changed in duplicity:
status: Invalid → New
Revision history for this message
Kilian Lackhove (crabman) wrote :

Besides, i dont think it ever worked. In files.py of pydrive we have:

class ApiRequestError(IOError):
  """Error while making any API requests."""
class FileNotDownloadableError(RuntimeError):
  """Error trying to download file that is not

and this has been this way sine the pydrives "initial import" commit four years ago. So ApiRequestError.args[0] has always been a string.

PS: I took the liberty to reopen this bug

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

Thanks for following up and setting me straight on this. I completely read the patch backwards.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.7.15
status: New → Fix Committed
Revision history for this message
Kilian Lackhove (crabman) wrote :

Cool, thanks for taking care of this so quickly!

Changed in duplicity:
status: Fix Committed → Fix Released
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.