balena push balena.local gives error socket hang up after build stage

Hi, I’m trying to get Balena OS working on a Raspberry PI 4 and it seems that the supervisor is hanging after the build stage of the balena push command. I’m certain that I have something wrong, but I’m not sure what.

Here is what I’ve done so far:

Setup the Image

$ sudo balena local configure raspberrypi4-64-2.105.21-v14.2.10.img
? Network SSID ****
? Network Key ****
? Enable development mode? (Open ports and root access - Not for production!) Yes
? Do you want to set advanced settings? Yes
? Device Hostname balena
? Do you want to enable persistent logging? No
Done!

Flash the Image (with Balena Etcher)

OK…

Boot the PI4

$ balena ssh balena.local
root@balena:~# balena-engine version
Client:
Version: 20.10.17
API version: 1.41
Go version: go1.16.2
Git commit: 13db38c82bdb056f013f5497b0662ad34ffb98f7
Built: Wed Sep 7 14:53:20 2022
OS/Arch: linux/arm64
Context: default
Experimental: true

Server:
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.16.2
Git commit: 13db38c82bdb056f013f5497b0662ad34ffb98f7
Built: Wed Sep 7 14:53:20 2022
OS/Arch: linux/arm64
Experimental: true
containerd:
Version: 1.4.0+unknown
GitCommit:
runc:
Version: spec: 1.0.2-dev
GitCommit:
balena-engine-init:
Version: 0.13.0
GitCommit: 949e6fa-dirty

Deploy the Hello World for Python

git/balena-python-hello-world$ balena push balena.local
[Info] Starting build on device 192.168.0.60
[Build] [balena-hello-world] Step 1/9 : FROM balenalib/raspberrypi4-64-python:3-stretch-run
[Build] [balena-hello-world] —> 5f41c7def93e
[Build] [balena-hello-world] Step 2/9 : WORKDIR /usr/src/app
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in 2df7cf93c165
[Build] [balena-hello-world] Removing intermediate container 2df7cf93c165
[Build] [balena-hello-world] —> 1e351761970b
[Build] [balena-hello-world] Step 3/9 : COPY requirements.txt requirements.txt
[Build] [balena-hello-world] —> 990c3798115a
[Build] [balena-hello-world] Step 4/9 : RUN pip install -r requirements.txt
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in de1e5e1933f2
[Build] [balena-hello-world] Here are a few details about this Docker image (For more information please visit Balena base images - Balena Documentation):
[Build] Architecture: ARM v8
[Build] OS: Debian Stretch
[Build] Variant: run variant
[Build] Default variable(s): UDEV=off
[Build] The following software stack is preinstalled:
[Build] Python v3.6.14, Pip v21.2.3, Setuptools v57.4.0
[Build] Extra features:
[Build] - Easy way to install packages with install_packages <package-name> command
[Build] - Run anywhere with cross-build feature (for ARM only)
[Build] - Keep the container idling with balena-idle command
[Build] - Show base image details with balena-info command
[Build] [balena-hello-world] Collecting click==8.0.3
[Build] [balena-hello-world] Downloading click-8.0.3-py3-none-any.whl (97 kB)
[Build] [balena-hello-world] Collecting Flask==2.0.2
[Build] [balena-hello-world] Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
[Build] [balena-hello-world] Collecting itsdangerous==2.0.1
[Build] [balena-hello-world] Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
[Build] [balena-hello-world] Collecting Jinja2==3.0.2
[Build] [balena-hello-world] Downloading Jinja2-3.0.2-py3-none-any.whl (133 kB)
[Build] [balena-hello-world] Collecting MarkupSafe==2.0.1
[Build] [balena-hello-world] Downloading MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26 kB)
[Build] [balena-hello-world] Collecting Werkzeug==2.0.2
[Build] [balena-hello-world] Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
[Build] [balena-hello-world] Collecting importlib-metadata
[Build] [balena-hello-world] Downloading importlib_metadata-4.8.3-py3-none-any.whl (17 kB)
[Build] [balena-hello-world] Collecting dataclasses
[Build] [balena-hello-world] Downloading dataclasses-0.8-py3-none-any.whl (19 kB)
[Build] [balena-hello-world] Collecting zipp>=0.5
[Build] [balena-hello-world] Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
[Build] [balena-hello-world] Collecting typing-extensions>=3.6.4
[Build] [balena-hello-world] Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
[Build] [balena-hello-world] Installing collected packages: zipp, typing-extensions, MarkupSafe, importlib-metadata, dataclasses, Werkzeug, Jinja2, itsdangerous, click, Flask
[Build] [balena-hello-world] Successfully installed Flask-2.0.2 Jinja2-3.0.2 MarkupSafe-2.0.1 Werkzeug-2.0.2 click-8.0.3 dataclasses-0.8 importlib-metadata-4.8.3 itsdangerous-2.0.1 typing-extensions-4.1.1 zipp-3.6.0
[Build] [balena-hello-world] WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.11.0 documentation
[Build]
[Build] [balena-hello-world] WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
[Build] You should consider upgrading via the ‘/usr/local/bin/python3.6 -m pip install --upgrade pip’ command.
[Build]
[Build] [balena-hello-world] Removing intermediate container de1e5e1933f2
[Build] [balena-hello-world] —> e061f4b71dea
[Build] [balena-hello-world] Step 5/9 : COPY . ./
[Build] [balena-hello-world] —> 3ccea9331fa1
[Build] [balena-hello-world] Step 6/9 : ENV UDEV=1
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in f2dc4986c912
[Build] [balena-hello-world] Removing intermediate container f2dc4986c912
[Build] [balena-hello-world] —> 97529f4488f2
[Build] [balena-hello-world] Step 7/9 : CMD [“python”,“-u”,“src/app.py”]
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in e95cef3a7c39
[Build] [balena-hello-world] Removing intermediate container e95cef3a7c39
[Build] [balena-hello-world] —> 2658a85822bd
[Build] [balena-hello-world] Step 8/9 : LABEL io.resin.local.image=1
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in 396b4ec8bbfd
[Build] [balena-hello-world] Removing intermediate container 396b4ec8bbfd
[Build] [balena-hello-world] —> a58e8e219a27
[Build] [balena-hello-world] Step 9/9 : LABEL io.resin.local.service=balena-hello-world
[Build] [balena-hello-world] —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[Build] [balena-hello-world] —> Running in 82642ba9bb22
[Build] [balena-hello-world] Removing intermediate container 82642ba9bb22
[Build] [balena-hello-world] —> 100c6754804d
[Build] [balena-hello-world] Successfully built 100c6754804d
[Build] [balena-hello-world] Successfully tagged local_balena-hello-world:latest

Retrying “Supervisor API (POST http://192.168.0.60:48484/v2/local/target-state)” after 2.0s (1 of 5) due to: Error: socket hang up
Retrying “Supervisor API (POST http://192.168.0.60:48484/v2/local/target-state)” after 4.0s
Retrying “Supervisor API (POST http://192.168.0.60:48484/v2/local/target-state)” after 31s (5 of 5) due to: Error: socket hang up
ECONNRESET: socket hang up

Here are some logs collected from the device.

debug notes.txt (30.3 KB)