Cloud-init cant handle swap size 'auto'

Bug #1885586 reported by Eduardo on 2020-06-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)

Bug Description

When using 'auto' as the swap size, cloud-init logs this:

2020-06-29 14:39:17,053 -[WARNING]: failed to setup swap: unsupported operand type(s) for /: 'str' and 'int'

# Define a swapfile
    filename: /swapfile.img
    size: "auto"
    maxsize: 2147483648

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: cloud-init 20.1-10-g71af48df-0ubuntu5 [modified: usr/lib/python3/dist-packages/cloudinit/config/]
ProcVersionSignature: Ubuntu 5.4.0-39.43-generic 5.4.41
Uname: Linux 5.4.0-39-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: pass
Date: Mon Jun 29 15:05:45 2020
InstallationDate: Installed on 2020-06-29 (0 days ago)
InstallationMedia: Ubuntu-Server 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
logs.tgz: Error: [Errno 2] No such file or directory: '/tmp/cloud-init-logs.tgz' [modified] 2020-06-29T15:02:38.663779
user_data.txt: Error: [Errno 13] Permission denied: '/var/lib/cloud/instance/user-data.txt'

Eduardo (egonzalf) wrote :
Dan Watkins (oddbloke) wrote :

Hi Eduardo,

Thanks for using cloud-init, and for the bug report! We believe that this bug is fixed in the version of cloud-init that is currently going through the SRU process to be backported to focal. (Specifically, the fix was proposed in

This version should be available in the Ubuntu archive over the next week, and will appear in Ubuntu cloud images shortly thereafter.



Changed in cloud-init (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers