Sandbox error under VirtualBox

I am having issues with my sandbox:

$ ./sandbox up -v



Starting default sandbox: release

.clean file found in sandbox directory. Rebuilding images...

* docker compose build --no-cache

DEBU[0000] using default config store "/home/lipi/.docker/buildx" 

[+] Building 88.3s (21/22)                                                      

 => [sandbox-algod internal] load build definition from Dockerfile         0.2s

 => => transferring dockerfile: 1.50kB                                     0.1s

 => [sandbox-indexer internal] load build definition from Dockerfile       0.1s

 => => transferring dockerfile: 611B                                       0.1s

 => [sandbox-algod internal] load .dockerignore                            0.1s

 => => transferring context: 34B                                           0.1s

 => [sandbox-indexer internal] load .dockerignore                          0.1s

 => => transferring context: 34B                                           0.1s

 => [sandbox-algod internal] load metadata for docker.io/library/golang:1  4.4s

 => [sandbox-indexer internal] load metadata for docker.io/library/golang  4.0s

 => [sandbox-indexer 1/7] FROM docker.io/library/golang:1.17.5-alpine@sha  0.0s

 => [sandbox-indexer internal] load build context                          0.2s

 => => transferring context: 196B                                          0.2s

 => CACHED [sandbox-indexer 2/7] WORKDIR /opt/indexer                      0.0s

 => [sandbox-indexer 3/7] RUN apk add --no-cache git bzip2 make bash lib  29.1s

 => CACHED [sandbox-algod 1/7] FROM docker.io/library/golang:1.17.5@sha25  0.0s

 => [sandbox-algod internal] load build context                            0.3s

 => => transferring context: 114.22kB                                      0.2s

 => [sandbox-algod 2/7] RUN echo "Installing from source.  -- "            1.6s

 => [sandbox-algod 3/7] RUN apt-get update && apt-get install -y apt-uti  21.9s

 => [sandbox-algod 4/7] COPY . /tmp                                        0.2s

 => [sandbox-algod 5/7] RUN /tmp/images/algod/install.sh     -d "/node"   54.4s

 => [sandbox-indexer 4/7] COPY images/indexer/disabled.go /tmp/disabled.g  0.1s

 => [sandbox-indexer 5/7] COPY images/indexer/start.sh /tmp/start.sh       0.1s

 => [sandbox-indexer 6/7] COPY images/indexer/install.sh /tmp/install.sh   0.1s

 => CANCELED [sandbox-indexer 7/7] RUN /tmp/install.sh                    53.3s

 => ERROR [sandbox-algod 6/7] RUN sed -i "s/NETWORK_NUM_ROUNDS/300000/" "  3.4s

------

 > [sandbox-algod 6/7] RUN sed -i "s/NETWORK_NUM_ROUNDS/300000/" "//tmp/images/algod/template.json" &&  /tmp/images/algod/setup.py  --bin-dir "/node"  --data-dir "/opt/data"  --start-script "/opt/start_algod.sh"  --network-dir "/opt/testnetwork"  --network-template "//tmp/images/algod/template.json"  --network-token "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"  --algod-port "4001"  --kmd-port "4002"  --bootstrap-url ""  --genesis-file "/tmp/"  --archival "":

#0 2.936 /bin/sh: 1: /node/goal: not found

#0 2.956 Configuring network with the following arguments:

#0 2.956 {   'algod_port': '4001',

#0 2.956     'archival': False,

#0 2.956     'bin_dir': '/node',

#0 2.956     'bootstrap_url': '',

#0 2.956     'data_dir': '/opt/data',

#0 2.956     'genesis_file': '/tmp/',

#0 2.956     'kmd_port': '4002',

#0 2.956     'network_dir': '/opt/testnetwork',

#0 2.956     'network_template': '//tmp/images/algod/template.json',

#0 2.956     'network_token': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',

#0 2.956     'start_script': '/opt/start_algod.sh'}

#0 2.956 Creating a private network.

#0 2.957 Traceback (most recent call last):

#0 2.957   File "/tmp/images/algod/setup.py", line 130, in <module>

#0 2.969     startCommands = create_private_network(args.bin_dir, args.network_dir, args.network_template)

#0 2.972   File "/tmp/images/algod/setup.py", line 89, in create_private_network

#0 2.981     subprocess.check_call(['%s/goal network create -n sandnet -r %s -t %s' % (bin_dir, network_dir, template)], shell=True)

#0 2.982   File "/usr/lib/python3.9/subprocess.py", line 373, in check_call

#0 2.989     raise CalledProcessError(retcode, cmd)

#0 2.995 subprocess.CalledProcessError: Command '['/node/goal network create -n sandnet -r /opt/testnetwork -t //tmp/images/algod/template.json']' returned non-zero exit status 127.

------

DEBU[0000] serving grpc connection                      

DEBU[0000] stopping session                              span="load buildkit capabilities"

DEBU[0000] serving grpc connection                      

DEBU[0001] serving grpc connection                      

DEBU[0091] stopping session                              span=sandbox-algod

DEBU[0091] stopping session                              span=sandbox-indexer

failed to solve: executor failed running [/bin/sh -c sed -i "s/NETWORK_NUM_ROUNDS/$NETWORK_NUM_ROUNDS/" "//tmp/${TEMPLATE}" &&  /tmp/images/algod/setup.py  --bin-dir "$BIN_DIR"  --data-dir "/opt/data"  --start-script "/opt/start_algod.sh"  --network-dir "/opt/testnetwork"  --network-template "//tmp/${TEMPLATE}"  --network-token "${TOKEN}"  --algod-port "${ALGOD_PORT}"  --kmd-port "${KMD_PORT}"  --bootstrap-url "${BOOTSTRAP_URL}"  --genesis-file "/tmp/${GENESIS_FILE}"  --archival "${NODE_ARCHIVAL}"]: exit code: 1

lipi@lipi-VirtualBox:~/Downloads/sandbox$ mc



lipi@lipi-VirtualBox:~/Downloads/sandbox$ ./sandbox clean



Cleaning up sandbox environment...

lipi@lipi-VirtualBox:~/Downloads/sandbox$ ./sandbox up -v



Starting default sandbox: release

.clean file found in sandbox directory. Rebuilding images...

* docker compose build --no-cache

DEBU[0000] using default config store "/home/lipi/.docker/buildx" 

[+] Building 82.9s (21/22)                                                      

 => [sandbox-indexer internal] load build definition from Dockerfile       0.1s

 => => transferring dockerfile: 611B                                       0.1s

 => [sandbox-algod internal] load build definition from Dockerfile         0.1s

 => => transferring dockerfile: 1.50kB                                     0.1s

 => [sandbox-indexer internal] load .dockerignore                          0.1s

 => => transferring context: 34B                                           0.1s

 => [sandbox-algod internal] load .dockerignore                            0.1s

 => => transferring context: 34B                                           0.1s

 => [sandbox-indexer internal] load metadata for docker.io/library/golang  2.2s

 => [sandbox-algod internal] load metadata for docker.io/library/golang:1  1.9s

 => [sandbox-algod internal] load build context                            0.3s

 => => transferring context: 114.22kB                                      0.3s

 => CACHED [sandbox-algod 1/7] FROM docker.io/library/golang:1.17.5@sha25  0.0s

 => [sandbox-indexer 1/7] FROM docker.io/library/golang:1.17.5-alpine@sha  0.0s

 => [sandbox-indexer internal] load build context                          0.3s

 => => transferring context: 196B                                          0.1s

 => CACHED [sandbox-indexer 2/7] WORKDIR /opt/indexer                      0.0s

 => [sandbox-indexer 3/7] RUN apk add --no-cache git bzip2 make bash lib  30.1s

 => [sandbox-algod 2/7] RUN echo "Installing from source.  -- "            1.7s

 => [sandbox-algod 3/7] RUN apt-get update && apt-get install -y apt-uti  20.3s

 => [sandbox-algod 4/7] COPY . /tmp                                        0.2s

 => [sandbox-algod 5/7] RUN /tmp/images/algod/install.sh     -d "/node"   53.4s

 => [sandbox-indexer 4/7] COPY images/indexer/disabled.go /tmp/disabled.g  0.1s

 => [sandbox-indexer 5/7] COPY images/indexer/start.sh /tmp/start.sh       0.1s

 => [sandbox-indexer 6/7] COPY images/indexer/install.sh /tmp/install.sh   0.1s

 => CANCELED [sandbox-indexer 7/7] RUN /tmp/install.sh                    49.0s

 => ERROR [sandbox-algod 6/7] RUN sed -i "s/NETWORK_NUM_ROUNDS/300000/" "  2.7s

------

 > [sandbox-algod 6/7] RUN sed -i "s/NETWORK_NUM_ROUNDS/300000/" "//tmp/images/algod/template.json" &&  /tmp/images/algod/setup.py  --bin-dir "/node"  --data-dir "/opt/data"  --start-script "/opt/start_algod.sh"  --network-dir "/opt/testnetwork"  --network-template "//tmp/images/algod/template.json"  --network-token "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"  --algod-port "4001"  --kmd-port "4002"  --bootstrap-url ""  --genesis-file "/tmp/"  --archival "":

#0 2.351 /bin/sh: 1: /node/goal: not found

#0 2.376 Configuring network with the following arguments:

#0 2.376 {   'algod_port': '4001',

#0 2.376     'archival': False,

#0 2.376     'bin_dir': '/node',

#0 2.376     'bootstrap_url': '',

#0 2.376     'data_dir': '/opt/data',

#0 2.376     'genesis_file': '/tmp/',

#0 2.376     'kmd_port': '4002',

#0 2.376     'network_dir': '/opt/testnetwork',

#0 2.376     'network_template': '//tmp/images/algod/template.json',

#0 2.376     'network_token': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',

#0 2.376     'start_script': '/opt/start_algod.sh'}

#0 2.376 Creating a private network.

#0 2.382 Traceback (most recent call last):

#0 2.385   File "/tmp/images/algod/setup.py", line 130, in <module>

#0 2.389     startCommands = create_private_network(args.bin_dir, args.network_dir, args.network_template)

#0 2.390   File "/tmp/images/algod/setup.py", line 89, in create_private_network

#0 2.391     subprocess.check_call(['%s/goal network create -n sandnet -r %s -t %s' % (bin_dir, network_dir, template)], shell=True)

#0 2.391   File "/usr/lib/python3.9/subprocess.py", line 373, in check_call

#0 2.393     raise CalledProcessError(retcode, cmd)

#0 2.396 subprocess.CalledProcessError: Command '['/node/goal network create -n sandnet -r /opt/testnetwork -t //tmp/images/algod/template.json']' returned non-zero exit status 127.

------

DEBU[0000] serving grpc connection                      

DEBU[0000] stopping session                              span="load buildkit capabilities"

DEBU[0000] serving grpc connection                      

DEBU[0001] serving grpc connection                      

DEBU[0086] stopping session                              span=sandbox-algod

DEBU[0086] stopping session                              span=sandbox-indexer

failed to solve: executor failed running [/bin/sh -c sed -i "s/NETWORK_NUM_ROUNDS/$NETWORK_NUM_ROUNDS/" "//tmp/${TEMPLATE}" &&  /tmp/images/algod/setup.py  --bin-dir "$BIN_DIR"  --data-dir "/opt/data"  --start-script "/opt/start_algod.sh"  --network-dir "/opt/testnetwork"  --network-template "//tmp/${TEMPLATE}"  --network-token "${TOKEN}"  --algod-port "${ALGOD_PORT}"  --kmd-port "${KMD_PORT}"  --bootstrap-url "${BOOTSTRAP_URL}"  --genesis-file "/tmp/${GENESIS_FILE}"  --archival "${NODE_ARCHIVAL}"]: exit code: 1

Environment:
Host OS: Windows 10 Pro 21H2
VirtualBox: 7.0.2 r154219 (Qt5.15.2)
with Nested Virtualisation VT-x, AMD-V,
with KMD paravirtualization
Guest OS: Ubuntu 22.04.01 LTS desktop version
Docker:

$ docker version

Client: Docker Engine - Community

 Cloud integration: v1.0.29

 Version:           20.10.21

 API version:       1.41

 Go version:        go1.18.7

 Git commit:        baeda1f

 Built:             Tue Oct 25 18:02:21 2022

 OS/Arch:           linux/amd64

 Context:           desktop-linux

 Experimental:      true



Server: Docker Desktop 4.14.1 (91661)

 Engine:

  Version:          20.10.21

  API version:      1.41 (minimum version 1.12)

  Go version:       go1.18.7

  Git commit:       3056208

  Built:            Tue Oct 25 18:00:19 2022

  OS/Arch:          linux/amd64

  Experimental:     false

 containerd:

  Version:          1.6.9

  GitCommit:        1c90a442489720eec95342e1789ee8a5e1b9536f

 runc:

  Version:          1.1.4

  GitCommit:        v1.1.4-0-g5fd4c4d

 docker-init:

  Version:          0.19.0

  GitCommit:        de40ad0

to me it looks like the issue is in path //tmp/images/algod/template.json

perhaps you have some env variable set incorectly?

btw if you want to try my kubernetes sandbox feel free to check

#0 2.995 subprocess.CalledProcessError: Command '['/node/goal network create -n sandnet -r /opt/testnetwork -t //tmp/images/algod/template.json']' returned non-zero exit status 127.

seems to point to an issue with the Docker image.

Can you:

  1. Check the sandbox version: git rev-parse HEAD and checks it’s the latest
  2. Check no file in sandbox have been modified by you git status
  3. Reset fully Docker (assuming you’re not using it for something else): Docker: Where is "reset to factory defaults" on linux? - Stack Overflow if you’re using Docker Engine on Linux.

Taknk you @scholtz and @fabrice !

From my repeated experiments it seems to me that the error is related to Docker Desktop.
If I install Docker and Docker Compose and Docker Desktop, but do not start Docker Desktop, “sandbox up” runs without any error.
If I start Docker Desktop, and make “sandbox clean”, “sandbox up”, the above error appears.
Maybe it was overlooked by the Algorand team, as a second “sandbox up” creates the container
from the previously created images, and starts the services without an error.

As an aside docker system prune -a freed up 17 GB. It is a useful command.