sandbox icon indicating copy to clipboard operation
sandbox copied to clipboard

Algorand and indexer nodes not starting when attempting to start Algorand Sandbox in Ubuntu 22

Open primarchsolutions opened this issue 2 years ago • 9 comments

Subject of the issue

I am attempting to set up and run the Algorand Sandbox in Ubuntu 22 following instructions from https://developer.algorand.org/tutorials/create-and-test-smart-contracts-using-python/. I installed docker composer as required but when I attempt to run

./sandbox/sandbox up

I get the error

        Starting default sandbox: release
        see sandbox.log for detailed progress, or use -v.
        * docker containers started!
        * waiting for services to initialize.
        
        the following did not start:
        * algorand node
        * indexer node
        
        One or more services failed to start.

Is there a step I missed?

Your environment

Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

Steps to reproduce

[1.(https://developer.algorand.org/tutorials/create-and-test-smart-contracts-using-python/. )

Expected behaviour

Actual behaviour

        Starting default sandbox: release
        see sandbox.log for detailed progress, or use -v.
        * docker containers started!
        * waiting for services to initialize.
        
        the following did not start:
        * algorand node
        * indexer node

primarchsolutions avatar Aug 17 '22 06:08 primarchsolutions

@tzaffi do you think this could be related to the .env changes?

winder avatar Aug 18 '22 14:08 winder

@tzaffi do you think this could be related to the .env changes?

That is the most likely explanation. I'm investigating and will keep you posted.

tzaffi avatar Aug 18 '22 15:08 tzaffi

@winder - After further investigation, I can confirm that sandbox is broken in Ubuntu 22.

However, the problem appears to be orthogonal to any of the recent changes.

I see the following happening:

  1. indexer docker calles install.sh
  2. install.sh calls indexer's make
  3. indexer's Makefile calls operations that are "not permitted" (I still get same errors with a sudo):
  • make: pwd: Operation not permitted
  • make: /mule/scripts/compute_build_number.sh: Operation not permitted
  • make: /mule/scripts/ostype.sh: Operation not permitted
  • make: /bin/sh: Operation not permitted
  • make: /bin/sh: Operation not permitted
  • make: /bin/sh: Operation not permitted
  • (from make go-algorand) make: *** [Makefile:30: go-algorand] Error 127

Here is how I reproduced with some log info:

> git clone https://github.com/algorand/sandbox.git
> cd sandbox

# Checkout a commit from July
> git checkout 0f74ac78b6ef4958f06b1d81e2b34102aa871a5e
> cd ..
> ./sandbox/sandbox up -v

(87/87) Installing make (4.3-r0)
Executing busybox-1.34.1-r3.trigger
OK: 527 MiB in 101 packages
Removing intermediate container 9d946525203b
 ---> 1d0d61e9fa47
Step 10/14 : COPY images/indexer/disabled.go /tmp/disabled.go
 ---> 030ca3bfb20b
Step 11/14 : COPY images/indexer/start.sh /tmp/start.sh
 ---> b910ccdd1f7f
Step 12/14 : COPY images/indexer/install.sh /tmp/install.sh
 ---> e4b8eeb87e80
Step 13/14 : RUN /tmp/install.sh
 ---> Running in 7924560cae60
Cloning into '/opt/indexer'...
make: pwd: Operation not permitted
make: /mule/scripts/compute_build_number.sh: Operation not permitted
make: /mule/scripts/ostype.sh: Operation not permitted
make: /bin/sh: Operation not permitted
git submodule update --init && cd third_party/go-algorand && \
make crypto/libs/`scripts/ostype.sh`/`scripts/archtype.sh`/lib/libsodium.a
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
make: *** [Makefile:30: go-algorand] Error 127
ERROR: Service 'indexer' failed to build: The command '/bin/sh -c /tmp/install.sh' returned a non-zero code: 2

tzaffi avatar Aug 18 '22 16:08 tzaffi

The same problem

How can I fix it?

yeyouchuan avatar Sep 03 '22 08:09 yeyouchuan

is this an issue with the sandbox itself??

r0ushann avatar Sep 24 '22 21:09 r0ushann

I had a similar issue in 22.04 where the indexer-db/postgres image didn't spin up. I didn't have an issue with algod to begin with though, so it may be a separate but related issue.

Running docker-compose up manually made the postgres image error with chmod: /var/lib/postgresql/data: Operation not permitted

On a whim I tried to change the image required in the docker-compose.yml file from postgres:13-alpine to postgres:14-alpine and it worked.

Diff:

diff --git a/docker-compose.yml b/docker-compose.yml
index 058c13e..1c799d8 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -50,7 +50,7 @@ services:
       - algod
       
   indexer-db:
-    image: "postgres:13-alpine"
+    image: "postgres:14-alpine"
     container_name: "${POSTGRES_CONTAINER:-algorand-sandbox-postgres}"
     ports:
       - ${POSTGRES_PORT:-5433}:5432

d13co avatar Sep 25 '22 15:09 d13co

This is a great tip. I'll try it!

tzaffi avatar Sep 26 '22 04:09 tzaffi

Didn't work for me.

tzaffi avatar Sep 26 '22 15:09 tzaffi

hi! I have the same issue how could I fix it? Thanks!

Niceural avatar Nov 01 '22 14:11 Niceural