archlinux / archinstall

Arch Linux installer - guided, templates etc.
GNU General Public License v3.0
6.37k stars 545 forks source link

"ValueError: Device path was not set" after reconfiguring encrypted partition #2304

Open correctmost opened 11 months ago

correctmost commented 11 months ago

Steps to reproduce

  1. Run archinstall
  2. Navigate to Disk configuration
    1. Select Use a best-effort default partition layout
    2. Select the /dev/sda entry and press enter
    3. Select ext4
  3. Navigate to Disk encryption
    1. Select Encryption password
      1. Set a non-blank password
    2. Select Partitions
      1. Select the ext4 partition and press enter
    3. Select <- Back
  4. Navigate to Disk configuration (again)
    1. Select Use a best-effort default partition layout
    2. Leave the /dev/sda entry selected and press enter
    3. Select ext4
  5. Navigate to User account
    1. Select Add a user
      1. Enter a username and password
      2. Choose superuser permissions
    2. Select Confirm and exit
  6. Select Install
    1. Press the enter key to continue

Debugging

It looks like the disk_encryption configuration refers to a partition obj_id that is not present in the partitions array.

Log

Full log

Disk configs
-- Chosen configuration --
{
    ...
    "disk_config": {
        "config_type": "default_layout",
        "device_modifications": [
            {
                "device": "/dev/sda",
                "partitions": [
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [
                            "Boot"
                        ],
                        "fs_type": "fat32",
                        "mount_options": [],
                        "mountpoint": "/boot",
                        "obj_id": "7fd1404c-d795-4a3d-9021-02d1588ebcc3",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MiB",
                            "value": 203
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MiB",
                            "value": 3
                        },
                        "status": "create",
                        "type": "primary"
                    },
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [],
                        "fs_type": "ext4",
                        "mount_options": [],
                        "mountpoint": "/",
                        "obj_id": "d817d008-4713-43be-b3fe-4671ae08eece",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 15890120704
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 216006656
                        },
                        "status": "create",
                        "type": "primary"
                    }
                ],
                "wipe": true
            }
        ]
    },
    "disk_encryption": {
        "encryption_type": "luks",
        "partitions": [
            "04cd113e-a529-4322-b71a-89cfcc5093f4"
        ]
    },
    ...
}

Backtrace

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 329, in run_as_a_module
    main()
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 324, in main
    importlib.import_module(mod_name)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.11/site-packages/archinstall/scripts/guided.py", line 256, in <module>
    perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
  File "/usr/lib/python3.11/site-packages/archinstall/scripts/guided.py", line 118, in perform_installation
    with Installer(
  File "/usr/lib/python3.11/site-packages/archinstall/lib/installer.py", line 109, in __exit__
    raise exc_val
  File "/usr/lib/python3.11/site-packages/archinstall/scripts/guided.py", line 133, in perform_installation
    installation.generate_key_files()
  File "/usr/lib/python3.11/site-packages/archinstall/lib/installer.py", line 265, in generate_key_files
    part_mod.safe_dev_path,
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_model.py", line 716, in safe_dev_path
    raise ValueError('Device path was not set')
ValueError: Device path was not set

Version

2.7.1

svartkanin commented 11 months ago

Thanks for the great debugging steps