Console installation failure

Hello everybody!

Discovering Ziti and trying to install it by following the Quickstart installation but I'm facing issues. Please see below:

root@zti:/home/eric# git clone GitHub - openziti/ziti-console "${ZITI_HOME}/ziti-console"
Clonage dans '/opt/ziti/ziti-console'...
remote: Enumerating objects: 4479, done.
remote: Counting objects: 100% (1768/1768), done.
remote: Compressing objects: 100% (727/727), done.
remote: Total 4479 (delta 1201), reused 1433 (delta 1018), pack-reused 2711
Réception d'objets: 100% (4479/4479), 14.80 Mio | 30.62 Mio/s, fait.
Résolution des deltas: 100% (2728/2728), fait.
root@zti:/home/eric# cd "${ZITI_HOME}/ziti-console"
npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /opt/ziti/ziti-console/dist/ziti-console-lib/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/opt/ziti/ziti-console/dist/ziti-console-lib/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-02-26T12_03_16_476Z-debug-0.log

I'm not a Linux specialist but I spent many hours trying to solve my problem without success. What I see is that "dist" directory does not exist in ziti-console directory. Any idea would be greatly appreciated!

Thanks a lot.

Hi @Eric. Welcome to the community and to OpenZiti!

It looks to me like your angular build step didn't succeed. You got this error simply by running npm install? I just ran it on my test machine and it worked fine. Are you sure you have node 16+ installed and angular installed?

I'll try on a new docker image to see if I can replicate your issue. Right now, it must be something environmental. Also, what linux variant are you using?

I made a brand new ubuntu container, apt updated it, installed all the dependencies etc and the steps outlined on the documentation worked fine for me, sadly. :frowning: I even made sure the version of node was < 16 to see if that was the issue but I can't seem to reproduce the problem...

I would say "start over" and see what happens. You've probably done that already... If not, can you start a clean terminal, ensure ZITI_HOME is set appropriately (/opt/ziti/ in your case) delete the pre-existing ziti-console directory and run through all the steps again?

I've never seen npm install report this. I dunno what might be the problem.

Hi Dear,

Thanks four quick reply. I'm installing on a fresh Debian 12 system. I followed all the steps. Here are the versions:

root@zti:/home/eric# node -v
v18.19.0
root@zti:/home/eric# ng version
Global setting: disabled
Local setting: No local workspace configuration file.
Effective status: disabled

Angular CLI: 16.2.12
Node: 18.19.0
Package Manager: npm 9.2.0
OS: linux x64

Angular:
...

Package Version

@angular-devkit/architect 0.1602.12 (cli-only)
@angular-devkit/core 16.2.12 (cli-only)
@angular-devkit/schematics 16.2.12 (cli-only)
@schematics/angular 16.2.12 (cli-only)

ZITI_HOME is ok and yes, as you supposed, I tried multiple times.

When I launch npm doctor, I see:

