# Balena-cli, balena-engine and SecretRemovalError

**URL:** <https://forums.balena.io/t/balena-cli-balena-engine-and-secretremovalerror/32211>\
**Category:** balenaEngine\
**Created:** [September 16, 2019, 2:44pm UTC](https://forums.balena.io/t/balena-cli-balena-engine-and-secretremovalerror/32211 "2019-09-16T14:44:56Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [September 16, 2019, 10:08pm UTC](https://forums.balena.io/t/balena-cli-balena-engine-and-secretremovalerror/32211/7 "2019-09-16T22:08:32Z")

</div>

@aliasbits, I have tested the command line you mentioned with CLI v11.9.7 (standalone zip package), but I have not got any errors:

```nohighlight
$ balena build --deviceType intel-nuc --arch amd64 --docker /var/run/balena-engine.sock
[Info] Creating default composition with source: /mnt/data/balena-idling
[Info] Building for amd64/intel-nuc
[Build] Built 1 service in 0:16
[Build] main Image size: 41.15 MB
[Success] Build succeeded!

```

Is the issue you are having consistent, or intermittent? The `SecretRemovalError` error can have several underlying the causes. The issues you have linked, and the output you have shared, seem to have different causes:

- [Pull access denied error](https://forums.balena.io/t/pull-access-denied-error/22095): `balenalib/armhf-alpine` image does not exit
- [[Error] Deploy failed](https://forums.balena.io/t/error-deploy-failed/23969): `'/bin/sh -c apk update && apk add jq'` returned a non-zero code: 1
- The stack trace you’ve shared: `read ECONNRESET`

In order to find out where the `ECONNRESET` error you are getting is coming from, it would be helpful to be able to reproduce the error. Perhaps you could share a bit more about your “environment” (machine where you’re running the CLI, how you have installed the CLI, OS version, balenaOS version, if you’re using a VirtualBox VM, etc) and a sample `Dockerfile` or `docker-compose.yml` file that reproduces the error.

By the way, I think that the `--docker /var/run/balena-engine.sock` option you are using is not a common workflow; I imagine you’re either:

- Running balenaEngine on your non-balenaOS development machine (laptop or desktop, e.g. running Ubuntu Linux), or
- Running balena CLI in a container on balenaOS with balenaEngine.

I think neither option above is a common workflow, but I was using the second option to try to use the command line you shared:

```bash
# on a balenaOS host OS prompt on a NUC device or VirtualBox VM:
$ mkdir /mnt/data/cli
$ cd /mnt/data/cli
$ curl -LO https://github.com/balena-io/balena-cli/releases/download/v11.9.7/balena-cli-v11.9.7-linux-x64-standalone.zip
$ unzip balena-cli-v11.9.7-linux-x64-standalone.zip
$ mv balena-cli balena-cli-11.9.7

# now put the device in local mode (https://www.balena.io/docs/learn/develop/local-mode/)
# and create and run an ubuntu:bionic container (on balenaOS)
$ balena-engine run -it -v /mnt/data:/mnt/data -v /var/run/balena-engine.sock:/var/run/balena-engine.sock --network host ubuntu:bionic /bin/bash

# then inside the ubuntu:bionic container powered by balenaEngine/balenaOS
$ cd /mnt/data/
$ git clone https://github.com/balena-io-projects/balena-idling
$ cd balena-idling
$ /mnt/data/cli/balena-cli-11.9.7/balena build --deviceType intel-nuc --arch amd64 --docker /var/run/balena-engine.sock
[Info] Creating default composition with source: /mnt/data/balena-idling
[Info] Building for amd64/intel-nuc
[Build] Built 1 service in 0:16
[Build] main Image size: 41.15 MB
[Success] Build succeeded!

```

I’ve got “build succeeded” using both a “real” NUC computer (running balenaOS 2.32.0+rev4) and also [running the intel-nuc image on a VirtualBox VM](https://www.balena.io/blog/no-hardware-use-virtualbox/) with balenaOS 2.41.1+rev1.

A more common workflow would be to run balenaCLI on your development machine (Mac, Windows or Linux) and select a remote balenaEngine daemon with the `--dockerHost` and `--dockerPort` command-line options (where “remote” could be a development/lab device like a NUC computer on the local network, or a VirtualBox VM running an intel-nuc balenaOS image). In theory however the results should be similar.

---

_[View the full topic](https://forums.balena.io/t/balena-cli-balena-engine-and-secretremovalerror/32211)._
