# Failure to Upgrade v2.48.0-\>v2.51.1+rev2 on a fin

**URL:** <https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242>\
**Category:** Product support\
**Created:** [October 17, 2020, 12:42am UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242 "2020-10-17T00:42:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 17, 2020, 12:42am UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/1 "2020-10-17T00:42:35Z")

</div>

Had a device that was offline for a couple months and when I went back to it, and tried to upgrade the host OS:

```
resinhup failed: exit code 1 stderr: [000000003][ERROR]Device type sanity check failed...

```

This is attempting to go from balenaOS 2.48.0+rev1 to v2.51.1+rev2 on a fin.

Seems the function that does the “sanity check” looks like this:

```
function device_type_match {
# slug in `device-type.json` and `deviceType` in `config.json` should be always the same on proper devices`
local deviceslug
local devicetype
local match
if deviceslug=$(jq .slug "$DEVICETYPEJSON") && devicetype=$(jq .deviceType "$CONFIGJSON") && ["$devicetype" = "$deviceslug"]; then
    match=yes
else
    match=no
fi
echo "${match}"
}

```

So I took a look:

```
root@tcore:/mnt/boot# jq .slug device-type.json 
"fincm3"
root@tcore:/mnt/boot# jq .deviceType config.json 
"beaglebone-green-wifi"

