MULTI BACKEND : startswith first arg must be bytes or a tuple of bytes, not str

Bug #1857818 reported by Thierry B.
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Duplicity 0.8.0.8 (official release manually built)
python -V : Python 3.7.5 (manually built)
Kernel: 4.19.0-0.bpo.6-amd64
Desktop: Openbox 3.6.1
Distro: Devuan GNU/Linux 2.1 (ascii) x86_64

I use the MULTI backend to use "cold" "OVH Public Cloud Archive", following this guide: https://docs.ovh.com/gb/en/storage/pca/duplicity/#multibackend-setup

I setup a test "hot" container (legacy Swift Openstack backend) named "thierrybo-desk_tests_hot" and a "cold" container using PCA backend named "thierrybo-desk_tests_cold"

My first run :

duplicity --verbosity debug --asynchronous-upload --file-prefix-manifest 'hot_' --file-prefix-signature 'hot_' --file-prefix-archive 'cold_' ~/PDF/ "multi://$HOME/.config/duplicity/config_v3_ovh_pca-thierrybo-desk_tests.json?mode=mirror&onfail=abort"

the key error message (see the attached file for full log):

  File "/home/thierrybo/.local/lib/python3.7/site-packages/duplicity/backends/multibackend.py", line 220, in <listcomp>
    matching_prefixes = [k for k in list(self.__affinities.keys()) if filename.startswith(k)]
 TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Here is my "config_v3_ovh_pca-thierrybo-desk_tests.json" file (obfuscated) :

[
    {
        "description": "Cold storage",
        "url": "pca://thierrybo-desk_tests",
        "env": [
            {
                "name": "PCA_AUTHURL",
                "value": "https://auth.cloud.ovh.net/v3"
            },
             {
                 "name": "PCA_AUTHVERSION",
                 "value": "3"
             },
             {
                 "name": "PCA_PROJECT_DOMAIN_NAME",
                 "value": "Default"
             },
             {
                 "name": "PCA_USER_DOMAIN_NAME",
                 "value": "Default"
             },
             {
                 "name": "PCA_TENANTID",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "PCA_PROJECTID",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "PCA_USERNAME",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "PCA_PASSWORD",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "PCA_REGIONNAME",
                 "value": "GRA"
             }
         ],
         "prefixes": ["cold_"]
     },
     {
         "description": "Hot storage",
         "url": "swift://thierrybo-desk_tests_hot",
         "env": [
             {
                 "name": "SWIFT_AUTHURL",
                 "value": "https://auth.cloud.ovh.net/v3"
             },
             {
                 "name": "SWIFT_AUTHVERSION",
                 "value": "3"
             },
             {
                 "name": "SWIFT_PROJECT_DOMAIN_NAME",
                 "value": "Default"
             },
             {
                 "name": "SWIFT_USER_DOMAIN_NAME",
                 "value": "Default"
             },
             {
                 "name": "SWIFT_TENANTID",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "SWIFT_PROJECTID",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "SWIFT_USERNAME",
                 "value": "XXXXXXXXXXXX"
             },
             {
                 "name": "SWIFT_PASSWORD",
                 "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             },
             {
                 "name": "SWIFT_REGIONNAME",
                 "value": "GRA"
             }
         ],
         "prefixes": ["hot_"]
     }
 ]

Thierry B. (thierrybo2)
summary: - MULTI BACKENT : startswith first arg must be bytes or a tuple of bytes,
+ MULTI BACKEND : startswith first arg must be bytes or a tuple of bytes,
not str
Revision history for this message
Raphaël Droz (raphael-droz) wrote :

Same here. Similar configuration. duplicity 0.8.11

```
[...]
         Restarting backup at volume 12.
Attempt 1 failed. TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Attempt 2 failed. TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Attempt 3 failed. TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Attempt 4 failed. TypeError: startswith first arg must be bytes or a tuple of bytes, not str
Giving up after 5 attempts. TypeError: startswith first arg must be bytes or a tuple of bytes, not str
```

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

I'd like a log file, please. This is going big and I only need a portion. Please run
with -v9, redirect to a log.txt file, then run:

$ head -n 200 < log > log.head
$ tail -n 200 < log > log.tail

Attach log.head and log.tail to this bug report (don't copy/paste).

...Thanks

Changed in duplicity:
status: New → Incomplete
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Missed the log file. It's fixed now.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.11
status: Incomplete → Fix Committed
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.