Custom Ubuntu Core image doesn't refresh snaps

I created a custom Ubuntu Core image based on the core22 image with only a few snaps added:

I have been running this for almost two weeks now, but now that two of the snaps have a new version I noticed that they haven’t been refreshed. So I looked at snap’s history:

koen-vervloesem@ubuntu-core-arm64:~$ snap changes
ID   Status  Spawn                    Ready                    Summary
128  Error   2022-05-23               2022-05-23               Initialize device
129  Error   yesterday at 15:53 CEST  yesterday at 15:53 CEST  Initialize device
130  Error   yesterday at 16:07 CEST  yesterday at 16:07 CEST  Initialize device
131  Error   yesterday at 16:07 CEST  yesterday at 16:08 CEST  Auto-refresh snaps "bluez", "theengs-gateway"
132  Error   yesterday at 16:32 CEST  yesterday at 16:32 CEST  Initialize device
133  Error   yesterday at 17:12 CEST  yesterday at 17:12 CEST  Initialize device
134  Error   yesterday at 18:37 CEST  yesterday at 18:37 CEST  Initialize device
135  Error   yesterday at 21:17 CEST  yesterday at 21:17 CEST  Initialize device
136  Error   yesterday at 22:52 CEST  yesterday at 22:53 CEST  Auto-refresh snaps "bluez", "theengs-gateway"
137  Error   today at 00:42 CEST      today at 00:43 CEST      Auto-refresh snaps "bluez", "theengs-gateway"
138  Error   today at 02:42 CEST      today at 02:42 CEST      Initialize device
139  Error   today at 06:52 CEST      today at 06:53 CEST      Auto-refresh snaps "bluez", "theengs-gateway"
140  Error   today at 13:27 CEST      today at 13:27 CEST      Initialize device

I also noticed the device doesn’t have a serial:

koen-vervloesem@ubuntu-core-arm64:~$ snap model
brand   Koen Vervloesem
model   theengs-gateway-ubuntu-core-22-pi-arm64
grade   signed
serial  - (device not registered yet)

I just installed this appliance as any other regular Ubuntu Core appliance, including entering my SSO account. So what am I missing here?

Please share the change details of one of the failed refreshes so we can have more info, for instance:

$ snap change 139

Regarding serial, it is normal that you don’t have one if this is a custom image. You usually would need a brand store for that, but in any case not having it should not have adverse effects.

Thanks for the suggestion! It seems my snap is restarting too many times. I’ll have to fix my configure hook script so it only restarts the service if any of its settings have changed. I’ll try whether refreshing works after this change.