UUID length 64 or 32?

I provisioned bunch of devices, interestingly one of them has 64 character length UUID whereas others has 32. All of the were provisioned with same image, in latest openBalena and balenaOS 2.46.1+rev3 rpi4 image.

Why does the UUID length differ between devices? This makes it difficult to write other applications when I can’t trust it being same length.

Hi. UUIDs are always represented as 32 hexadecimal digits, so a 64-digit UUID is definitely not valid. Just to confirm, only one device has a 64-digit UUID, correct? Is the device working at all? Can you interact with it?

Also, are either your build of openBalena or balenaOS customized?

@Ereski yeah, I tried it only briefly, it worked. Deleted it already, I didn’t like it, I want to use standard UUID so I can use them in my own database:

balena device 3d1d9ef
== NAMEHERE
ID:                 12
DEVICE TYPE:        raspberrypi4-64
STATUS:             inactive
IS ONLINE:          false
IP ADDRESS:         192.168.0.17
APPLICATION NAME:   screens
UUID:               3d1d9ef49fbc4b6dac524c5e92d487b010464abd89839e4e7591d100f41a6a
COMMIT:             97e526e399fc29a7dfef0d26163a6e32
SUPERVISOR VERSION: 10.6.27
OS VERSION:         balenaOS 2.46.1+rev3
DASHBOARD URL:      https://dashboard..../devices/3d1d9ef49fbc4b6dac524c5e92d487b010464abd89839e4e7591d100f41a6a/summary

OpenBalena 2.0.1

Yes, only one of the devices had 64 char UUID, really weird. Others has 32. I’ve just followed the https://www.balena.io/open/docs/getting-started no customization

That is actually a 62-digit UUID, which is even weirder. We’d like to understand what might have caused this.

  • Is any part of your stack customized?
  • Upon deleting and getting a new UUID for that device, is the new UUID the correct length?
  • If possible, could you use register the same device (same hardware) multiple times to try and reproduce this?

Nothing is customized, it’s plain openBalena, I just followed the getting started.

New UUID is correct, it’s easy to spot the ugly duckling in this list:

ID UUID    DEVICE NAME               DEVICE TYPE     APPLICATION NAME STATUS IS ONLINE SUPERVISOR VERSION OS VERSION           DASHBOARD URL
6  d046c00 xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/d046c00b139ab1db30791bbc0b4c796d/summary
7  8d12310 xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/8d123102d442c5ea088da41f8fb5ce11/summary
8  1909f99 xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/1909f9950bdf21fdf3b802c03808a860/summary
14 136b5ad xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/136b5ade5ce1ec9febac87ef54676a45/summary
12 3d1d9ef xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/3d1d9ef49fbc4b6dac524c5e92d487b010464abd89839e4e7591d100f41a6a/summary
13 d6560b4 xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/d6560b4da185d26bfe858b8ef8fe33b6/summary
9  4c03c67 xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/4c03c67d0bc22c1822a7477e28710952/summary
15 89360ff xx                        raspberrypi4-64 screens          Idle   false     10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/89360ff66cef11b94262e7ef0e601d45/summary
10 334b928 xx                        raspberrypi4-64 screens                 false                                             https://dashboard.xxx/devices/334b9288283f811ef2aa77c04b6acecd/summary
3  fec0fc3 xx                        raspberrypi4-64 screens          Idle   true      10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/devices/fec0fc3b85c69253a10f5ac79c935e1f/summary

Notice the last dashboard column. I have remoed some parts with “xx”.

New device came up correctly with 32 char UUID.

I will certainly post here if I see another weird UUID, it doesn’t make sense to me that it’s even possible to have differing length UUID.

It happened again!

New UUID:

519f787c2ae7610500a8cc62db1bbb5b51e174e3edd87e488a9a30300c7c89

C:\Users\jarip>balena device 519f787
== NAMEHERE
ID: 18
DEVICE TYPE: raspberrypi4-64
STATUS: inactive
IS ONLINE: true
IP ADDRESS: 192.168.0.17
APPLICATION NAME: screens
UUID: 519f787c2ae7610500a8cc62db1bbb5b51e174e3edd87e488a9a30300c7c89
COMMIT: 97e526e399fc29a7dfef0d26163a6e32
SUPERVISOR VERSION: 10.6.27
OS VERSION: balenaOS 2.46.1+rev3
DASHBOARD URL: https://dashboard.xxx/devices/519f787c2ae7610500a8cc62db1bbb5b51e174e3edd87e488a9a30300c7c89/summary

Okay here is what is happening, each time I provision a device, it creates another device that does not come online, but when another one comes online it creates second device with long UUID.

I provisioned one device, and it created two!

19 17b8226 hidden-feather            raspberrypi4-64 screens                 false                                             https://dashboard.xxx/17b8226b19bc5dd9c326feea5e9c3fbb/summary
21 9c69f14 white-snowflake           raspberrypi4-64 screens          Idle   true      10.6.27            balenaOS 2.46.1+rev3 https://dashboard.xxx/9c69f148253ad53f9bdca8a83d880785cd5944c61d13351106dcc27d9dbe61/summary

argh.

Just to clarify, when you say “I provisioned one device” what is the exact process you followed? I’m assuming you simply mean that you burned the image to an SD card with Etcher and booted up the device?

Thanks,
James.

@jimsynz yes sir. I boot it up, and then it creates one with short UUID, and then after a while it creates long UUID version that comes online.

Oddly enough, it worked normally for multiple devices, but now it’s failed three times in a row like this.

It happened three times in a row with one specific SD Card, now that we tried with a new card it worked fine. Very odd. Do you people seed the UUID with some hardware ID in the SD Card?

Nope, it literally runs openssl rand -hex 16 when it first boots and discovers there’s no device ID in the config.json. The only thing I can think of is that something else is also writing to the config.json.

Does it continue to happen if you reflash the problematic SD card?

We flashed the same SD card three times, each time it booted (provisioned) it came up with first short UUID, and long UUID in same device list.

I don’t have time to test further right now, but it worked just fine with a new SD card.

Are all the SD cards the same? Can you tell us exactly what cards you’re using?

Just to keep you up to date, it seems that there are two bugs here:

  1. When we changed the generated key length in the host OS we didn’t update the corresponding library that the supervisor uses. PR opened
  2. For some reason the supervisor is deciding that the device needs to be registered again, even though the host OS already registered it. Issue opened

One of the supervisor team may be in touch with you to get more information about the circumstances. Additionally, any information you can give us about the SD card in question would be good.

Thanks,
James.

1 Like

These are really cheap Kingston 16GB.

If that is the only code that touches the key I’m baffled. (Edit I see you added another comment as I was writing! Thanks)

  1. Flash the SD with configured balena.img.
  2. Insert to the Raspberry Pi 4
  3. Wait… and first device appears in the balena devices it has a short UUID
  4. Wait more… and second device with long UUID appears in the balena devices it comes online

The first short UUID never came online, it was just hanging there it can be identified in my above logs as the devices 334b928 and 17b8226 these are the devices that appeared but never came online. However the devices with long UUID did came online.

Thanks for the details. We’ll let you know what we find.
James.

Hi,
We have identified what causes this issue and are working on getting a fix for this released in the next balenaOS release.
Thanks for letting us know. We will give you a notice once this becomes available.

Kind regards,
Thodoris

1 Like