Seeding fails on Azure instances

On Azure instances, snapd seeding sometimes fails.

Here are system logs when that happens: https://pastebin.ubuntu.com/p/X9ZtJZn2CX/ (full logs here)
Here are the system logs when everything goes fine: https://pastebin.ubuntu.com/p/qF8Mdkt7V7/

Because the system continues waiting for snapd to be fully seeded, cloud-config service is never run and cloud-init never completes its work on those instances.

Could you please have a look at those logs and confirm whether it’s a snapd bug or not?

After further investigations, we think that the issue is related to this bug: