algorand / sandbox

Algorand node sandbox
239 stars 158 forks source link

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

Open primarchsolutions opened 2 years ago

primarchsolutions commented 2 years ago

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
winder commented 2 years ago

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

tzaffi commented 2 years ago

@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 commented 2 years ago

@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
yeyouchuan commented 2 years ago

The same problem

How can I fix it?

r0ushann commented 2 years ago

is this an issue with the sandbox itself??

d13co commented 2 years ago

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
tzaffi commented 2 years ago

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

tzaffi commented 2 years ago

Didn't work for me.

Niceural commented 2 years ago

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