```

The BBGW was the first board that I was using to start development, then I moved to the fin. So clearly this is now causing an issue.

 ![image](https://global.discourse-cdn.com/balena/original/2X/f/f605368dfff54282d8bfb8b10a8c12d521265bc9.png)

What’s the fix?

Thanks,

A.

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [October 19, 2020, 6:31am UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/5 "2020-10-19T06:31:58Z")

</div>

Hey Adam

> The BBGW was the first board that I was using to start development, then I moved to the fin. So clearly this is now causing an issue.

How do you mean? Are you using the same sd card or something?

Maybe you can try to download the proper `config.json` from the balenaCloud dashboard? You can choose to only download the configuration file when adding a device.  
Otherwise perhaps you can reflash the device if there is no crucial data on the device.

Thanks

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 19, 2020, 12:04pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/7 "2020-10-19T12:04:32Z")

</div>

I think the issue is the other way around Rahul: the dashboard indicates the hardware is BBGW while it is actually a fin. How can I reconcile that?

This is how it happened:

1. I started the project with a BBGW
2. Then I bought a Fin
3. Added the new hardware to the existing application in balenaCloud
4. Tried to upgrade the OS

Thanks,

A.

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [October 19, 2020, 2:03pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/11 "2020-10-19T14:03:48Z")

</div>

Hi Adam, Thanks for the extra info. Please could you clarify what steps you took in step 3?  
E.g. :

Did you perform the “Add new device” step in the dashboard, and if so, did you select “Balena Fin (CM3)” from the dropdown?  
Did you reuse any media from the old device, or did you reflash from scratch? Thank you

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 19, 2020, 2:29pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/13 "2020-10-19T14:29:39Z")

</div>

> Did you perform the “Add new device” step in the dashboard, and if so, did you select “Balena Fin (CM3)” from the dropdown?

It was in May, so I’m not 100% certain about that. I seem to recall that I was unable to choose a hardware platform for an existing application, when adding a new device.

> Did you reuse any media from the old device, or did you reflash from scratch?

Re-flashed from scratch.

A.

---

<div class="post-metadata">

**Author:** ![alanb128](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alanb128/32/2839_2.png) [@alanb128](https://forums.balena.io/u/alanb128)\
**Post date:** [October 19, 2020, 7:28pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/14 "2020-10-19T19:28:41Z")

</div>

Hi Adam, The “Select device type” dropdown on the “Add new device” popup for your application should include the “Balena Fin (CM3)” device type since it is a compatible architecture with the BBGW. Are you able to download a new image of type Balena Fin and re-flash using that?

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 19, 2020, 8:29pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/16 "2020-10-19T20:29:46Z")

</div>

> The “Select device type” dropdown on the “Add new device” popup for your application should include the “Balena Fin (CM3)” device type since it is a compatible architecture with the BBGW.

Is there a way to do this without physical access to the device? Could I just edit the config and perform the upgrade?

Thanks,

A.

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [October 19, 2020, 8:57pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/17 "2020-10-19T20:57:23Z")

</div>

Adam,

I think the short answer is no. You will need to re-provision the device with a valid config.json with the correct device type.

The long answer is that it is possible to edit some values in the config.json file on a device, but it comes with a risk of losing contact with the device:

> **[Configuration - Balena Documentation](https://www.balena.io/docs/reference/OS/configuration/)**
>
> Instructions for editing and customizing config.json for modifying the behavior of balenaOS

  

> **[BalenaOS Masterclass - Balena Documentation](https://www.balena.io/docs/learn/more/masterclasses/host-os-masterclass/#12-advanced-editing-configjson-by-hand)**

However device type isn’t one of the fields mentioned there as editabe.

Phil

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 20, 2020, 6:43pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/19 "2020-10-20T18:43:29Z")

</div>

I was just looking around and found this post:

> [@Application default device type](https://forums.balena.io/t/application-default-device-type/147515/17):
>
> That makes things clear. The issue is that the device is pre-registered with balena device register and you can see that after that point the device shows up in the dashboard with a device type matching the default device type of the application. As a result, when you later use balena config generate you change the device type of the already registered device. Perhaps it might be better to have the CLI error when ---device and --device-type are used together, so that it’s clear which option i…

That would indicate, to me, that reflashing the device isn’t going to change the `deviceType`. Does that mean I will need to re-register the device completely?

Thanks,

A.

---

<div class="post-metadata">

**Author:** ![saintaardvark](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/saintaardvark/32/3390_2.png) [@saintaardvark](https://forums.balena.io/u/saintaardvark)\
**Post date:** [October 20, 2020, 7:37pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/21 "2020-10-20T19:37:25Z")

</div>

Hi Adam – I’m just taking over from my colleague after the end of their shift. Can I ask you to share the application that you’re experiencing this problem with? I want to make sure I have the right info before I answer your question.

Thanks,  
Hugh

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 20, 2020, 7:49pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/22 "2020-10-20T19:49:49Z")

</div>

> [@saintaardvark](#):
>
> Can I ask you to share the application that you’re experiencing this problem with? I want to make sure I have the right info before I answer your question.

It’s application id `XXXXXXX`. Is that what you need?

---

<div class="post-metadata">

**Author:** ![saintaardvark](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/saintaardvark/32/3390_2.png) [@saintaardvark](https://forums.balena.io/u/saintaardvark)\
**Post date:** [October 20, 2020, 7:58pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/23 "2020-10-20T19:58:07Z")

</div>

Hi Adam – apologies, I was unclear; I need you to share the application with support. From the application window, you should see “Actions” on the left hand side; after clicking that, you should see “Grant Support Access”.

Thanks,  
Hugh

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 20, 2020, 8:09pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/24 "2020-10-20T20:09:23Z")

</div>

Ah! Done.

---

<div class="post-metadata">

**Author:** ![saintaardvark](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/saintaardvark/32/3390_2.png) [@saintaardvark](https://forums.balena.io/u/saintaardvark)\
**Post date:** [October 20, 2020, 8:27pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/25 "2020-10-20T20:27:21Z")

</div>

Hi Adam – perfect, thanks very kindly. Looking over the application and the thread, here’s what I would suggest:

- First, when creating a balena application, a default device type is selected; in your case, this was the Beaglebone Green Wireless. When new devices are added to the application through the “Add Device” wizard, this is the type selected by default – and when that image is downloaded and installed, this is what the device will register as. You can select different device types (as long as they’re compatible); the only downside is having to remember to do this each time. We are currently tracking an internal feature request to allow users to change the device type, but this is not yet on our roadmap.

- Because your device is running a version of balenaOS configured as the BBGW, that’s what it has registered with our API as. We do not currently expose a way of changing this on a device.

- The best way to ensure that you’ll be able to upgrade the OS on your Fin is to re-install the OS and re-register the device. If you use the dashboard for this, this would mean selecting the Fin when going through the “Add device” wizard. This will ensure that the device is registered with our API as the correct device type.

- For convenience, you may wish to consider creating another application which does have the correct device; t\if you plan on adding more devices to this application, this would keep you from having to remember to select the correct device type each time.

Can you give that a try and let us know how that works for you?

Thanks,  
Hugh

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 20, 2020, 9:13pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/27 "2020-10-20T21:13:09Z")

</div>

> [@saintaardvark](#):
>
> - The best way to ensure that you’ll be able to upgrade the OS on your Fin is to re-install the OS and re-register the device. If you use the dashboard for this, this would mean selecting the Fin when going through the “Add device” wizard. This will ensure that the device is registered with our API as the correct device type.

I believe I got myself into this situation because I used the CLI to provision the second development device.

I will re-flash in an hour, and will also create a new application as you suggested.

Thanks,

A.

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [October 21, 2020, 1:20am UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/29 "2020-10-21T01:20:08Z")

</div>

I was successful in reflashing the device and all is now right with the world. Thanks!

---

<div class="post-metadata">

**Author:** ![ntzovanis](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ntzovanis/32/1150_2.png) [@ntzovanis](https://forums.balena.io/u/ntzovanis)\
**Post date:** [January 25, 2021, 8:15pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/31 "2021-01-25T20:15:19Z")

</div>

Hello @crbn60 ,

I’m resurfacing this thread because we’ve released a relevant feature that you might find useful. You’re now able to change the device type from within the dashboard by clicking on the “Actions” dropdown menu.

 ![Screen Shot 2021-01-25 at 5.11.16 PM](https://global.discourse-cdn.com/balena/original/2X/0/06a66a023325aca09679fb0d33749cce7bd70cbe.png)

Cheers,  
Nico.

---

<div class="post-metadata">

**Author:** ![crbn60](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/crbn60/32/3671_2.png) [@crbn60](https://forums.balena.io/u/crbn60)\
**Post date:** [January 25, 2021, 8:56pm UTC](https://forums.balena.io/t/failure-to-upgrade-v2-48-0-v2-51-1-rev2-on-a-fin/200242/33 "2021-01-25T20:56:25Z")

</div>

That’s great, thank you for letting me know.

A.
