Skip to content

Sporadic Timed out waiting for device on boot #13775

Closed

Description

@Hi-Angel

Sometimes, upon reboot, I see this timeout error. I couldn't figure out what's causing it: other than systemd printing the error and putting me into emergency mode everything looks fine. In particular, if I quit the emergency mode with Ctrl+d, boot continues and the partition in question gets mounted properly.

Content of /etc/fstab:

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
UUID=443bd794-4b17-4bf2-8801-b0d5cf1c3432 /             btrfs  rw,noatime,autodefrag,compress=zstd      0 0

UUID=664cfee5-16d7-4e43-933a-ca2e1e25d72f /boot     ext4   defaults,noatime         0 2
UUID=024D-8283 /boot/efi     vfat   defaults         0 1

# a dir we're using for development purposes
tmpfs /mnt/block_dev         tmpfs  rw,nosuid,nodev,noatime,size=500M                0 0

# UUID=dbb01c54-a041-4d53-8a6e-847d0e2c4570 none        swap   defaults         0 0

lsblk -f output after quitting "emergency mode", and getting booted:

$ lsblk -f
NAME   FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1 vfat   ESP   024D-8283                               572M     4% /boot/efi
├─sda2 ext4         664cfee5-16d7-4e43-933a-ca2e1e25d72f    314M    20% /boot
├─sda3 swap         817bb5c9-e259-4139-b3e4-c2ae5c9232ed                [SWAP]
└─sda4 btrfs        443bd794-4b17-4bf2-8801-b0d5cf1c3432  618.3G    33% /
sr0

systemd version the issue has been seen with

243.51 (and older, possibly everywhere)

Used distribution

Archlinux

Expected behaviour you didn't see

No Timed out waiting for device error

Unexpected behaviour you saw

"Timed out" error appears, and systemd stops booting and quits to emergency mode. Relevant lines from ournalctl:

окт 15 09:37:08 constantine-N61Ja systemd[1]: dev-disk-by\x2duuid-024D\x2d8283.device: Job dev-disk-by\x2duuid-024D\x2d8283.device/start timed out.
окт 15 09:37:08 constantine-N61Ja systemd[1]: Timed out waiting for device /dev/disk/by-uuid/024D-8283.
окт 15 09:37:08 constantine-N61Ja systemd[1]: Dependency failed for File System Check on /dev/disk/by-uuid/024D-8283.
окт 15 09:37:08 constantine-N61Ja systemd[1]: Dependency failed for /boot/efi.
окт 15 09:37:08 constantine-N61Ja systemd[1]: Dependency failed for Local File Systems.
окт 15 09:37:08 constantine-N61Ja systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
окт 15 09:37:08 constantine-N61Ja systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
окт 15 09:37:08 constantine-N61Ja systemd[1]: boot-efi.mount: Job boot-efi.mount/start failed with result 'dependency'.
окт 15 09:37:08 constantine-N61Ja systemd[1]: systemd-fsck@dev-disk-by\x2duuid-024D\x2d8283.service: Job systemd-fsck@dev-disk-by\x2duuid-024D\x2d8283.service/start failed with result 'dependency'.
окт 15 09:37:08 constantine-N61Ja systemd[1]: dev-disk-by\x2duuid-024D\x2d8283.device: Job dev-disk-by\x2duuid-024D\x2d8283.device/start failed with result 'timeout'.
окт 15 09:37:08 constantine-N61Ja systemd[1]: dev-disk-by\x2duuid-664cfee5\x2d16d7\x2d4e43\x2d933a\x2dca2e1e25d72f.device: Job dev-disk-by\x2duuid-664cfee5\x2d16d7\x2d4e43\x2d933a\x2dca2e1e25d72f.device/start timed out.

Steps to reproduce the problem

  1. Reboot the laptop

