# Fold on Pi 4 keeps restarting the UI

**URL:** <https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098>\
**Category:** Fold for Covid\
**Created:** [November 25, 2020, 9:57am UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098 "2020-11-25T09:57:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![GOTO\_GOSUB](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/goto_gosub/32/7457_2.png) [@GOTO\_GOSUB](https://forums.balena.io/u/GOTO_GOSUB)\
**Post date:** [November 25, 2020, 9:57am UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/1 "2020-11-25T09:57:08Z")

</div>

Hi Everyone, I wonder if someone can offer me some advice.

I have just set up the Fold client on a 4GB Pi4 having deployed it via my dashboard as per [GitHub - balena-labs-projects/rosetta-at-home](https://github.com/balenalabs/rosetta-at-home). The only change I have made to this was adding my own Rosetta account ID using the “ACCOUNT\_KEY” environment variable before running up the Pi. Everything seems to be going OK in the computational sense but the UI is broken. I cannot connect to the unit’s UI directly or via the public facing IP which reports that a “tunneling socket could not be established: 500”.

Looking at the dashboard I see the UI repeatedly alternating between “Running” and “Downloaded” and the terminal repeatedly showing restarts and disconnects.

> 25.11.20 09:43:35 (+0000)   
> 25.11.20 09:43:35 (+0000) \> foldforcovid-dashboard@1.0.0 start /usr/app/dashboard  
> 25.11.20 09:43:35 (+0000) \> node server.js  
> 25.11.20 09:43:35 (+0000)   
> 25.11.20 09:43:37 (+0000) Service exited ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:37 (+0000) Killed service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:38 (+0000) Installing service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:39 (+0000) Installed service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:39 (+0000) Starting service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:42 (+0000) Started service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:42 (+0000) 2020/11/25 09:43:42 Permitting clients to write input to the PTY.  
> 25.11.20 09:43:42 (+0000) 2020/11/25 09:43:42 Server is starting with command: boinctui  
> 25.11.20 09:43:42 (+0000) 2020/11/25 09:43:42 URL: [http://127.0.0.1:8080/](http://127.0.0.1:8080/)  
> 25.11.20 09:43:42 (+0000) 2020/11/25 09:43:42 URL: (redacted)/  
> 25.11.20 09:43:42 (+0000) 2020/11/25 09:43:42 URL: (redacted)/  
> 25.11.20 09:43:43 (+0000) Killing service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:44 (+0000)   
> 25.11.20 09:43:44 (+0000) \> foldforcovid-dashboard@1.0.0 start /usr/app/dashboard  
> 25.11.20 09:43:44 (+0000) \> node server.js  
> 25.11.20 09:43:44 (+0000)   
> 25.11.20 09:43:46 (+0000) Service exited ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:46 (+0000) Killed service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:48 (+0000) Installing service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:48 (+0000) Installed service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:48 (+0000) Starting service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:50 (+0000) Started service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:50 (+0000) 2020/11/25 09:43:50 Permitting clients to write input to the PTY.  
> 25.11.20 09:43:50 (+0000) 2020/11/25 09:43:50 Server is starting with command: boinctui  
> 25.11.20 09:43:50 (+0000) 2020/11/25 09:43:50 URL: [http://127.0.0.1:8080/](http://127.0.0.1:8080/)  
> 25.11.20 09:43:50 (+0000) 2020/11/25 09:43:50 URL: (redacted)/  
> 25.11.20 09:43:50 (+0000) 2020/11/25 09:43:50 URL: (redacted)/  
> 25.11.20 09:43:52 (+0000) Killing service ‘ui sha256:490(redacted, always the same)174d8’  
> 25.11.20 09:43:52 (+0000)

… over and over again. Trying to stop then restart the UI service from the dashboard results in the service becoming completely inoperable until a reboot when the whole process starts again.

My Fold instance resulted in a host version of balenaOS 2.60.1+rev5, Supervisor 11.14.0, target release f79ec6d. There are no errors or warnings in my health checks or device diagnostics. I am seeing credits appearing against my Rosetta account so the number crunching seems to be OK, it’s just the UI that appears to be broken out of the box.

CPU is at approx 79%, temperature is OK at 69 degrees, memory is 3.1 / 3.8GB and storage 2.6 GB / 27.8 GB.  
Nothing else is running on this Pi at all.

Please, any thoughts or suggestions would be welcomed.

---

<div class="post-metadata">

**Author:** ![gelbal](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/gelbal/32/1109_2.png) [@gelbal](https://forums.balena.io/u/gelbal)\
**Post date:** [November 25, 2020, 2:48pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/2 "2020-11-25T14:48:51Z")

</div>

Hi @GOTO_GOSUB, thanks for setting up the Fold client.

From your description, indeed it sounds like the issue is limited to the UI part of the application. Sounds like we have more users experiencing this issue as I found it reported in the project’s repository site: [https://github.com/balenalabs/rosetta-at-home/issues/55](https://github.com/balenalabs/rosetta-at-home/issues/55)

On the device dashboard, can you go to `Diagnostics` page and `Run checks`?  
It would be good know if a check is failing.

Furthermore, can you open SSH access to HostOS and run the following command to retrieve the supervisor logs?  
`journalctl -fn 100 -u resin-supervisor `

---

<div class="post-metadata">

**Author:** ![GOTO\_GOSUB](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/goto_gosub/32/7457_2.png) [@GOTO\_GOSUB](https://forums.balena.io/u/GOTO_GOSUB)\
**Post date:** [November 25, 2020, 3:45pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/4 "2020-11-25T15:45:54Z")

</div>

Hi @gelbal, thank you for the prompt response.

The diagnostics page does not indicate any errors under “Health Checks” and the results of the “Device Diagnostics” is huge. Therefore I have placed the results of those into text files and placed them on my Google Drive, here:

> **[Balena - Google Drive](https://drive.google.com/drive/folders/1QmcbqAM06jYt8sqCwCU-w8kpJl11kXDZ?usp=sharing)**

Also in that folder you will find the results of the command line instruction you requested.

I hope you find something useful in those files - please let me know if I can do anything else to help you identify the problem.

---

<div class="post-metadata">

**Author:** ![pdcastro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pdcastro/32/1264_2.png) [@pdcastro](https://forums.balena.io/u/pdcastro)\
**Post date:** [November 26, 2020, 4:56pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/23 "2020-11-26T16:56:38Z")

</div>

Thank you for sharing the log files - they were useful 👍  
A colleague (@pipex) was able to reproduce the issue, and the balena team is investigating the root cause in order to fix it. Meanwhile, in case you are interested in a **workaround** step, we found that the problem is avoided by adding `cgroup_enable=memory` to the `cmdline.txt` file. This text file can be found in the `resin-boot` partition of the SD card after it is flashed. Take the SD card out of the Pi, connect the SD card to a laptop / desktop computer, and edit the `cmdline.txt` file in the `resin-boot` partition. (This is easy on macOS, as the Finder app automatically mounts the `resin-boot` partition. On Linux and Windows, additional steps are required - let us know if additional help is needed.) Then insert the SD card to the Pi 4 again.

---

<div class="post-metadata">

**Author:** ![GOTO\_GOSUB](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/goto_gosub/32/7457_2.png) [@GOTO\_GOSUB](https://forums.balena.io/u/GOTO_GOSUB)\
**Post date:** [November 26, 2020, 5:03pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/24 "2020-11-26T17:03:13Z")

</div>

Hi @pdcastro, thank you for taking a look at my log files.

I reckon I can make the required change to the cmdline.txt file so I will give that a go and report back with my findings shortly.

---

<div class="post-metadata">

**Author:** ![GOTO\_GOSUB](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/goto_gosub/32/7457_2.png) [@GOTO\_GOSUB](https://forums.balena.io/u/GOTO_GOSUB)\
**Post date:** [November 27, 2020, 10:58am UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/31 "2020-11-27T10:58:58Z")

</div>

Thank you @pdcastro, your workaround fix is working for me. 👏

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [December 11, 2020, 2:42pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/50 "2020-12-11T14:42:47Z")

</div>

Hi, just to let you know that we have opened a ticket for this issue ([https://github.com/balena-os/balena-raspberrypi/pull/575](https://github.com/balena-os/balena-raspberrypi/pull/575)) and we will notify this thread once it is fixed. We will just add the `cgroup_enable=memory` kernel command line argument by default, which is the same you are now using as a workaround.  
Thanks for letting us know about this problem.

---

<div class="post-metadata">

**Author:** ![GOTO\_GOSUB](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/goto_gosub/32/7457_2.png) [@GOTO\_GOSUB](https://forums.balena.io/u/GOTO_GOSUB)\
**Post date:** [December 11, 2020, 3:13pm UTC](https://forums.balena.io/t/fold-on-pi-4-keeps-restarting-the-ui/216098/52 "2020-12-11T15:13:21Z")

</div>

Thank you for the update, @alexgg. It looks like work is happening on this today.
