canonical / canonical/cloud-init

Warnings in logs for Ubuntu minimal images

Open
#4,968 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report
On Azure integrations tests with a minimal Ubuntu image, verify_clean_log failed due to partitioning errors. The problem seems to be that sgdisk is not installed by default and is not an explicit dependency of cloud-init.

## Steps to reproduce the problem
Create an Azure minimal image with cloud-init using the cc_disk_setup config
Search logs for errors

## Environment details
- Cloud-init version: 99.daily-202402231934-89ebcc39~ubuntu23.10.1,
- Operating System Distribution: Ubuntu
- Cloud provider, platform or installer type: Azure minimal image,

## cloud-init logs
```
'2024-02-24 06:21:12,117 - util.py[WARNING]: Failed partitioning operation\n'
'Error running partition command on /dev/sda\n'
"'NoneType' object has no attribute 'encode'\n"
'2024-02-24 06:21:12,121 - util.py[DEBUG]: Failed partitioning operation\n'
'Error running partition command on /dev/sda\n'
"'NoneType' object has no attribute 'encode'\n"
'Traceback (most recent call last):\n'
' File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", '
'line 491, in check_partition_gpt_layout\n'
' out, _err = subp.subp(prt_cmd, update_env=LANG_C_ENV)\n'
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
' File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 244, in '
'subp\n'
' bytes_args = [\n'
' ^\n'
' File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 245, in '
'\n'
' x if isinstance(x, bytes) else x.encode("utf-8") for x in args\n'
' ^^^^^^^^\n'
"AttributeError: 'NoneType' object has no attribute 'encode'\n"
'\n'
'The above exception was the direct cause of the following exception:\n'
'\n'
'Traceback (most recent call last):\n'
' File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", '
'line 136, in handle\n'
' util.log_time(\n'
' File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2840, in '
'log_time\n'
' ret = func(*args, **kwargs)\n'
' ^^^^^^^^^^^^^^^^^^^^^\n'
' File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", '
'line 829, in mkpart\n'
' if check_partition_layout(table_type, device, layout):\n'
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
' File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", '
'line 538, in check_partition_layout\n'
' found_layout = check_partition_gpt_layout(device, layout)\n'
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
' File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", '
'line 493, in check_partition_gpt_layout\n'
' raise RuntimeError(\n'
'RuntimeError: Error running partition command on /dev/sda\n'
"'NoneType' object has no attribute 'encode'\n"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.