Deploy to openBalena server fails

Hello,

I am trying to deploy a simple test app to my newly set up openbalena instance, but I am getting this error:

$ DEBUG=1 balena deploy testApp --logs --source .
[debug] original argv0="balena" argv=[/home/vkl/bin/balena-cli/balena,/snapshot/versioned-source/bin/balena,deploy,testApp,--logs,--source,.] length=7
[Debug]   Parsing input...
[Debug]   Loading project...
[Debug]   Resolving project...
[Info]    No "docker-compose.yml" file found at "***/balena/my-app"
[Info]    Creating default composition with source: "***/balena/my-app"
[Debug]   Creating project...
[Info]    Everything is up to date (use --build to force a rebuild)
[Info]    Creating release...
[Debug]   Tagging images...
[Debug]   Authorizing push...
[Debug]   Untagging images...
[Info]    Saving release...
[Error]   Deploy failed
Cannot read property 'Symbol(Symbol.iterator)' of images.push
TypeError: Cannot read property 'Symbol(Symbol.iterator)' of images.push
    at authorizePush (/snapshot/versioned-source/build/utils/compose.js:397:12)
    at createRelease.finally.then.tagServiceImages.tap.getPreviousRepos.then.previousRepos (/snapshot/versioned-source/build/utils/compose.js:456:40)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
From previous event:
    at /snapshot/versioned-source/build/utils/compose.js:456:18
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
From previous event:
    at /snapshot/versioned-source/build/utils/compose.js:452:14
From previous event:
    at Object.deployProject (/snapshot/versioned-source/build/utils/compose.js:449:10)
    at /snapshot/versioned-source/build/actions/deploy.js:104:24
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
From previous event:
    at /snapshot/versioned-source/build/actions/deploy.js:103:22
From previous event:
    at /snapshot/versioned-source/build/actions/deploy.js:86:8
From previous event:
    at deployProject (/snapshot/versioned-source/build/actions/deploy.js:52:72)
    at /snapshot/versioned-source/build/actions/deploy.js:199:16
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
From previous event:
    at /snapshot/versioned-source/build/actions/deploy.js:198:22
From previous event:
    at Command.action (/snapshot/versioned-source/build/actions/deploy.js:195:8)
    at /snapshot/versioned-source/node_modules/capitano/build/command.js:98:37

While that comamnd is running, the server outputs this:

db_1             | 2020-05-05 12:27:04.521 UTC [52] ERROR:  duplicate key value violates unique constraint "service_application_service name_key"
db_1             | 2020-05-05 12:27:04.521 UTC [52] DETAIL:  Key (application, "service name")=(2, main) already exists.
db_1             | 2020-05-05 12:27:04.521 UTC [52] STATEMENT:  INSERT INTO "service" ("application", "service name")
db_1             | 	VALUES ($1, $2) RETURNING "id";

If I try to build one of the example applications I get this:

$ DEBUG=1 balena deploy testApp --logs --source .
[debug] original argv0="balena" argv=[/home/vkl/bin/balena-cli/balena,/snapshot/versioned-source/bin/balena,deploy,testApp,--logs,--source,.] length=7
[Debug]   Parsing input...
[Debug]   Loading project...
[Debug]   Resolving project...
[Debug]   docker-compose.yml file found at "balena/multicontainer-getting-started"
[Debug]   Creating project...
[Info]    Building for amd64/intel-nuc
[Build]   Building services...
[Build]   frontend Preparing...
[Build]   data     Preparing...
[Debug]   Found build tasks:
[Debug]       frontend: build [./frontend]
[Debug]       data: build [./data]
[Debug]   Resolving services with [intel-nuc|amd64]
[Debug]   Found project types:
[Debug]       frontend: Dockerfile.template
[Debug]       data: Dockerfile.template
[Debug]   Prepared tasks; building...
[Build]   data     Step 1/6 : FROM balenalib/intel-nuc-debian-node:10-stretch-run
[Build]   data      ---> ec70d3da962b
[Build]   data     Step 2/6 : WORKDIR /usr/src/app
[Build]   data      ---> Using cache
[Build]   data      ---> a4c68aab40ed
[Build]   frontend Step 1/11 : FROM balenalib/intel-nuc-debian-node:10-stretch-run
[Build]   frontend  ---> ec70d3da962b
[Build]   frontend Step 2/11 : WORKDIR /usr/src/app
[Build]   data     Step 3/6 : COPY package.json package.json
[Build]   frontend  ---> Using cache
[Build]   frontend  ---> a4c68aab40ed
[Build]   frontend Step 3/11 : RUN install_packages wget
[Build]   frontend  ---> Running in 854b0d2abe21
[Build]   frontend Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): 
[Build]   frontend Architecture: Intel 64-bit (x86-64) 
[Build]   frontend OS: Debian Stretch 
[Build]   frontend Variant: run variant 
[Build]   frontend Device: Intel NUC 
[Build]   frontend Device-type:intel-nuc 
[Build]   frontend Default variable(s): UDEV=off 
[Build]   frontend The following software stack is preinstalled: 
[Build]   frontend Node.js v10.20.0, Yarn v1.22.4 
[Build]   frontend Extra features: 
[Build]   data      ---> Using cache
[Build]   data      ---> 7634785c28cd
[Build]   data     Step 4/6 : RUN JOBS=MAX npm install --production
[Build]   data      ---> Running in b163be6dd318
[Build]   data     Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): 
[Build]   data     Architecture: Intel 64-bit (x86-64) 
[Build]   data     OS: Debian Stretch 
[Build]   data     Variant: run variant 
[Build]   data     Device: Intel NUC 
[Build]   data     Device-type:intel-nuc 
[Build]   data     Default variable(s): UDEV=off 
[Build]   data     The following software stack is preinstalled: 
[Build]   data     Node.js v10.20.0, Yarn v1.22.4 
[Build]   data     Extra features: 
[Build]   frontend - Easy way to install packages with `install_packages <package-name>` command 
[Build]   frontend - Run anywhere with cross-build feature  (for ARM only)
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   frontend apt failed, retrying
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   frontend apt failed, retrying
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   data     - Easy way to install packages with `install_packages <package-name>` command 
[Build]   data     - Run anywhere with cross-build feature  (for ARM only)
[Build]   data     npm ERR! code EAI_AGAIN
[Build]   data     npm ERR! errno EAI_AGAIN
[Build]   data     npm ERR! request to https://registry.npmjs.org/express failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
[Build]   data     npm ERR! A complete log of this run can be found in:
[Build]   data     npm ERR!     /root/.npm/_logs/2020-05-05T12_29_06_051Z-debug.log
[Build]   Built 2 services in 0:02
[Error]   Deploy failed
The command '/bin/sh -c install_packages wget' returned a non-zero code: 100
Error: The command '/bin/sh -c install_packages wget' returned a non-zero code: 100
    at Stream.<anonymous> (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:181:23)
    at Stream.stream.write (/snapshot/versioned-source/node_modules/through/index.js:26:11)
    at Stream.ondata (internal/streams/legacy.js:15:31)
    at Stream.emit (events.js:198:13)
    at Stream.EventEmitter.emit (domain.js:448:20)
    at drain (/snapshot/versioned-source/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/snapshot/versioned-source/node_modules/through/index.js:45:5)
    at Parser.exports.parse.parser.onToken (/snapshot/versioned-source/node_modules/JSONStream/index.js:132:18)
    at Parser.proto.write (/snapshot/versioned-source/node_modules/jsonparse/jsonparse.js:135:34)
    at Stream.<anonymous> (/snapshot/versioned-source/node_modules/JSONStream/index.js:23:12)
    at Stream.stream.write (/snapshot/versioned-source/node_modules/through/index.js:26:11)
    at IncomingMessage.ondata (_stream_readable.js:708:20)
    at IncomingMessage.emit (events.js:198:13)
    at IncomingMessage.EventEmitter.emit (domain.js:448:20)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at createBuildStream.Bluebird.try.then (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:73:20)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
    at Builder.createBuildStream (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:72:97)
    at Promise (/snapshot/versioned-source/node_modules/resin-multibuild/build/build.js:82:17)
    at Object.runBuildTask (/snapshot/versioned-source/node_modules/resin-multibuild/build/build.js:59:12)
    at /snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:158:34
    at Generator.next (<anonymous>)
    at __awaiter (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:8:71)
    at new Promise (<anonymous>)
    at __awaiter (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:4:12)
    at performSingleBuild (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:156:12)
    at Bluebird.map (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:141:20)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at Object.<anonymous> (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:140:39)
    at Generator.next (<anonymous>)
    at fulfilled (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:5:58)
From previous event:
    at runCommand (/snapshot/versioned-source/build/app-capitano.js:159:14)
    at Object.exports.run (/snapshot/versioned-source/build/app-capitano.js:171:39)
    at routeCliFramework (/snapshot/versioned-source/build/preparser.js:39:79)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1322:13)
    at startup (internal/bootstrap/node.js:320:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:660:3)

In that case there is no output on the server.

Everything else seems to be working fine. What could be the problem here?

After upgrading the balena CLI to the newest version (11.32.14), the first build succeeds but the second still fails with the same error.

Hello @vegard.lillevoll, great to hear that after updating the cli the first one works. Regarding the second one it seems to be some kind of network error. Can you confirm that your DNS is working correctly and that your firewall isn’t blocking any outgoing requests?

Hello,

How could it be a networking error if one app succeeds and another one fails? I’ve tried several times, and it’s consistent.

DNS seems to be working fine and there shouldn’t be any firewall restricting anything.

Can you tell anything else about what kind of networking error it could be? I could run more specific tests but since there’s at least three devices involved (the one running balenaOS, my laptop and the openBalena server), it’s hard to know where to look.

From the logs you provided there is [Build] frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease Temporary failure resolving 'deb.debian.org' and [Build] data npm ERR! code EAI_AGAIN which are DNS errors. Can you try reaching debian and npm from your openBalena server?

That URL returns a 404 from both the openBalena server and my local computer. No problem with the DNS.

Can you paste here the output of the dig npmjs.com and dig debian.org commands. Maybe try in both places from your computer and your openBalena server.

On server:

balena@localhost:~$ dig npmjs.com

; <<>> DiG 9.9.5-9+deb8u15-Debian <<>> npmjs.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30094
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;npmjs.com.			IN	A

;; ANSWER SECTION:
npmjs.com.		187	IN	A	104.16.93.83
npmjs.com.		187	IN	A	104.16.92.83

;; Query time: 1 msec
;; SERVER: 139.162.131.5#53(139.162.131.5)
;; WHEN: Tue May 05 14:03:19 UTC 2020
;; MSG SIZE  rcvd: 70

balena@localhost:~$ dig debian.org

; <<>> DiG 9.9.5-9+deb8u15-Debian <<>> debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41860
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debian.org.			IN	A

;; ANSWER SECTION:
debian.org.		213	IN	A	149.20.4.15
debian.org.		213	IN	A	130.89.148.77
debian.org.		213	IN	A	128.31.0.62

;; AUTHORITY SECTION:
debian.org.		2950	IN	NS	nsp.dnsnode.net.
debian.org.		2950	IN	NS	dns4.easydns.info.
debian.org.		2950	IN	NS	sec1.rcode0.net.
debian.org.		2950	IN	NS	sec2.rcode0.net.

;; Query time: 2 msec
;; SERVER: 139.162.131.5#53(139.162.131.5)
;; WHEN: Tue May 05 14:03:22 UTC 2020
;; MSG SIZE  rcvd: 192

On local computer:

$ dig npmjs.com

; <<>> DiG 9.11.3-1ubuntu1.8-Ubuntu <<>> npmjs.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15358
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;npmjs.com.			IN	A

;; ANSWER SECTION:
npmjs.com.		300	IN	A	104.16.93.83
npmjs.com.		300	IN	A	104.16.92.83

;; Query time: 7 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue May 05 17:02:04 EEST 2020
;; MSG SIZE  rcvd: 70

$ dig debian.org

; <<>> DiG 9.11.3-1ubuntu1.8-Ubuntu <<>> debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45706
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;debian.org.			IN	A

;; ANSWER SECTION:
debian.org.		180	IN	A	149.20.4.15
debian.org.		180	IN	A	130.89.148.77
debian.org.		180	IN	A	128.31.0.62

;; Query time: 4 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue May 05 17:02:12 EEST 2020
;; MSG SIZE  rcvd: 87

Thanks for that, and everything seems fine. Perhaps as another test you can try a clean build for this application? Does the follow still report the build error?

$ DEBUG=1 balena deploy testApp --build --nocache --logs --source .

Yes, the error seems to be the same

$ DEBUG=1 balena deploy testApp --build --nocache --logs --source .
[debug] original argv0="balena" argv=[/home/vkl/bin/balena-cli/balena,/snapshot/versioned-source/bin/balena,deploy,testApp,--build,--nocache,--logs,--source,.] length=9
[Debug]   Parsing input...
[Debug]   Loading project...
[Debug]   Resolving project...
[Debug]   docker-compose.yml file found at "***/balena/multicontainer-getting-started"
[Debug]   Creating project...
[Info]    Building for amd64/intel-nuc
[Build]   Building services...
[Build]   frontend Preparing...
[Build]   proxy    Preparing...
[Build]   data     Preparing...
[Debug]   Found build tasks:
[Debug]       frontend: build [./frontend]
[Debug]       proxy: build [./haproxy]
[Debug]       data: build [./data]
[Debug]   Resolving services with [intel-nuc|amd64]
[Debug]   Found project types:
[Debug]       frontend: Dockerfile.template
[Debug]       proxy: Architecture-specific Dockerfile
[Debug]       data: Dockerfile.template
[Debug]   Prepared tasks; building...
[Build]   proxy    Step 1/2 : FROM haproxy:1-alpine
[Build]   proxy     ---> e293645c5868
[Build]   proxy    Step 2/2 : COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
[Build]   proxy     ---> 022787ba6357
[Build]   proxy    Successfully built 022787ba6357
[Build]   proxy    Successfully tagged multicontainer-getting-started_proxy:latest
[Build]   data     Step 1/6 : FROM balenalib/intel-nuc-debian-node:10-stretch-run
[Build]   data      ---> ec70d3da962b
[Build]   data     Step 2/6 : WORKDIR /usr/src/app
[Build]   data      ---> Running in b3bb0f0ac611
[Build]   frontend Step 1/11 : FROM balenalib/intel-nuc-debian-node:10-stretch-run
[Build]   frontend  ---> ec70d3da962b
[Build]   frontend Step 2/11 : WORKDIR /usr/src/app
[Build]   frontend  ---> Running in d71c30855c15
[Build]   data     Removing intermediate container b3bb0f0ac611
[Build]   data      ---> 104ef94ed97d
[Build]   frontend Removing intermediate container d71c30855c15
[Build]   frontend  ---> a7d3f276b7b7
[Build]   frontend Step 3/11 : RUN install_packages wget
[Build]   frontend  ---> Running in cd9105553b30
[Build]   frontend Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): 
[Build]   frontend Architecture: Intel 64-bit (x86-64) 
[Build]   frontend OS: Debian Stretch 
[Build]   frontend Variant: run variant 
[Build]   frontend Device: Intel NUC 
[Build]   frontend Device-type:intel-nuc 
[Build]   frontend Default variable(s): UDEV=off 
[Build]   frontend The following software stack is preinstalled: 
[Build]   frontend Node.js v10.20.0, Yarn v1.22.4 
[Build]   frontend Extra features: 
[Build]   frontend - Easy way to install packages with `install_packages <package-name>` command 
[Build]   frontend - Run anywhere with cross-build feature  (for ARM only)
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   frontend apt failed, retrying
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   frontend apt failed, retrying
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
[Build]   frontend W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
[Build]   frontend W: Some index files failed to download. They have been ignored, or old ones used instead.
[Build]   frontend Reading package lists...
[Build]   frontend Building dependency tree...
[Build]   frontend Reading state information...
[Build]   frontend Package wget is not available, but is referred to by another package.
[Build]   frontend This may mean that the package is missing, has been obsoleted, or
[Build]   frontend is only available from another source
[Build]   frontend E: Package 'wget' has no installation candidate
[Build]   data     Step 3/6 : COPY package.json package.json
[Build]   data      ---> 26e65aac07f9
[Build]   data     Step 4/6 : RUN JOBS=MAX npm install --production
[Build]   data      ---> Running in 3bdc27894035
[Build]   data     Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): 
[Build]   data     Architecture: Intel 64-bit (x86-64) 
[Build]   data     OS: Debian Stretch 
[Build]   data     Variant: run variant 
[Build]   data     Device: Intel NUC 
[Build]   data     Device-type:intel-nuc 
[Build]   data     Default variable(s): UDEV=off 
[Build]   data     The following software stack is preinstalled: 
[Build]   data     Node.js v10.20.0, Yarn v1.22.4 
[Build]   data     Extra features: 
[Build]   data     - Easy way to install packages with `install_packages <package-name>` command 
[Build]   data     - Run anywhere with cross-build feature  (for ARM only)
[Build]   data     npm ERR! code EAI_AGAIN
[Build]   data     npm ERR! errno EAI_AGAIN
[Build]   data     npm ERR! request to https://registry.npmjs.org/express failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
[Build]   data     npm ERR! A complete log of this run can be found in:
[Build]   data     npm ERR!     /root/.npm/_logs/2020-05-06T06_09_22_202Z-debug.log
[Build]   Built 3 services in 0:03
[Error]   Deploy failed
The command '/bin/sh -c install_packages wget' returned a non-zero code: 100

Error: The command '/bin/sh -c install_packages wget' returned a non-zero code: 100
    at Stream.<anonymous> (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:181:23)
    at Stream.stream.write (/snapshot/versioned-source/node_modules/through/index.js:26:11)
    at Stream.ondata (internal/streams/legacy.js:15:31)
    at Stream.emit (events.js:198:13)
    at Stream.EventEmitter.emit (domain.js:448:20)
    at drain (/snapshot/versioned-source/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/snapshot/versioned-source/node_modules/through/index.js:45:5)
    at Parser.exports.parse.parser.onToken (/snapshot/versioned-source/node_modules/JSONStream/index.js:132:18)
    at Parser.proto.write (/snapshot/versioned-source/node_modules/jsonparse/jsonparse.js:135:34)
    at Stream.<anonymous> (/snapshot/versioned-source/node_modules/JSONStream/index.js:23:12)
    at Stream.stream.write (/snapshot/versioned-source/node_modules/through/index.js:26:11)
    at IncomingMessage.ondata (_stream_readable.js:708:20)
    at IncomingMessage.emit (events.js:198:13)
    at IncomingMessage.EventEmitter.emit (domain.js:448:20)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at createBuildStream.Bluebird.try.then (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:73:20)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
    at Builder.createBuildStream (/snapshot/versioned-source/node_modules/resin-docker-build/build/builder.js:72:97)
    at Promise (/snapshot/versioned-source/node_modules/resin-multibuild/build/build.js:82:17)
    at Object.runBuildTask (/snapshot/versioned-source/node_modules/resin-multibuild/build/build.js:59:12)
    at /snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:158:34
    at Generator.next (<anonymous>)
    at __awaiter (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:8:71)
    at new Promise (<anonymous>)
    at __awaiter (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:4:12)
    at performSingleBuild (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:156:12)
    at Bluebird.map (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:141:20)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at Object.<anonymous> (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:140:39)
    at Generator.next (<anonymous>)
    at fulfilled (/snapshot/versioned-source/node_modules/resin-multibuild/build/index.js:5:58)
From previous event:
    at runCommand (/snapshot/versioned-source/build/app-capitano.js:79:20)
    at Object.run (/snapshot/versioned-source/build/app-capitano.js:89:41)
    at routeCliFramework (/snapshot/versioned-source/build/preparser.js:44:79)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1322:13)
    at startup (internal/bootstrap/node.js:320:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:660:3)

The problem seems to have been solved after I uninstalled apparmor on my local computer.

That explains the error you were seeing then, great that it got resolved. Let us know if you stumble upon anything else. Have a nice day!