Activity

  1. poettering commented on Oct 23, 2019

    @poettering
    Member

    So what does "udevadm info /dev/disk/by-uuid/024D-8283" say?

    the question is why that device never shows up?

    Do you have any weird kind of storage? lvm? raid? …

  2. added
    needs-reporter-feedback ❓
    on Oct 23, 2019
  3. Hi-Angel commented on Oct 23, 2019

    @Hi-Angel
    Author

    Sorry, it's a work laptop that I'll have access to again in November. Sorry for the delay.

  4. Hi-Angel commented on Oct 30, 2019

    @Hi-Angel
    Author

    So what does "udevadm info /dev/disk/by-uuid/024D-8283" say?

    $ udevadm info /dev/disk/by-uuid/024D-8283
    P: /devices/pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
    N: sda1
    L: 0
    S: disk/by-path/pci-0000:00:17.0-ata-1-part1
    S: disk/by-uuid/024D-8283
    S: disk/by-id/ata-TOSHIBA_MQ01ABD100_97NUTIKXT-part1
    S: disk/by-id/wwn-0x5000039801e8ad71-part1
    S: disk/by-label/ESP
    S: disk/by-partuuid/97291532-18db-455c-8751-ee25ead56026
    E: DEVPATH=/devices/pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
    E: DEVNAME=/dev/sda1
    E: DEVTYPE=partition
    E: PARTN=1
    E: MAJOR=8
    E: MINOR=1
    E: SUBSYSTEM=block
    E: USEC_INITIALIZED=32978948
    E: ID_ATA=1
    E: ID_TYPE=disk
    E: ID_BUS=ata
    E: ID_MODEL=TOSHIBA_MQ01ABD100
    E: ID_MODEL_ENC=TOSHIBA\x20MQ01ABD100\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
    E: ID_REVISION=AX0P3D
    E: ID_SERIAL=TOSHIBA_MQ01ABD100_97NUTIKXT
    E: ID_SERIAL_SHORT=97NUTIKXT
    E: ID_ATA_WRITE_CACHE=1
    E: ID_ATA_WRITE_CACHE_ENABLED=1
    E: ID_ATA_FEATURE_SET_HPA=1
    E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
    E: ID_ATA_FEATURE_SET_PM=1
    E: ID_ATA_FEATURE_SET_PM_ENABLED=1
    E: ID_ATA_FEATURE_SET_SECURITY=1
    E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
    E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=222
    E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=222
    E: ID_ATA_FEATURE_SET_SECURITY_FROZEN=1
    E: ID_ATA_FEATURE_SET_SMART=1
    E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
    E: ID_ATA_FEATURE_SET_PUIS=1
    E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
    E: ID_ATA_FEATURE_SET_APM=1
    E: ID_ATA_FEATURE_SET_APM_ENABLED=1
    E: ID_ATA_FEATURE_SET_APM_CURRENT_VALUE=128
    E: ID_ATA_DOWNLOAD_MICROCODE=1
    E: ID_ATA_SATA=1
    E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
    E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
    E: ID_ATA_ROTATION_RATE_RPM=5400
    E: ID_WWN=0x5000039801e8ad71
    E: ID_WWN_WITH_EXTENSION=0x5000039801e8ad71
    E: ID_PATH=pci-0000:00:17.0-ata-1
    E: ID_PATH_TAG=pci-0000_00_17_0-ata-1
    E: ID_PART_TABLE_UUID=6dced60a-86e8-4470-95de-e86de21f960b
    E: ID_PART_TABLE_TYPE=gpt
    E: ID_FS_LABEL=ESP
    E: ID_FS_LABEL_ENC=ESP
    E: ID_FS_UUID=024D-8283
    E: ID_FS_UUID_ENC=024D-8283
    E: ID_FS_VERSION=FAT32
    E: ID_FS_TYPE=vfat
    E: ID_FS_USAGE=filesystem
    E: ID_PART_ENTRY_SCHEME=gpt
    E: ID_PART_ENTRY_UUID=97291532-18db-455c-8751-ee25ead56026
    E: ID_PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    E: ID_PART_ENTRY_NUMBER=1
    E: ID_PART_ENTRY_OFFSET=2048
    E: ID_PART_ENTRY_SIZE=129024
    E: ID_PART_ENTRY_DISK=8:0
    E: UDISKS_IGNORE=1
    E: DEVLINKS=/dev/disk/by-path/pci-0000:00:17.0-ata-1-part1 /dev/disk/by-uuid/024D-8283 /dev/disk/by-id/ata-TOSHIBA_MQ01ABD100_97NUTIKXT-part1 /dev/disk/by-id/wwn-0x5000039801e8ad71-part1 /dev/disk/by-label/ESP /dev/disk/by-partuuid/97291532-18db-455c-8751-ee25ead56026
    E: TAGS=:systemd:

    Do you have any weird kind of storage? lvm? raid?

    Nope. As you can see in my fstab and lsblk -f outputs, the setup is really simple.

  5. poettering commented on Nov 3, 2019

    @poettering
    Member

    that output is that from a boot where the device timed out, or from a boot where everyhing worked? I am only interested in the former...

  6. Hi-Angel commented on Nov 5, 2019

    @Hi-Angel
    Author

    that output is that from a boot where the device timed out, or from a boot where everyhing worked? I am only interested in the former...

    I think so, yes, but now that you ask I'm not sure. Either way, here's an output that is for sure from a boot when device timed out:

    $ udevadm info /dev/disk/by-uuid/024D-8283
    P: /devices/pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
    N: sda1
    L: 0
    S: disk/by-id/wwn-0x5000039801e8ad71-part1
    S: disk/by-label/ESP
    S: disk/by-path/pci-0000:00:17.0-ata-1-part1
    S: disk/by-id/ata-TOSHIBA_MQ01ABD100_97NUTIKXT-part1
    S: disk/by-uuid/024D-8283
    S: disk/by-partuuid/97291532-18db-455c-8751-ee25ead56026
    E: DEVPATH=/devices/pci0000:00/0000:00:17.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
    E: DEVNAME=/dev/sda1
    E: DEVTYPE=partition
    E: PARTN=1
    E: MAJOR=8
    E: MINOR=1
    E: SUBSYSTEM=block
    E: USEC_INITIALIZED=43920359
    E: ID_ATA=1
    E: ID_TYPE=disk
    E: ID_BUS=ata
    E: ID_MODEL=TOSHIBA_MQ01ABD100
    E: ID_MODEL_ENC=TOSHIBA\x20MQ01ABD100\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
    E: ID_REVISION=AX0P3D
    E: ID_SERIAL=TOSHIBA_MQ01ABD100_97NUTIKXT
    E: ID_SERIAL_SHORT=97NUTIKXT
    E: ID_ATA_WRITE_CACHE=1
    E: ID_ATA_WRITE_CACHE_ENABLED=1
    E: ID_ATA_FEATURE_SET_HPA=1
    E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
    E: ID_ATA_FEATURE_SET_PM=1
    E: ID_ATA_FEATURE_SET_PM_ENABLED=1
    E: ID_ATA_FEATURE_SET_SECURITY=1
    E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
    E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=222
    E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=222
    E: ID_ATA_FEATURE_SET_SECURITY_FROZEN=1
    E: ID_ATA_FEATURE_SET_SMART=1
    E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
    E: ID_ATA_FEATURE_SET_PUIS=1
    E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
    E: ID_ATA_FEATURE_SET_APM=1
    E: ID_ATA_FEATURE_SET_APM_ENABLED=1
    E: ID_ATA_FEATURE_SET_APM_CURRENT_VALUE=128
    E: ID_ATA_DOWNLOAD_MICROCODE=1
    E: ID_ATA_SATA=1
    E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
    E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
    E: ID_ATA_ROTATION_RATE_RPM=5400
    E: ID_WWN=0x5000039801e8ad71
    E: ID_WWN_WITH_EXTENSION=0x5000039801e8ad71
    E: ID_PATH=pci-0000:00:17.0-ata-1
    E: ID_PATH_TAG=pci-0000_00_17_0-ata-1
    E: ID_PART_TABLE_UUID=6dced60a-86e8-4470-95de-e86de21f960b
    E: ID_PART_TABLE_TYPE=gpt
    E: ID_FS_LABEL=ESP
    E: ID_FS_LABEL_ENC=ESP
    E: ID_FS_UUID=024D-8283
    E: ID_FS_UUID_ENC=024D-8283
    E: ID_FS_VERSION=FAT32
    E: ID_FS_TYPE=vfat
    E: ID_FS_USAGE=filesystem
    E: ID_PART_ENTRY_SCHEME=gpt
    E: ID_PART_ENTRY_UUID=97291532-18db-455c-8751-ee25ead56026
    E: ID_PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    E: ID_PART_ENTRY_NUMBER=1
    E: ID_PART_ENTRY_OFFSET=2048
    E: ID_PART_ENTRY_SIZE=129024
    E: ID_PART_ENTRY_DISK=8:0
    E: UDISKS_IGNORE=1
    E: DEVLINKS=/dev/disk/by-id/wwn-0x5000039801e8ad71-part1 /dev/disk/by-label/ESP /dev/disk/by-path/pci-0000:00:17.0-ata-1-part1 /dev/disk/by-id/ata-TOSHIBA_MQ01ABD100_97NUTIKXT-part1 /dev/disk/by-uuid/024D-8283 /dev/disk/by-partuuid/97291532-18db-455c-8751-ee25ead56026
    E: TAGS=:systemd:
  7. Hi-Angel commented on Nov 5, 2019

    @Hi-Angel
    Author

    Btw, it's interesting that I see in journalctl even 2 "devices" timed out:

    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Timed out waiting for device /dev/disk/by-uuid/024D-8283.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for File System Check on /dev/disk/by-uuid/024D-8283.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for /boot/efi.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for Local File Systems.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: boot-efi.mount: Job boot-efi.mount/start failed with result 'dependency'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: systemd-fsck@dev-disk-by\x2duuid-024D\x2d8283.service: Job systemd-fsck@dev-disk-by\x2duuid-024D\x2d8283.service/start failed with result 'dependency'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: dev-disk-by\x2duuid-024D\x2d8283.device: Job dev-disk-by\x2duuid-024D\x2d8283.device/start failed with result 'timeout'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: dev-sda3.device: Job dev-sda3.device/start timed out.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Timed out waiting for device /dev/sda3.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for Swap Partition.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: dev-sda3.swap: Job dev-sda3.swap/start failed with result 'dependency'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: dev-sda3.device: Job dev-sda3.device/start failed with result 'timeout'.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: dev-disk-by\x2duuid-664cfee5\x2d16d7\x2d4e43\x2d933a\x2dca2e1e25d72f.device: Job dev-disk-by\x2duuid-664cfee5\x2d16d7\x2d4e43\x2d933a\x2dca2e1e25d72f.device/start timed out.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Timed out waiting for device /dev/disk/by-uuid/664cfee5-16d7-4e43-933a-ca2e1e25d72f.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for File System Check on /dev/disk/by-uuid/664cfee5-16d7-4e43-933a-ca2e1e25d72f.
    ноя 05 09:41:15 constantine-N61Ja systemd[1]: Dependency failed for /boot.
    
  8. Hi-Angel commented on Feb 12, 2020

    @Hi-Angel
    Author

    Update: I recently learned about kexec way of quick reboot, which I've used some minutes ago. And upon booting I got a freeze for about 20 seconds. I was about to use hard reset when boot continued with the similar timed out waiting for device error. Except this time it was SWAP partition, it wasn't EFI partition.

    фев 12 09:02:13 constantine-N61Ja systemd[1]: dev-sda3.device: Job dev-sda3.device/start timed out.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: Timed out waiting for device /dev/sda3.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: Dependency failed for Swap Partition.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: dev-sda3.swap: Job dev-sda3.swap/start failed with result 'dependency'.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: dev-sda3.device: Job dev-sda3.device/start failed with result 'timeout'.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: Reached target Swap.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.
    фев 12 09:02:13 constantine-N61Ja systemd[1]: Mounting Temporary Directory (/tmp)...
    фев 12 09:02:13 constantine-N61Ja systemd[1]: Mounted Temporary Directory (/tmp).
    
  9. Hi-Angel commented on Feb 12, 2020

    @Hi-Angel
    Author

    Btw, I figured there's still "needs reporter feedback" label, can please someone remove it? You can delete this comment too.

  10. Kipparis commented on Mar 15, 2020

    @Kipparis

    I had basically same issue. The problem was in installed automount rules from here.
    Once they are removed, the problem wasn't appear any more.

    In sum: maybe you have something that affects mounting drives

  11. Hi-Angel commented on Mar 15, 2020

    @Hi-Angel
    Author

    I had basically same issue. The problem was in installed automount rules from here.
    Once they are removed, the problem wasn't appear any more.

    In sum: maybe you have something that affects mounting drives

    I don't have this package installed, nor I have been rewriting udev rules. I don't see anything similar in my situation.

  12. removed
    needs-reporter-feedback ❓
    on Mar 16, 2020
  13. Hi-Angel commented on Apr 7, 2020

    @Hi-Angel
    Author

    Okay, so, good news is that as of systemd 245, upon getting the error Timed out waiting for device, systemd does not bail to emergency mode anymore. So won't scare off less knowledgeable users.

  14. 64 remaining items

  15. PlaidCat commented on May 18, 2022

    @PlaidCat

    (redacted)

    None of this data has what I expected in it. I'm going to have to sort this out its seems like i launched the wrong AMI's now.
    The most recent builds the AMI's were incorrectly built, need to look into why that is, apologies.

    I know this is less than ideal but here are the full journalctl -o short-rpecise dumps that have both the switchroot and dracut stuff in them from here: #13775 (comment)
    failing_journalctl_short-precise.txt.gz
    working_journalct_short-precise.txt.gz

    If these don't have the data your looking for the the diff I did to validate that the /run/ path had a subset of data in /var/log/ is flawed and I am not sure what I should be looking for

    effectively
    diff $(journalctl -D /run/log/journal/ec2a2fd0fa29ac3e5497aa58d0df4997 | egrep -i "initrd|switching root|dracut") $(journalctl | egrep -i "initrd|switching root|dracut")

  16. PlaidCat commented on May 20, 2022

    @PlaidCat

    @daandemeyer
    I think we have at least found the commit that fixes the problem we've been experiencing.
    75d7b59

    0% failure bd144c9 (head when built the other day)
    0% failure 75d7b59 (suspected fix)
    5% failure f33bc87 (parent of fix)

    I when I saw the above commit last week I believed it would work but I was actually not building the image correctly so my comments here are with incorrect data: #13775 (comment)

    I believe this issue might be a similar but different to the original issue: #12953

    I would appreciate if anyone else following this could confirm if their issues are resolved with the 75d7b59 commit.

  17. yuwata commented on May 20, 2022

    @yuwata
    Member

    Oh, good news. But I have no idea why the commit fixes this issue.

  18. daandemeyer commented on May 20, 2022

    @daandemeyer
    Collaborator

    I can confirm from the latest logs provided (before the potential fix commit was introduced) that in the failing case, mount_add_device_dependencies() is never called (not in the initrd and not after switching root) whereas in the working case it is called a few times, and eventually adds the expected device dependencies.

    We should probably add some trace/debug logging to device_coldplug() and device_update_found_one() to make this stuff easier to debug in the future.

  19. PlaidCat commented on May 20, 2022

    @PlaidCat

    Yeah, I can add some debugging instrumentation into to validate that we're hitting the fix you committed @yuwata

    My suspicion over two weeks ago but publicly commented 14 days ago was that something started "operating" on the device then during a reload and wasn't "reset" or became "lost". #13775 (comment)

    I've only just now started to understand the underlying state machine for the devices and what we're seeing was reminiscent of some the unit_catchup patches a colleague had to back port into one of our sustaining OS releases. If I would have known then what I know now I might have found the issue #12953 .

    This is why I'm not sure if this is just another observation of the same issue or I jumped into the wrong issue.

  20. PlaidCat commented on May 27, 2022

    @PlaidCat

    Hi, wanted to an update before taking some leave, I will return to this.

    I've been instrumenting the call chain and here are the major differences I'm noticing but have more questions now.
    I've specifically been working against the following commit because it still exhibits the issues. https://github.com/systemd/systemd/blob/f33bc87989a87475ed41bc9cd715c4cbb18ee389/src/core/device.c
    device.c.diff.gz

    I have been made aware of the regression with 75d7b59 and am following the upstream updates.

    Effectively what I've found is that if we enter device_catchup() if d->enumerated_found() is not 3 ie DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT we don't get a successful (ie device is mounted) dev-nvme0n1p128.device: Changed dead -> plugged , this makes sense to me as /dev-nvme0n1p128 wouldn't be in /proc/self/mount

    However what I've been seeing is that the MANAGER_IS_USER() is constantly true and it seem that when the pid changes it has a non-zero chance of losing the previous d->found state. You can see in the below when sysetmd[pid] changes sometimes it keeps the d->found state so when device_update_found_one() runs with 1689 and 1738 it doesn't try to change the state because the d->found is set to what the new n found state mask is so it returns void out of that however in 1808 it seems to lose the d->found state but is able to find everything and we're good.

    In the FAILING case we never get the DEVICE_FOUND_MOUNT found state and it seems to lose its state every time the PID changes.

    I can also log into the failed host and run sudo systemctl restart local-fs.target and the /boot/efi gets mounted as it should (journal included in the failing host at the instance level "first-boot" is from the automation)

    Question

    Is there something I should be looking for in these MANAGER_IS_USER() pids?
    I was going to continue call chain instrumentation, but I think I need to look for the DEVICE_FOUND_MOUNT and how that gets set?
    Are there any thoughts on where to dig in next?

    successful boot

    working.tar.gz

    May 26 23:02:09.889927  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:02:09.889976  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:02:09.890015  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (2) = (d->enumerated_found(0) & ~mask(-3)) 0 | 2 (found(2) & mask(2))
    May 26 23:02:09.899324  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 23:02:09.899365  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:02:09.899404  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (3) = (d->enumerated_found(2) & ~mask(-2)) 2 | 1 (found(1) & mask(1))
    May 26 23:02:09.926243  systemd[1689]: [email protected]: Failed to load configuration: No such file or directory
    May 26 23:02:09.931968  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_coldplug> d->serialized_state(-22) < 0; Return 0;
    May 26 23:02:09.933027  systemd[1689]: boot-efi.mount: Changed dead -> mounted
    May 26 23:02:09.940487  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_catchup> d->enumerated_found(3), DEVICE_FOUND_MASK(7)
    May 26 23:02:09.940487  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:02:09.940761  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 3 = (d->found(0) & ~mask(-8) | (found(3) & mask(7))
    May 26 23:02:09.940761  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> device_found_changed()
    May 26 23:02:09.940761  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_found_changed> (previous(0) == DEVICE_NOT_FOUND && now(3) != DEVICE_NOT_FOUND) = unit_acquire_invocation_id()
    May 26 23:02:09.940761  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}}<device_found_changed> FLAGS_SET(now(3), DEVICE_FOUND_UDEV) => device_set_state(d, DEVICE_PLUGGED)
    May 26 23:02:09.940761  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_set_state> (d->state(0) != (2)state) => bus_unit_send_pending_change_signal(UNIT(d), false)
    May 26 23:02:09.940761  systemd[1689]: dev-nvme0n1p128.device: Changed dead -> plugged
    [snip]
    May 26 23:02:14.866390  systemd[1]: Pulling in dev-nvme0n1p128.device/start from dev-disk-by\x2did-nvme\x2dnvme.1d0f\x2d766f6c3065636566626631643361323035396565\x2d416d617a6f6e20456c617374696320426c6f636b2053746f7265\x2d00000001\x2dpart128.device/start
    May 26 23:02:14.981667  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:02:14.981667  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: True || MANAGER_IS_USER(True)
    May 26 23:02:14.981667  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 3 = (d->found(3) & ~mask(-3) | (found(2) & mask(2))
    May 26 23:02:14.981667  systemd[1689]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> n (3)==(3) d->found; return void
    May 26 23:02:15.187502  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:02:15.187553  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:02:15.187573  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (2) = (d->enumerated_found(0) & ~mask(-3)) 0 | 2 (found(2) & mask(2))
    May 26 23:02:15.560133  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 23:02:15.560157  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:02:15.565114  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (3) = (d->enumerated_found(2) & ~mask(-2)) 2 | 1 (found(1) & mask(1))
    May 26 23:02:20.815693  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:02:20.820207  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: True || MANAGER_IS_USER(True)
    May 26 23:02:20.827593  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 3 = (d->found(3) & ~mask(-3) | (found(2) & mask(2))
    May 26 23:02:20.827614  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> n (3)==(3) d->found; return void
    [snip]
    May 26 23:03:10.693325  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:03:10.693344  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: True || MANAGER_IS_USER(True)
    May 26 23:03:10.703577  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 3 = (d->found(3) & ~mask(-3) | (found(2) & mask(2))
    May 26 23:03:10.708570  systemd[1738]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> n (3)==(3) d->found; return void
    May 26 23:03:10.732277  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_name> found(2) mask(2)
    May 26 23:03:10.732277  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:03:10.732277  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (2) = (d->enumerated_found(0) & ~mask(-3)) 0 | 2 (found(2) & mask(2))
    May 26 23:03:10.735707  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 23:03:10.735707  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:03:10.735707  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (3) = (d->enumerated_found(2) & ~mask(-2)) 2 | 1 (found(1) & mask(1))
    May 26 23:03:10.750208  systemd[1808]: [email protected]: Failed to load configuration: No such file or directory
    May 26 23:03:10.754296  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_coldplug> d->serialized_state(-22) < 0; Return 0;
    May 26 23:03:10.754296  systemd[1808]: boot-efi.mount: Changed dead -> mounted
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_catchup> d->enumerated_found(3), DEVICE_FOUND_MASK(7)
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 3 = (d->found(0) & ~mask(-8) | (found(3) & mask(7))
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> device_found_changed()
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_found_changed> (previous(0) == DEVICE_NOT_FOUND && now(3) != DEVICE_NOT_FOUND) = unit_acquire_invocation_id()
    May 26 23:03:10.760080  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}}<device_found_changed> FLAGS_SET(now(3), DEVICE_FOUND_UDEV) => device_set_state(d, DEVICE_PLUGGED)
    May 26 23:03:10.760439  systemd[1808]: [MAPLE]{dev-nvme0n1p128.device}<device_set_state> (d->state(0) != (2)state) => bus_unit_send_pending_change_signal(UNIT(d), false)
    May 26 23:03:10.760439  systemd[1808]: dev-nvme0n1p128.device: Changed dead -> plugged
    

    Failing Boot

    failing.tar.gz

    May 26 22:59:02.754526  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 22:59:02.754526  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 22:59:02.754526  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (1) = (d->enumerated_found(0) & ~mask(-2)) 0 | 1 (found(1) & mask(1))
    May 26 22:59:02.825610  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_coldplug> d->serialized_state(-22) < 0; Return 0;
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_catchup> d->enumerated_found(1), DEVICE_FOUND_MASK(7)
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 1 = (d->found(0) & ~mask(-8) | (found(1) & mask(7))
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> device_found_changed()
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_found_changed> (previous(0) == DEVICE_NOT_FOUND && now(1) != DEVICE_NOT_FOUND) = unit_acquire_invocation_id()
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}}<device_found_changed> FLAGS_SET(now(1), DEVICE_FOUND_UDEV) => device_set_state(d, DEVICE_PLUGGED)
    May 26 22:59:02.836483  systemd[1675]: [MAPLE]{dev-nvme0n1p128.device}<device_set_state> (d->state(0) != (2)state) => bus_unit_send_pending_change_signal(UNIT(d), false)
    May 26 22:59:02.836483  systemd[1675]: dev-nvme0n1p128.device: Changed dead -> plugged
    [snip]
    May 26 22:59:08.027809  systemd[1736]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 22:59:08.027841  systemd[1736]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 22:59:08.027858  systemd[1736]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (1) = (d->enumerated_found(0) & ~mask(-2)) 0 | 1 (found(1) & mask(1))
    [snip]
    May 26 23:00:04.358149  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_by_sysfs> found(1) mask(1)
    May 26 23:00:04.358396  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:00:04.358396  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(False), d->enumerated_found (1) = (d->enumerated_found(0) & ~mask(-2)) 0 | 1 (found(1) & mask(1))
    May 26 23:00:04.376723  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_coldplug> d->serialized_state(-22) < 0; Return 0;
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_catchup> d->enumerated_found(1), DEVICE_FOUND_MASK(7)
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> MANAGER_IS_RUNNING(True) && (m->honor_device_enumeration: False || MANAGER_IS_USER(True)
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> 1 = (d->found(0) & ~mask(-8) | (found(1) & mask(7))
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_update_found_one> device_found_changed()
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_found_changed> (previous(0) == DEVICE_NOT_FOUND && now(1) != DEVICE_NOT_FOUND) = unit_acquire_invocation_id()
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}}<device_found_changed> FLAGS_SET(now(1), DEVICE_FOUND_UDEV) => device_set_state(d, DEVICE_PLUGGED)
    May 26 23:00:04.383816  systemd[1806]: [MAPLE]{dev-nvme0n1p128.device}<device_set_state> (d->state(0) != (2)state) => bus_unit_send_pending_change_signal(UNIT(d), false)
    May 26 23:00:04.383816  systemd[1806]: dev-nvme0n1p128.device: Changed dead -> plugged
    

    Resources:

    working.tar.gz
    failing.tar.gz
    device.c.diff.gz

  21. bsmojver commented on Jun 6, 2022

    @bsmojver

    Taking device_coldplug() function from tip of stable and applying to to both 248.10 and 249.11 solved that issue for me, with no other changes.

  22. yuwata commented on Jun 28, 2022

    @yuwata
    Member

    OK. Still I do not know how, but luckily this is already fixed. Closing.

  23. bsmojver commented on Aug 10, 2022

    @bsmojver

    @yuwata, could you please backport this to 250. Pull request is systemd/systemd-stable#217.

    I am specifically talking about these commits:

    75d7b59
    4fc69e8

    I did some recent testing on AL2022 AMIs and patches worked around the issue with both 250.7 and 250.8 version of systemd. I also tested with latest F36 AMIs (they come with 250.8) and they seem to be no worse with these patches. Both images with patched systemd and vanilla ones end up in about 0.1% boot failure rate, likely caused by other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions