DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

Hi there,

thank you guys for making balenaOS! I try to get a simple node.js with the gcloudsdk working but the image can’t be built. This is the message I get from the the balena cli in debug mode:

Error: connect ECONNREFUSED 192.168.2.122:48484
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

(node:23391) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

This is my dockerfile:

FROM balenalib/raspberrypi4-64-alpine-node:8.16.1-3.10-run-20191030

ARG CLOUD_SDK_VERSION=269.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION

ENV PATH /google-cloud-sdk/bin:$PATH
# COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker
RUN apk --no-cache add \
        curl \
        python \
        py-crcmod \
        bash \
        libc6-compat \
        openssh-client \
        git \
        gnupg \
        openssl \ 
    && curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
    tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
    rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
    gcloud config set core/disable_usage_reporting true && \
    gcloud config set component_manager/disable_update_check true && \
    gcloud config set metrics/environment github_docker_image && \
    gcloud --version
VOLUME ["/root/.config"]

WORKDIR /usr/src/app

Does anybody know what I can do to make this work?

Hey,

What balena cli command are you using to try to build with?

balena push mydevice.local in the project directory on my host machine with the Dockerfile in it.

Hi there! Can you confirm your device appears when issuing balena scan ?
Also, can you balena ssh to that device? I 'd confirm the device is online and reachable via that network.
More info on the balena cli commands mentioned above: https://www.balena.io/docs/learn/develop/local-mode/#scan-the-network-and-find-your-device

I can confirm that the device is online and I can balena ssh mydevice.local.

The build process seems to start correct because the balena cli streams for example the curl result from the dockerfile. But at some point it throws the error message shown above. It‘s hard to debug - I can build the image on my local machine without any errors.

I‘ll try balena scan later and give you feedback.

Can you also share the output of systemctl status and balena ps from your device? Thanks

Here is the wished data:

   root@raspi:~# systemctl status
● raspi
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Thu 1970-01-01 00:00:07 UTC; 49 years 10 months ago
   CGroup: /
           ├─init.scope
           │ └─1 /sbin/init
           └─system.slice
             ├─resin-supervisor.service
             │ ├─1387 /bin/sh /usr/bin/start-resin-supervisor
             │ ├─1389 /proc/self/exe --healthcheck /usr/lib/resin-supervisor/resin-supervisor-healthcheck --pid 1387
             │ └─1470 balena start --attach resin_supervisor
             ├─systemd-udevd.service
             │ └─637 /lib/systemd/systemd-udevd
             ├─busybox-syslog.service
             │ └─742 /sbin/syslogd -n
             ├─system-serial\x2dgetty.slice
             │ └─serial-getty@serial0.service
             │   └─736 /sbin/agetty -8 -L serial0 115200 xterm
             ├─docker-878fd7611a9df83193f0e5f485bf2bf0fbe48f900e27ba7d85c27b682e9ba27b.scope
             │ ├─1502 node /usr/src/app/dist/app.js
             │ ├─1537 /usr/bin/dbus-daemon --system
             │ ├─1544 avahi-daemon: running [raspi.local]
             │ └─1545 avahi-daemon: chroot helper
             ├─chronyd.service
             │ └─749 /usr/sbin/chronyd -s -d
             ├─bluetooth.service
             │ └─901 /usr/libexec/bluetooth/bluetoothd --experimental
             ├─wpa_supplicant.service
             │ └─865 /usr/sbin/wpa_supplicant -u
             ├─ModemManager.service
             │ └─744 /usr/sbin/ModemManager --log-journal
             ├─systemd-journald.service
             │ └─514 /lib/systemd/systemd-journald
             ├─NetworkManager.service
             │ └─811 /usr/sbin/NetworkManager --no-daemon
             ├─hciuart.service
             │ └─897 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow - b8:27:eb:a0:a7:52
             ├─dnsmasq.service
             │ └─823 /usr/bin/dnsmasq -x /run/dnsmasq.pid -a 127.0.0.2,10.114.102.1 -7 /etc/dnsmasq.d/ -r /etc/resolv.dnsmasq -z --servers-file=/run/dnsmasq.servers -k --log-facility=-
             ├─system-sshd.slice
             │ └─sshd@0-2003:e9:2f0e:37e5:5c5b:a770:bb43:7c73:22222-2003:e9:2f0e:37e5:11b4:c53f:1e19:fcda:56477.service
             │   ├─1131 sshd: root@pts/1
             │   ├─1150 -sh
             │   ├─1732 systemctl status
             │   └─1733 less
             ├─balena.service
             │ ├─ 824 /usr/bin/balenad --experimental --log-driver=journald -s overlay2 -H fd:// -H unix:///var/run/balena.sock -H unix:///var/run/balena-engine.sock -H tcp://0.0.0.0:2375 --dns 10.114.>             │ ├─ 826 /proc/self/exe --healthcheck /usr/lib/balena/balena-healthcheck --pid 824
             │ ├─ 872 balena-engine-containerd --config /var/run/balena-engine/containerd/containerd.toml --log-level info
             │ └─1483 balena-engine-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/878fd7611a9df83193f0e5f485bf2bf0fbe48f900e27ba7d85c27b>             ├─busybox-klogd.service
             │ └─748 /sbin/klogd -n
             ├─dbus.service
             │ └─745 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             ├─system-getty.slice
             │ └─getty@tty1.service
             │   └─750 /sbin/agetty -o -p -- \u --noclear tty1 linux
             ├─plymouth-start.service
             │ └─711 @sbin/plymouthd --tty=tty1 --mode=boot --pid-file=/run/plymouth/pid --attach-to-session --kernel-command-line=plymouth.ignore-serial-consoles splash
             ├─avahi-daemon.service
             │ ├─813 avahi-daemon: running [raspi.local]
             │ └─814 avahi-daemon: chroot helper
             └─systemd-logind.service
               └─738 /lib/systemd/systemd-logind


root@raspi:~# balena ps
CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS                                     PORTS               NAMES
878fd7611a9d        balena/aarch64-supervisor:v10.3.7   "./entry.sh"        23 hours ago        Up Less than a second (health: starting)                       resin_supervisor

This is the whole log:

➜ balena push raspi.local
[Info]    Starting build on device raspi.local
[Info]    Creating default composition with source: .
[Build]   [main] Step 1/14 : FROM balenalib/raspberrypi4-64-alpine-node:8.16.1-3.10-run-20191030
[Build]   [main]  ---> 16a0abe1d74d
[Build]   [main] Step 2/14 : ARG CLOUD_SDK_VERSION=269.0.0
[Build]   [main]  ---> Using cache
[Build]   [main]  ---> 92e4269d9dd0
[Build]   [main] Step 3/14 : ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
[Build]   [main]  ---> Using cache
[Build]   [main]  ---> f2799cd3d244
[Build]   [main] Step 4/14 : ENV PATH /google-cloud-sdk/bin:$PATH
[Build]   [main]  ---> Using cache
[Build]   [main]  ---> b57d1708efb5
[Build]   [main] Step 5/14 : RUN apk --no-cache add         curl         python         py-crcmod         bash         libc6-compat         openssh-client         git         gnupg         openssl     && curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz &&     tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz &&     rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz &&     gcloud config set core/disable_usage_reporting true &&     gcloud config set component_manager/disable_update_check true &&     gcloud config set metrics/environment github_docker_image &&     gcloud --version
[Build]   [main]  ---> Running in 5a2093c8b12f
[Build]   [main] fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/aarch64/APKINDEX.tar.gz
[Build]   [main] fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/aarch64/APKINDEX.tar.gz
[Build]   [main] (1/11) Installing pcre2 (10.33-r0)
[Build]   [main] (2/11) Installing git (2.22.0-r0)
[Build]   [main] (3/11) Installing libc6-compat (1.1.22-r3)
[Build]   [main] (4/11) Installing openssh-keygen (8.1_p1-r0)
[Build]   [main] (5/11) Installing libedit (20190324.3.1-r0)
[Build]   [main] (6/11) Installing openssh-client (8.1_p1-r0)
[Build]   [main] (7/11) Installing openssl (1.1.1d-r0)
[Build]   [main] (8/11) Installing py-crcmod (1.7-r2)
[Build]   [main] (9/11) Installing gdbm (1.13-r1)
[Build]   [main] (10/11) Installing python2 (2.7.16-r1)
[Build]   [main] (11/11) Installing py2-crcmod (1.7-r2)
[Build]   [main] Executing busybox-1.30.1-r2.trigger
[Build]   [main] OK: 114 MiB in 87 packages
[Build]   [main]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[Build]                                    Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 16 28.4M   16 4815k    0     0  4334k 
[Build]   [main]      0  0:00:06  0:00:01  0:00:0
[Build]   [main] 5 4330k
 34 28.4M   34  9.9M    0     0  4789k      0  0
[Build]   [main] :00:06  0:00:02  0:00:04 4787k
 54 28.4M   54 1 
[Build]   [main] 5.4M    0     0  5105k      0  0:00:05  0:00:03  0:00:02 5103k
 70 28.4M   70 20.0M    0     0  5003k      0  0:00
[Build]   [main] :05  0:00:04  0:00:01 5003k
 89 28.4M   89 25.5M    0     0  5122k      0  0:00:05  0:00:05 --:--:-- 5241k
100 28.4M  100 28.4M    0     0  5219k   
[Build]   [main]    0  0:00:05  0:00:05 --:--:-- 5438k
[Build]   [main] 
[Build]   
ECONNREFUSED: connect ECONNREFUSED 192.168.2.122:48484

Thank you guys!

Hi there,

It seems like the supervisor is having trouble starting up cleanly. I would recommend running the checks to see if anything is obviously wrong (available in the dashboard on the left navigation column at the bottom, or dashboard.balena-cloud.com/devices/{{UUID}}/diagnostics. If nothing is obviously amiss (via the checks interface), you can use the Device Diagnostics tab to grab some logs for further analysis.

Please let us know the results!

Hey there,

I just use balenaOS without cloud. So, any other ideas? :frowning:

Could you paste the output of journalctl -f -u resin-supervisor -n 1000 please? That might give us some insight into why the supervisor is failing.

Ah… now there seems to be the error:

Nov 07 19:41:41 raspi resin-supervisor[1347]: [success] Device state apply success
Nov 07 19:43:57 raspi resin-supervisor[1347]: [api] GET /ping 200 - 9.770 ms
Nov 07 19:43:57 raspi resin-supervisor[1347]: [api] GET /v2/version 200 - 53.431 ms
Nov 07 19:44:00 raspi resin-supervisor[1347]: [api] GET /v2/local/device-info 200 - 15.660 ms
Nov 07 19:46:38 raspi resin-supervisor[1347]: [api] GET /v1/healthy 200 - 12.664 ms
Nov 07 19:47:14 raspi resin-supervisor[1347]: time="2019-11-07T19:47:14.332387967Z" level=error msg="error waiting for container: unexpected EOF"
Nov 07 19:47:14 raspi systemd[1]: resin-supervisor.service: Main process exited, code=exited, status=125/n/a
Nov 07 19:47:14 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:47:30 raspi resin-supervisor[1817]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:47:30 raspi resin-supervisor[1825]: activating
Nov 07 19:47:30 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:47:30 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:47:30 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:48:23 raspi resin-supervisor[1869]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:48:23 raspi resin-supervisor[1877]: activating
Nov 07 19:48:23 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:48:23 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:48:23 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:48:43 raspi resin-supervisor[1922]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:48:43 raspi resin-supervisor[1931]: activating
Nov 07 19:48:43 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:48:43 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:48:43 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:49:56 raspi resin-supervisor[1974]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:49:56 raspi resin-supervisor[1982]: activating
Nov 07 19:49:56 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:49:56 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:49:56 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:51:07 raspi resin-supervisor[2029]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:51:07 raspi resin-supervisor[2037]: inactive
Nov 07 19:51:07 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:51:07 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:51:07 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:52:11 raspi resin-supervisor[2084]: Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?
Nov 07 19:52:11 raspi resin-supervisor[2093]: activating
Nov 07 19:52:11 raspi systemd[1]: resin-supervisor.service: Control process exited, code=exited, status=3/NOTIMPLEMENTED
Nov 07 19:52:11 raspi systemd[1]: resin-supervisor.service: Failed with result 'exit-code'.
Nov 07 19:52:11 raspi systemd[1]: Failed to start Resin supervisor.
Nov 07 19:53:54 raspi resin-supervisor[2537]: resin_supervisor
Nov 07 19:53:54 raspi resin-supervisor[2580]: active
Nov 07 19:53:56 raspi resin-supervisor[2581]: Container config has not changed
Nov 07 19:54:01 raspi resin-supervisor[2581]: Starting system message bus: dbus.
Nov 07 19:54:01 raspi resin-supervisor[2581]: * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
Nov 07 19:54:01 raspi resin-supervisor[2581]: ...done.
Nov 07 19:54:03 raspi resin-supervisor[2581]: [info] Supervisor v10.3.7 starting up...

What does this line mean?

Nov 07 19:47:14 raspi resin-supervisor[1347]: time="2019-11-07T19:47:14.332387967Z" level=error msg="error waiting for container: unexpected EOF"

I can build the Dockerfile on macOS without any erros. Do I need to convert LF or something like this?

It looks like the engine is having some problems, That error you highlighted is often reported when the engine crashes. Could you paste the output of journalctl -f -u balena -n 1000 please? This should point to the issue.

balena.log (232.3 KB)

Sure, I attached the output.

Yeah the engine is certainly having some problems, I’ll ask our engine maintainer to take a look, as I can’t see the problem right now.

1 Like

It looks like containerd (the component that actually runs all the containers on the device) isn’t coming up correctly… I can see stacktraces from it in those engine logs

It also looks like we’re missing the beginning of the stacktrace. It would be helpful to have that too. Can you let me know which version of balenaOS you’re running?