# How to revert the supervisor upgrade?

**URL:** <https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195>\
**Category:** Product support\
**Created:** [June 24, 2022, 2:12pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195 "2022-06-24T14:12:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [June 24, 2022, 2:12pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/1 "2022-06-24T14:12:58Z")

</div>

Upgraded the supervisor, now I’m not able to ssh into the containers, is there a way of reverting the supervisor upgrade?

---

<div class="post-metadata">

**Author:** ![aethernet](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/aethernet/32/7578_2.png) [@aethernet](https://forums.balena.io/u/aethernet)\
**Post date:** [June 24, 2022, 2:22pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/2 "2022-06-24T14:22:11Z")

</div>

Hello @vedyilmaz

Can you tell us more about what’s happening ?  
Are you sure the containers runs properly?

---

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [June 24, 2022, 2:38pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/4 "2022-06-24T14:38:05Z")

</div>

Thanks for your response, The device was running of supervisor version 11.x and I upgraded it to the latest one then I lost ssh access to the containers using balena-cli and on balena terminal window. I purged to re-deploy the fleet but no success so far. I can access to the host. May reverting the supervisor to the previous version would help if it’s possible.

```auto
root@3f2326c:~# systemctl status resin-supervisor
● resin-supervisor.service - Balena supervisor
   Loaded: loaded (/lib/systemd/system/resin-supervisor.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-06-24 14:28:33 UTC; 8min ago
  Process: 563 ExecStartPre=/usr/bin/balena stop resin_supervisor (code=exited, status=0/SUCCESS)
  Process: 769 ExecStartPre=/bin/systemctl is-active balena.service (code=exited, status=0/SUCCESS)
 Main PID: 770 (start-resin-sup)
    Tasks: 11 (limit: 4709)
   Memory: 10.6M
   CGroup: /docker/67fe366d02e8fc880cfbb6ffdd6f7a8677ef61bbda3c4ae8405b736a9097a8b1/system.slice/resin-supervisor.service
           ├─770 /bin/sh /usr/bin/start-resin-supervisor
           ├─772 /proc/self/exe --healthcheck /usr/lib/resin-supervisor/resin-supervisor-healthcheck --pid 770
           └─841 balena start --attach resin_supervisor

Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Unable to get architecture: Error: ENOENT: no such file or directory, open '/mnt/root/mnt/boot/device-type.json'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Unable to get device type: Error: ENOENT: no such file or directory, open '/mnt/root/mnt/boot/device-type.json'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Unable to get device type: Error: ENOENT: no such file or directory, open '/mnt/root/mnt/boot/device-type.json'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Unable to get architecture: Error: ENOENT: no such file or directory, open '/mnt/root/mnt/boot/device-type.json'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [warn] Could not initialise splash image backend Error: ENOENT: no such file or directory, scandir '/mnt/root/mnt/boot/splash'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [warn] Failed to read splash image: Error: ENOENT: no such file or directory, open '/mnt/root/mnt/boot/splash/balena-logo-default.png'
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Scheduling another update attempt in 512000ms due to failure: InternalInconsistencyError: Unknown device architecture unknown. Could not find matching supervisor metadata.
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] at Object.exports.getSupervisorMetadata.memoizee.promise (/usr/src/app/dist/app.js:10:2687348)
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] Device state apply error InternalInconsistencyError: Unknown device architecture unknown. Could not find matching supervisor metadata.
Jun 24 14:37:12 3f2326c resin-supervisor[770]: [error] at Object.exports.getSupervisorMetadata.memoizee.promise (/usr/src/app/dist/app.js:10:2687348)

```

---

<div class="post-metadata">

**Author:** ![pipex](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pipex/32/4840_2.png) [@pipex](https://forums.balena.io/u/pipex)\
**Post date:** [June 24, 2022, 5:52pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/7 "2022-06-24T17:52:12Z")

</div>

Hi @vedylmaz, I suspect some corruption may have happened in the file `/mnt/boot/device-type.json`. It is strange that this is preventing you from SSHing into the containers as that feature does not depend on the supervisor.

Could you provide the following information for me?

- What is your OS version?
- What is the previous supervisor version?
- What is the newer supervisor version you are upgrading to?
- What is the result of running the command `cat /mnt/boot/device-type.json` on the host OS terminal?
- What is the output of the command `balena ps`

Thank you

---

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [June 25, 2022, 10:34am UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/9 "2022-06-25T10:34:48Z")

</div>

Hi Felipe,  
It’s running balenaOS 2.50.1+rev1. The device type is Intel NUC, there is no /mnt/boot/device-type.json file and seems supervisor 14.0.6 is complaining It cannot find it. The previous supervisor version was 11.4.10 and I would like to revert to it. I tried changing the image to 11.4.10 image on /etc/resin-supervisor/supervisor.conf ([registry2.balena-cloud.com/v2/e48a6f881298587edde22b62cc500295](http://registry2.balena-cloud.com/v2/e48a6f881298587edde22b62cc500295)) but it reverts to 14.0.6 image later on.

```auto
root@3f2326c:~# balena ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1855ea0afe18 registry2.balena-cloud.com/v2/5335fb2a14f2871a5be88f234500311f:latest "/usr/src/app/entry.…" 11 hours ago Up 11 hours (healthy) resin_supervisor
4fec985a2eb5 b90cda6b81c8 "/usr/bin/entry.sh b…" 20 hours ago Up 11 hours desigo_4291255_1996334

```

Where is it keeping the supervisor version? Maybe if we change it to the old version it will be fixed.

---

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [June 27, 2022, 10:35am UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/10 "2022-06-27T10:35:46Z")

</div>

I was able to downgrade the supervisor by doing the following:

1. replaced the image on /etc/resin-supervisor/supervisor.conf with the target supervisor version image
2. replaced the image on /tmp/update-supervisor.conf with the target supervisor version image
3. removed all the containers: balena rm container-id
4. systemctl stop resin-supervisor
5. rm -v /mnt/data/resin-data/resin-supervisor/database.sqlite
6. systemctl start resin-supervisor  
All the containers are added and the supervisor version 11.4.10 is running now.

---

<div class="post-metadata">

**Author:** ![pipex](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pipex/32/4840_2.png) [@pipex](https://forums.balena.io/u/pipex)\
**Post date:** [July 19, 2022, 9:00pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/11 "2022-07-19T21:00:54Z")

</div>

Hi @vedyilmaz,

Sorry for the delayed response. Glad you were able to find a way to downgrade the supervisor. I am very intrigued by how did you get this error in the first place. You point out that `/mnt/boot/device-type.json` does not exists on your device, but on a freshly booted image for balenaOS 2.50.1+rev1 the file is there. Did you update this device from a previous balenaOS version at some point?

If you are interested in retrying the supervisor update, one thing you could do is to try to recreate the file and re-try the update. I think the commands I share below should be enough. Please let us know if this works for you

```auto
root@4076c29:~# cat << EOF | jq . > /tmp/device-type.json
> { "slug": "intel-nuc", "arch": "amd64" }
> EOF
root@4076c29:~# cat /tmp/device-type.json
{
  "slug": "intel-nuc",
  "arch": "amd64"
}
root@4076c29:~# cp /tmp/device-type.json /mnt/boot/

```

---

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [July 19, 2022, 9:43pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/14 "2022-07-19T21:43:21Z")

</div>

Hi Felipe,  
Thanks for your response. The issue is that the device is of type Intel NUC running a qemu image and on this type of installation the file is located on another directory, I needed to copy it from its location to /mnt/boot/device-type.json and all is good now. This looks like a bug. Thanks.

---

<div class="post-metadata">

**Author:** ![pipex](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pipex/32/4840_2.png) [@pipex](https://forums.balena.io/u/pipex)\
**Post date:** [July 19, 2022, 11:11pm UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/15 "2022-07-19T23:11:24Z")

</div>

Oh, so you are using a qemu image? This does sound like a bug in that balenaOS qemu version (I haven’t been able tot est this yet though). However we are phasing out qemu images in favor of generic x86/aarch64 images. I would recommend switching to one of those newer images if possible.

Glad that copying the file fixed the issue for the moment.

---

<div class="post-metadata">

**Author:** ![vedyilmaz](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vedyilmaz](https://forums.balena.io/u/vedyilmaz)\
**Post date:** [July 20, 2022, 7:21am UTC](https://forums.balena.io/t/how-to-revert-the-supervisor-upgrade/359195/17 "2022-07-20T07:21:42Z")

</div>

Good to know that you’re phasing out qemu images and we’ll probably be test and switch to generic x86/aarch64 images. Thanks.
