And even that wasn't enough to stop all the warnings. Apparently lvdisplay doesn't set an error code if there were zero results. The following should catch that situation and stop the last of it:
ENV{DM_UUID}=="LVM-*", PROGRAM="/bin/sh -ec 'set -- $(lvm lvdisplay -C -o vg_name,lv_name --noheadings /dev/$name); echo ${2+$1/$2}'", SYMLINK+="$result"
And even that wasn't enough to stop all the warnings. Apparently lvdisplay doesn't set an error code if there were zero results. The following should catch that situation and stop the last of it:
ENV{DM_ UUID}== "LVM-*" , PROGRAM="/bin/sh -ec 'set -- $(lvm lvdisplay -C -o vg_name,lv_name --noheadings /dev/$name); echo ${2+$1/$2}'", SYMLINK+="$result"