This is a bug report, but I don’t have a github account I can use to, um, report it.
$ incus admin os system show resources will produce an error only and no resource lists under some reasonably plausible circumstances.
The circumstance in question is if incus-os boots with, say, one or two HDDs attached to a controller, incus-os will see those devices as /dev/disk/by-id/ata-ST6000NM0115-1YZ110_ZAD4YQJ4 (or the like). Show resources will list the device(s) normally.
If the controller for this HDD is then passed to a VM ( $ incus config device add nas externals pci address=0000:05:00.4 ) the VM will see the HDD and incus-os will no longer be able to. However, the links to this device, like the disk-by-id listed above, will not be cleaned up, and when $ incus admin os system show resources is run, it will crash on the missing device:
$ incus admin os system show resources WARNING: The IncusOS API and configuration is subject to change
Error: Failed to retrieve storage information: Failed to find “/dev/disk/by-id/ata-ST6000NM0115-1YZ110_ZAD4YQJ4”: lstat /dev/sda: no such file or directory
Once in this state, show resources will never work unless the VM in question is stopped and, thus, the resources returned to the host (I didn’t actually check that last bit. It’s just a guess).
A reasonable solution would to still report the error, though maybe only in the logs, and continue with listing the resources. Also, possibly, when passing a PCI device to a VM any references to it could be ignored after that (though that’s much more involved).
I am only aware of this being a problem when passing the device controller the HDDs are attached to a VM. Passing the HDDs individually might or might not exhibit the same issue.