curtin make_dname doesn't handle non-zero blkid return code

Bug #1487533 reported by Andres Rodriguez
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
Fix Released
Critical
Unassigned

Bug Description

MAAS install log:

W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
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': ProcessExecutionError - Unexpected error while running command.
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@node01:/curtin/configs$ sudo blkid -o export /dev/vda || echo $?
2

ubuntu@node01:/curtin/configs$ sudo mkfs /dev/vda
mke2fs 1.42.9 (4-Feb-2014)
[...]

ubuntu@node01:/curtin/configs$ sudo blkid -o export /dev/vda && echo $?
UUID=7ccf0859-0e94-427c-940f-b28cb6137e34
TYPE=ext2
0

ubuntu@node01:/curtin/configs$ sudo wipefs -a /dev/vda
2 bytes were erased at offset 0x438 (ext2)
they were: 53 ef

ubuntu@node01:/curtin/configs$ sudo blkid -o export /dev/vda && echo $?

ubuntu@node01:/curtin/configs$ sudo blkid -o export /dev/vda || echo $?
2

Related branches

Revision history for this message
Ryan Harper (raharper) wrote :

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:
  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-1a4c-4b62-a666-286902f7ffd8, wipe: superblock}
  - {fstype: ext4, id: vda-part1_format, label: root, type: format, uuid: 22c010b5-bcfd-40cc-9f96-cefa1bcf7c64,
    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.

Changed in curtin:
status: New → Confirmed
summary: - Command: ['blkid', '-o', 'export', '/dev/vda']
+ curtin make_dname doesn't handle non-zero blkid return code
Revision history for this message
Ryan Harper (raharper) wrote :

As a workaround, avoiding passing in the 'name' key in the disk or partition dict will prevent curtin from attempting to generate a dname for that entry.

Changed in curtin:
importance: Undecided → Critical
status: Confirmed → Triaged
Changed in curtin:
status: Triaged → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.