blacklabelops / volumerize

Docker Volume Backups Multiple Backends
https://hub.docker.com/r/blacklabelops/volumerize/
MIT License
558 stars 77 forks source link

Backup Target Backblaze in Docker Swam Mode produces error in b2backend.py #88

Closed hansjuergenjung closed 2 years ago

hansjuergenjung commented 3 years ago

A volumerize container launched via Docker-Compose was able to successfully perform backups to Backblaze. The container has now been transferred to Docker Swarm via Portainer.

When running a backup, the following error message is displayed:

bash-5.1# backup
Traceback (innermost last):
  File "/usr/bin/duplicity", line 87, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 70, in with_tempdir
    fn()
  File "/usr/lib/python3.8/site-packages/duplicity/dup_main.py", line 1529, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3.8/site-packages/duplicity/commandline.py", line 1217, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python3.8/site-packages/duplicity/commandline.py", line 1088, in set_backend
    config.backend = backend.get_backend(bend)
  File "/usr/lib/python3.8/site-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3.8/site-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3.8/site-packages/duplicity/backends/b2backend.py", line 107, in __init__
    (self.path, bucket_name, self.service.account_info.get_minimum_part_size()), log.INFO)
 AttributeError: 'InMemoryAccountInfo' object has no attribute 'get_minimum_part_size'

If the VOLUMERIZE_TARGET is set to a different target, the backup runs successfully.

- "VOLUMERIZE_TARGET=b2://00334:123123Kue4440@volume/"
changed to
- "VOLUMERIZE_TARGET=file:///backupfolder"

bash-5.1# backup
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
Last full backup is too old, forcing full backup
--------------[ Backup Statistics ]--------------
StartTime 1622755133.54 (Thu Jun  3 23:18:53 2021)
EndTime 1622755134.08 (Thu Jun  3 23:18:54 2021)
ElapsedTime 0.54 (0.54 seconds)
SourceFiles 128
SourceFileSize 1228588 (1.17 MB)
NewFiles 128
NewFileSize 1228588 (1.17 MB)
DeletedFiles 0
ChangedFiles 0
ChangedFileSize 0 (0 bytes)
ChangedDeltaSize 0 (0 bytes)
DeltaEntries 128
RawDeltaSize 1212204 (1.16 MB)
TotalDestinationSizeChange 493479 (482 KB)
Errors 0
-------------------------------------------------
blacklabelops commented 3 years ago

This link says, that its a version problem of duplicity: https://git.shivering-isles.com/container-library/duplicity/-/issues/2

You can try an older version of this image or adjust the dockerfile to duplicity 0.8.18 and build the image yourself.

hansjuergenjung commented 3 years ago

Thanks for the link to the duplicity issue. I have found a simple workaround for this problem.

Save the current code b2backend.py (commit hash 718ccc90) from https://gitlab.com/duplicity/duplicity/-/blob/master/duplicity/backends/b2backend.py as config.

Pass the config when starting the container. Target: /usr/lib/python3.8/site-packages/duplicity/backends/b2backend.py

Stack / yml

...
    configs:
      - source: b2backend.py
        target: /usr/lib/python3.8/site-packages/duplicity/backends/b2backend.py
...
configs:
  b2backend.py:
    external: true
blacklabelops commented 2 years ago

Should be solved now with the inclusion of the sdk.