Autoinstall crash when using tmpfs mounts : mount entry without 'device' missing: ['fstype']

Bug #2041725 reported by Florian Bobin
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
curtin
New
Undecided
Unassigned

Bug Description

Hello !

I use the auto-install feature to automatically install my homelab server based on Ubuntu 22.04.3 LTS. However, today the autoinstaller crashed when curtin tried to add a standalone "tmpfs" mount in the target installation fstab, here the stack trace :

 start: cmd-install/stage-partitioning/builtin/cmd-block-meta: configuring mount: tmpfs-tmp-mount
 An error occured handling 'tmpfs-tmp-mount': ValueError - mount entry without 'device' missing: ['fstype']. ({'path': '/tmp', 'options': 'mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m', 'spec': 'tmpfs', 'id': 'tmpfs-tmp-mount', 'type': 'mount'})
 finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: configuring mount: tmpfs-tmp-mount
 TIMED BLOCK_META: 11.849
 finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: curtin command block-meta
 Traceback (most recent call last):
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/commands/main.py", line 202, in main
     ret = args.func(args)
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/log.py", line 97, in wrapper
     return log_time("TIMED %s: " % msg, func, *args, **kwargs)
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/log.py", line 79, in log_time
     return func(*args, **kwargs)
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/commands/block_meta.py", line 127, in block_meta
     return meta_custom(args)
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/commands/block_meta.py", line 2248, in meta_custom
     handler(command, storage_config_dict, context)
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/commands/block_meta.py", line 1468, in mount_handler
     mount_apply(mount_data(info, storage_config),
   File "/snap/subiquity/5270/lib/python3.10/site-packages/curtin/commands/block_meta.py", line 1251, in mount_data
     raise ValueError(
 ValueError: mount entry without 'device' missing: ['fstype']. ({'path': '/tmp', 'options': 'mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m', 'spec': 'tmpfs', 'id': 'tmpfs-tmp-mount', 'type': 'mount'})
 mount entry without 'device' missing: ['fstype']. ({'path': '/tmp', 'options': 'mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m', 'spec': 'tmpfs', 'id': 'tmpfs-tmp-mount', 'type': 'mount'})
 curtin: Installation failed with exception: Unexpected error while running command.

This doesn't make sense since I specified the 'fstype' in my mount definition. This working well with other kind of volume having the 'device' directive.

#cloud-config
...omitted for brevity
storage:
  swap:
    size: 0 # Disable creation of swapfile
  config:
    ...omitted for brevity
    # Snap lib volume (path: /var/lib/snapd, size: 5G)
    - id: lvm-system-snaplib-vol
      type: lvm_partition
      volgroup: lvm-system-vg
      name: snap-lib
      size: 5GB
      preserve: false
    - id: lvm-system-snaplib-fs
      type: format
      volume: lvm-system-snaplib-vol
      fstype: ext4
      preserve: false
    - id: lvm-system-snaplib-mount
      type: mount
      device: lvm-system-snaplib-fs
      path: /var/lib/snapd
    ## tmpfs mounts
    # /tmp tmpfs mount (path: /tmp, size: 50% total memory)
    - id: tmpfs-tmp
      type: mount
      spec: tmpfs
      fstype: tmpfs
      path: /tmp
      options: 'mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m'

I dig a bit and found that the 'fstype' directive was not kept for whatever reason in the final generated storage configuration, so that's why the installation is failing imo.

# cat /var/log/installer/curtin-install/subiquity-partitioning.conf
# Autogenerated by Subiquity: 2023-10-28 15:19:23.214035 UTC
install:
  error_tarfile: /var/log/installer/curtin-errors.tar
  log_file: /var/log/installer/curtin-install.log
  log_file_append: true
  resume_data: /tmp/tmpo7eqfsjb/resume-data.json
  save_install_config: false
  save_install_log: false
  target: /target
  unmount: disabled
storage:
  ...omitted for brevity
  - path: /tmp
    options: mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m
    spec: tmpfs
    id: tmpfs-tmp-mount
    type: mount

Then, I tried to search a bit in the curtin codebase but can't find anything useful to debug this issue. This was working fine previously when using the Ubuntu 22.04.2 ISO installer. Finally, I tried to disable the autoinstall auto-update when starting the installer and the installation worked as expected !

Here are the software versions used in both cases :

Installer crashed:
  - Ubuntu 22.04.3 ISO
  - Curtin 22.1-125-g7c18bf6a2
  - Subiquity 23.10.1

Installer working fine:
  - Ubuntu 22.04.3 ISO
  - Curtin 22.1-43-g9e9f66e83
  - Subiquity 23.08.1

I attached the crash log, I can provide more debug logs if needed.

Kind regards,

Florian BOBIN

Revision history for this message
Florian Bobin (f-bn) wrote :
description: updated
Revision history for this message
Florian Bobin (f-bn) wrote :

Add Subiquity partitioning configuration

Revision history for this message
Florian Bobin (f-bn) wrote :

Add Subiquity server debug logs

Revision history for this message
David Tulloh (ubuntu-david-o) wrote :

I ran into the same issue and believe it is a subiquity bug, introduced by https://github.com/canonical/subiquity/commit/0cc4fdf34893d7420cd3bf5d227b273791dbcdfb

This was released in 23.10.1 on Oct 12, 2023. Which corresponds nicely with the creation of this ticket.

I raised https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/2061732

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.