apt-transport-s3 fails with TypeError: decoding str is not supported

Bug #1964558 reported by Dmitriy Khodos
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt-transport-s3 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu Release
--------------
Description: Ubuntu Jammy Jellyfish (development branch)
Release: 22.04

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

Expected Result
---------------
"apt-get update" correctly updates the package database from an S3-based APT repository.

Actual Result
-------------
When using the EC2 instance's IAM role credentials, "apt-get update" fails as follows.

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
    str(self.credentials_metadata, 'utf-8'),
TypeError: decoding str is not supported
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
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>/private/ubuntu/dists/jammy/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt-transport-s3 (Ubuntu):
status: New → Confirmed
Revision history for this message
Lukasz Jendrysik (ljendrysik) wrote (last edit ):

Updating apt-transport-s3 to 2.1.0 should resolve the issue, see upstream: https://github.com/MayaraCloud/apt-transport-s3/releases/tag/v2.1.0

Update: looks it's only merged to development branch and not 2.1.0.
https://github.com/MayaraCloud/apt-transport-s3/pull/60#issuecomment-1165243946

Revision history for this message
Peycho Dimitrov (peycho) wrote :

apt-transport-s3 - v2.1.0-1

Ubuntu 22.04 server.

sudo apt update
Traceback (most recent call last):
  File "/usr/lib/apt/methods/s3", line 639, in <module>
    method = S3_method(config)
  File "/usr/lib/apt/methods/s3", line 426, in __init__
    self.iam.get_credentials()
  File "/usr/lib/apt/methods/s3", line 234, in get_credentials
    str(self.iamrole, 'utf-8')))

The patch in the pull request works.

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.