Public bug reported:

Ubuntu Release Info:
-----
Description:    Ubuntu 20.04.1 LTS
Release:        20.04

Package Version
-----
Package: apt-transport-s3
Version: 2.0.0-1


Expected behavior
------
apt-get update runs successfully when using an S3 bucket as a source


Actual behavior
------
Receive a "TypeError: Cannot mix str and non-str arguments" and apt-get fails

Details
-------
- Our AWS instance is using an iam role for access to an S3 bucket.
- I've verified that I can list the bucket contents
- I've verified that I can copy the file to the instance via 'aws s3 cp'


Running "apt-get update" results in the following error

Traceback (most recent call last):
  File "/usr/lib/apt/methods/s3", line 597, in <module>
    method = S3_method(config)
  File "/usr/lib/apt/methods/s3", line 384, in __init__
    self.iam.get_credentials()
  File "/usr/lib/apt/methods/s3", line 191, in get_credentials
    data = self.__request_json(urllib.parse.urljoin(self.credentials_metadata,
  File "/usr/lib/python3.8/urllib/parse.py", line 512, in urljoin
    base, url, _coerce_result = _coerce_args(base, url)
  File "/usr/lib/python3.8/urllib/parse.py", line 121, in _coerce_args
    raise TypeError("Cannot mix str and non-str arguments")
TypeError: Cannot mix str and non-str arguments
Reading package lists... Done
E: Method s3 has died unexpectedly!
E: Sub-process s3 returned an error code (1)
E: Method /usr/lib/apt/methods/s3 did not start correctly
E: Failed to fetch s3://<bucket_name>/dists/focal/InRelease  
E: Some index files failed to download. They have been ignored, or old ones 
used instead.


We were able to get this to work by adding the following to 
/usr/lib/apt/methods/s3 at line 190:

     self.iamrole = str(self.iamrole,'utf-8')

** Affects: apt-transport-s3 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1897607

Title:
  Receiving  TypeError("Cannot mix str and non-str arguments")

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-transport-s3/+bug/1897607/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to