better error message in case of missing uids

(cherry picked from commit 089b2930196a95e5111a1d21b06d6c8e76cfd011)