curtin make_dname doesn't handle non-zero blkid return code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
Critical
|
Unassigned |
Bug Description
MAAS install log:
W: mdadm: /etc/mdadm/
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
mdadm: No arrays found in config file or automatically
An error occured handling 'vda': ProcessExecutio
Command: ['blkid', '-o', 'export', '/dev/vda']
Exit code: 2
Reason: -
Stdout: ''
Stderr: ''
Unexpected error while running command.
Command: ['blkid', '-o', 'export', '/dev/vda']
Exit code: 2
Reason: -
Stdout: ''
Stderr: ''
Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'block-meta', 'custom']
Exit code: 3
Reason: -
Looking at it:
ubuntu@
2
ubuntu@
mke2fs 1.42.9 (4-Feb-2014)
[...]
ubuntu@
UUID=7ccf0859-
TYPE=ext2
0
ubuntu@
2 bytes were erased at offset 0x438 (ext2)
they were: 53 ef
ubuntu@
ubuntu@
2
Related branches
- Blake Rouse (community): Approve
- Scott Moser: Pending requested
-
Diff: 26 lines (+9/-1)1 file modifiedcurtin/commands/block_meta.py (+9/-1)
Changed in curtin: | |
importance: | Undecided → Critical |
status: | Confirmed → Triaged |
Changed in curtin: | |
status: | Triaged → Fix Committed |
I can reproduce this in a trusty 14.04.03 cloudimg, and a spare, empty disk in the VM.
The relevant curtin code is triggered from the passed storage config:
partitioning_ commands: 1a4c-4b62- a666-286902f7ff d8, wipe: superblock} bcfd-40cc- 9f96-cefa1bcf7c 64,
builtin: [curtin, block-meta, custom]
storage:
config:
- {grub_device: true, id: vda, name: vda, path: /dev/vda, ptable: msdos, type: disk,
wipe: superblock}
- {id: vdb, name: vdb, path: /dev/vdb, type: disk, wipe: superblock}
- {device: vda, id: vda-part1, name: vda-part1, number: 1, offset: 2097152B, size: 17176723456B,
type: partition, uuid: d9a3d0e8-
- {fstype: ext4, id: vda-part1_format, label: root, type: format, uuid: 22c010b5-
volume: vda-part1}
- {device: vda-part1_format, id: vda-part1_mount, path: /, type: mount}
version: 1
The 'name' field here triggered the creation of /dev/disk/ by-name/ vdb -> /dev/vdb
The make_dname code invokes blkid -o export /dev/vdb , which doesn't *yet* have a filesystem on it, nor a PARTUUID that might be present in a GPT partition table.
The fix for handling the non-zero exit is a trivial fix. More thought needs to go into hanlding how to setup a udev rule for by-name for disks without a PARTUUID.