iotaledger / one-click-tangle

"One Click Tangle" intends to make lives easier to IOTA adopters by providing pre-configured scripts and recipes that allow to deploy IOTA Networks and Nodes "in one click".
MIT License
55 stars 36 forks source link

Tangle Explorer fails installation on Ubuntu 16.04 #45

Closed truedat101 closed 2 years ago

truedat101 commented 2 years ago

Bug description

Error during installation, seems to be broken in the Python/node-gyp related area of step 8/11

00:49 $ ./tangle-explorer.sh install
Cloning into './explorer-src'...
remote: Enumerating objects: 6140, done.
remote: Counting objects: 100% (1157/1157), done.
remote: Compressing objects: 100% (341/341), done.
remote: Total 6140 (delta 853), reused 1093 (delta 798), pack-reused 4983
Receiving objects: 100% (6140/6140), 5.32 MiB | 1.43 MiB/s, done.
Resolving deltas: 100% (4683/4683), done.
Checking connectivity... done.
Stopping containers...
Step 1/11 : FROM node:14-alpine3.13
 ---> a0564746d270
Step 2/11 : RUN apk --no-cache add git
 ---> Using cache
 ---> 5c5d2a47108d
Step 3/11 : WORKDIR /usr/src/app
 ---> Using cache
 ---> 37dcb8e627f5
Step 4/11 : COPY . ./
 ---> Using cache
 ---> 9152c7a251e6
Step 5/11 : RUN npm install -g npm
 ---> Using cache
 ---> f0b0cd091051
Step 6/11 : ARG CONFIG_ID
 ---> Using cache
 ---> a1011909b15b
Step 7/11 : RUN echo "CONFIG_ID=$CONFIG_ID"
 ---> Using cache
 ---> 3db221c3ee02
Step 8/11 : RUN npm install --only=prod
 ---> Running in cfdbf967fb9a
npm ERR! code 1
npm ERR! path /usr/src/app/node_modules/zeromq
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.17.5 | linux | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:266:16)
npm ERR! gyp ERR! stack     at exithandler (child_process.js:397:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:409:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Docker and docker-compose version

00:56 $ docker --version Docker version 20.10.7, build f0df350 ✔ ~/dev/repos/one-click-tangle.git/explorer [chrysalis|✚ 6] 01:00 $ docker-compose -v docker-compose version 1.25.5, build 8a1c60f6

Hardware specification

What hardware are you using?

Steps To reproduce the bug

Explain how the maintainer can reproduce the bug.

  1. clone this repository
  2. ./tangle-explorer.sh install

Expected behaviour

builds/"installs"/runs

Actual behaviour

failure to build

Errors

See description

jmcanterafonseca-iota commented 2 years ago

seems to be an error while building the Docker image. @rajivshah3 any view on this?

rajivshah3 commented 2 years ago

I think this should be fixed after iotaledger/explorer#63 is merged into the master branch of that repo. To use that PR now, I think you can replace this line:

https://github.com/iotaledger/one-click-tangle/blob/38fa3dfc89c4976117ca52da677af7dd5a29a837/explorer/tangle-explorer.sh#L113

with this:

git clone https://github.com/iotaledger/explorer -b fix/api-docker $EXPLORER_SRC 
truedat101 commented 2 years ago

@rajivshah3 thanks I'll try this out.

jmcanterafonseca-iota commented 2 years ago

@truedat101 please give us feedback. The Docker container for Explorer is now fixed. So everything should be working now.

truedat101 commented 2 years ago

I'll have a look. I need to get access to the same system I was using for test.

truedat101 commented 2 years ago

Did not work:

./tangle-explorer.sh install
Cloning into './explorer-src'...
fatal: Remote branch fix/api-docker not found in upstream origin

branch has gone away?

rajivshah3 commented 2 years ago

Hi @truedat101 , I deleted the branch since it was merged. The script should work without changes now

truedat101 commented 2 years ago

Great, will try this again.

truedat101 commented 2 years ago

Still seems like a non-starter:

Tons of warnings, and then this, a typescript error.

Creating an optimized production build...
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(15, 16)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                    ^^^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:20  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(8, 9)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                             ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:29  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(5, 6)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                    ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:36  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(4, 5)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                           ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:43  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(3, 4)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                                  ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:50  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

WARNING: 12 repetitive deprecation warnings omitted.

Failed to compile.

/usr/src/app/src/helpers/fetchHelper.ts
TypeScript error in /usr/src/app/src/helpers/fetchHelper.ts(53,19):
Object is of type 'unknown'.  TS2571

    51 |             return json as U;
    52 |         } catch (err) {
  > 53 |             throw err.name === "AbortError" ? new Error("Timeout") : err;
       |                   ^
    54 |         } finally {
    55 |             if (timerId) {
    56 |                 clearTimeout(timerId);

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! explorer-client@1.0.0 build-internal: `craco build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the explorer-client@1.0.0 build-internal script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-28T04_10_02_191Z-debug.log
ERROR: "build-internal" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! explorer-client@1.0.0 build: `run-s lint sass-lint build-internal`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the explorer-client@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-28T04_10_02_254Z-debug.log
ERROR: Service 'explorer-webapp' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1
✘-1 ~/dev/repos/one-click-tangle.git/explorer [chrysalis|…1⚑ 1]
21:10 $
Galman21 commented 2 years ago

Still seems like a non-starter:

Tons of warnings, and then this, a typescript error.

Creating an optimized production build...
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(15, 16)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                    ^^^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:20  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(8, 9)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                             ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:29  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(5, 6)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                    ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:36  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(4, 5)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                           ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:43  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(3, 4)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
2 │ $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
  │                                                  ^^^
  ╵
    node_modules/chartist/dist/scss/settings/_chartist-settings.scss 2:50  @import
    node_modules/chartist/dist/scss/chartist.scss 1:9                      @import
    src/index.scss 8:9                                                     root stylesheet

WARNING: 12 repetitive deprecation warnings omitted.

Failed to compile.

/usr/src/app/src/helpers/fetchHelper.ts
TypeScript error in /usr/src/app/src/helpers/fetchHelper.ts(53,19):
Object is of type 'unknown'.  TS2571

    51 |             return json as U;
    52 |         } catch (err) {
  > 53 |             throw err.name === "AbortError" ? new Error("Timeout") : err;
       |                   ^
    54 |         } finally {
    55 |             if (timerId) {
    56 |                 clearTimeout(timerId);

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! explorer-client@1.0.0 build-internal: `craco build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the explorer-client@1.0.0 build-internal script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-28T04_10_02_191Z-debug.log
ERROR: "build-internal" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! explorer-client@1.0.0 build: `run-s lint sass-lint build-internal`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the explorer-client@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-28T04_10_02_254Z-debug.log
ERROR: Service 'explorer-webapp' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1
✘-1 ~/dev/repos/one-click-tangle.git/explorer [chrysalis|…1⚑ 1]
21:10 $

Did you solve this error? I'm getting the same error on ubuntu 20.04

truedat101 commented 2 years ago

@Galman21 no, not solved. But the typescript errors are probably from some module upgrade , either a dependency isn't properly locked down, or it was upgraded in some upstream module and it is broken in the explorer.

jmcanterafonseca-iota commented 2 years ago

@truedat101 @Galman21 with the latest fixes on the Explorer, can we close this one?

Galman21 commented 2 years ago

@truedat101 @Galman21 with the latest fixes on the Explorer, can we close this one?

Yes, thanks for the fix!!

truedat101 commented 2 years ago

Yes, looks like this is a good fix.

javiEstrella commented 2 years ago

Hi guys, for me the explorer installation it's broken with a problem very similar to this one. It's the first day I try it, so I don't know since when it's broken.

I was able to make it work on my machine (debian + docker 18.09.1 + docker-compose 1.21.0) by (1) using a previous explorer commit and (2) not deleting the package-lock.json that comes in the client folder (note, it only works for me if I do 1 and 2, not if I do 1 or 2, i.e. I need to use an old version and not delete its package-lock.json file)

$ git diff explorer/
diff --git a/explorer/tangle-explorer.sh b/explorer/tangle-explorer.sh
index 54686e1..bbfd28f 100755
--- a/explorer/tangle-explorer.sh
+++ b/explorer/tangle-explorer.sh
@@ -99,7 +99,7 @@ copyConfig () {
   cp config/webapp.config.local.json $EXPLORER_SRC/client/src/assets/config/config.local.json

   # TODO: Check why is it really needed
-  rm $EXPLORER_SRC/client/package-lock.json
+  # rm $EXPLORER_SRC/client/package-lock.json
 }

 installExplorer () {
@@ -111,6 +111,7 @@ installExplorer () {
   clean

   git clone https://github.com/iotaledger/explorer $EXPLORER_SRC
+  pushd $EXPLORER_SRC; git checkout b9d20735365aee41dc1c4d2f75fd00c6998bb258; popd || exit

   # We stop container after having source code available otherwise docker-compose would fail
   stopContainers

The commit that works for me is this https://github.com/iotaledger/explorer/commit/b9d20735365aee41dc1c4d2f75fd00c6998bb258 (I just assumed from this issue that if that commit solved the problem at the time, it would work for me).