Check Value Recommendation/Notes
npm ping ok
npm -v not ok Use npm v10.4.0
node -v not ok Use node v20.11.1 (current: v18.19.0)
npm config get registry ok using default registry (https://registry.npmjs.org/)
git executable in PATH ok /usr/bin/git
global bin folder in PATH ok /usr/local/bin
Perms check on cached files ok
Perms check on local node_modules ok
Perms check on global node_modules ok
Perms check on local bin folder ok
Perms check on global bin folder ok

Verify cache contents ok verified 1265 tarballs
npm ERR! Some problems found. See above for recommendations.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-02-26T13_21_03_511Z-debug-0.log

Here is the /opt/ziti content:

root@zti:/opt/ziti/ziti-console# ls
-rw-r--r-- 1 root root 11615 26 févr. 13:03 angular.json
-rw-r--r-- 1 root root 463 26 févr. 13:03 bitbucket-pipelines.yml
-rw-r--r-- 1 root root 289 26 févr. 13:03 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root root 320 26 févr. 13:03 CONTRIBUTING.md
-rw-r--r-- 1 root root 628 26 févr. 13:03 Dockerfile
-rw-r--r-- 1 root root 11340 26 févr. 13:03 LICENSE
-rw-r--r-- 1 root root 0 26 févr. 13:03 LICENSE.md
-rw-r--r-- 1 root root 5282 26 févr. 13:03 package.json
-rw-r--r-- 1 root root 329 26 févr. 13:03 pipeline-docker-publish.sh
-rw-r--r-- 1 root root 324 26 févr. 13:03 process.json
drwxr-xr-x 4 root root 4096 26 févr. 13:03 projects
-rwxr-xr-x 1 root root 214 26 févr. 13:03 publishSharedLib.sh
-rwxr-xr-x 1 root root 388 26 févr. 13:03 pushLatestDocker.sh
-rw-r--r-- 1 root root 2736 26 févr. 13:03 README.md
-rw-r--r-- 1 root root 579 26 févr. 13:03 Release.md
-rw-r--r-- 1 root root 7306 26 févr. 13:03 release-notes.md
-rw-r--r-- 1 root root 340 26 févr. 13:03 run.sh
-rwxr-xr-x 1 root root 2180 26 févr. 13:03 run-zac.sh
-rwxr-xr-x 1 root root 595 26 févr. 13:03 SECURITY.md
-rw-r--r-- 1 root root 22 26 févr. 13:03 server.cjs
-rw-r--r-- 1 root root 2749 26 févr. 13:03 server-edge.js
-rw-r--r-- 1 root root 67140 26 févr. 13:03 server.js
-rw-r--r-- 1 root root 1275 26 févr. 13:03 tsconfig.json
-rw-r--r-- 1 root root 5 26 févr. 13:03 version.txt
-rw-r--r-- 1 root root 2096 26 févr. 13:03 web.config

root@zti:/opt/ziti/ziti-console#

I just launched a Debian 12.5 container using docker run -it --rm debian:12.5 bash, installed the dependencies, and installed OpenZiti using the quickstart script:

source /dev/stdin <<< "$(wget -qO- https://get.openziti.io/ziti-cli-functions.sh)"; expressInstall

I installed nvm using:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc

updated to node 16 or node 18:

nvm install 16

then ran through all the instructions... it seems to work for me on debian 12 too.

Maybe the /opt/ziti folder is owned by root or something strange is happening? Can you try using your $HOME folder to eliminate any strange permission issues? (this is only a guess, I can't reproduce your problem still unfortunately)

Please ignore my previous reply, I was assuming this was being being built/run locally (ie. not via docker). It does seem there may be some kind of issue creating that /dist folder which holds the application bundles. Could be permissions related but I'm not yet able to to reproduce myself. Will keep trying and see if I have any luck.

Hi,

I don't use docker and I am the owner of /opt/ziti folder. So I don't see why I should get permissions issue. I'm currently trying to do another installation in English in case the issue was due to French language. :slight_smile:

Hummm... I was using:
apt-get install nodejs
apt-get install npm

I thought it was the right way to install both of them. Am I wrong? I do not see your nvm installlation in the Quickstart instructions.

Ahh ok sorry for the misunderstanding. So in that case it sounds like you may be missing a couple steps after the npm install. Have you run these two commands and/or see any errors when running them?

ng build ziti-console-lib
ng build ziti-console-node

I apologize, after re-reading your initial post I can see the issue you're facing is getting past the npm install step. So my comment above likely does not apply. That said, I'm not sure why the npm install step would be looking for resources in the project /dist folder. That I will need to take a closer look at.

we don't really tell people how to install node. I use nvm because I find it the easiest way personally and when I install node from apt it generally installs node 12 or something really old.

J'ai aussi pensé au truc anglais/français, parce que je l'ai remarqué dans votre message git... mais ce serait étrange si c'était là le problème !

If it's English/French let us that'd be shocking :slight_smile: -- but mabye?

I used your method and I was able to move forward till "ng build ziti-console-node" and then got below fatal error:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb090e0 node::Abort() [ng build ziti-console-node]
2: 0xa1b70e [ng build ziti-console-node]
3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build ziti-console-node]
4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build ziti-console-node]
5: 0xe99435 [ng build ziti-console-node]
6: 0xe99f16 [ng build ziti-console-node]
7: 0xea843e [ng build ziti-console-node]
8: 0xea8e80 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build ziti-console-node]
9: 0xeabdfe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build ziti-console-node]
10: 0xe6d33a v8::internal::factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build ziti-console-node]
11: 0x11e61e6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build ziti-console-node]
12: 0x15d9e59 [ng build ziti-console-node]

Maybe have to give more RAM to my VM? I'll try immediately. :slight_smile:

May I know one thing: during Debian installation, do you advise to install Apache or not?

I didn't. There's no need for it for OpenZiti/ZAC.

1 Like

Admin console installed :grinning: Thanks a lot for your help. I just suggest you to put the way you install nodejs and npm in the Quickstart guide because using apt-get does not work and i'm not strong enough on Linux to explain why!

2 Likes

Glad to hear. I'll go try using what you did:

apt-get install nodejs
apt-get install npm

It seems like it might be useful to have some kind of note in there for troubleshooting... Glad you got things working

FWIW -- I could replicate your problem in debian 12.5 by using apt install jq curl nodejs npm wget lsof git -y to install the dependencies needed. Really unexpected behavior!

Steps to reproduce:

docker run -it --rm debian:12.5 bash

update:

apt update

install deps needed:

apt install jq curl nodejs npm wget lsof git -y

run OpenZiti's quickstart, accept the generated password (we won't be really using it in this example):

source /dev/stdin <<< "$(wget -qO- https://get.openziti.io/ziti-cli-functions.sh)"; expressInstall

install ZAC:

git clone https://github.com/openziti/ziti-console.git "${ZITI_HOME}/ziti-console"
cd "${ZITI_HOME}/ziti-console"
npm install

observe:

strange! @rgalletto is this somehow relative to node v18.19.0???

So I think this is a node 18.19.0 vs node 18.19.1 issue somehow. I checked the nvm install method and it installs node 18.19.1 whereas apt is installing 18.19.0...

So my guess is node fixed something between 18.19.0 and 18.19.1 and you were just unlucky @Eric ... Good to know i guess :wink:

Good news you found the problem. Will be helpful for somebody else I guess... :wink: