ZAC Quickstart - what am I doing wrong here?

I’m trying (for the first time ever) to install the Ziti Admin Console on the same host as my controller. This is all self-hosted and I’m attempting to do the non-docker version of this first. Host OS info:

jfj@zctl:/ziti-console$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

Following the quickstart here: Ziti Admin Console | OpenZiti , I get errors when trying any of the “optional” steps. The previous steps worked without error (other than the node.js npm install as will be described.)

When I run this, from step 4:

jfj@zctl:/ziti-console$ sudo node "${ZITI_HOME}/ziti-console/server.js"
file:///ziti-console/server.js:39
 	ziti = await loadModule('@openziti/ziti-sdk-nodejs')
	       ^^^^^
 
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)

(If I run that last one without sudo I get all kinds of permissions errors)

I did some searching through discourse for similar errors and found one, but it involved someone using a version of node.js that was too old. I’m running 20.2.0:

jfj@zctl:~/.ziti/quickstart/zctl$ npm list
zctl@ /home/jfj/.ziti/quickstart/zctl
└── node@20.2.0

I did get tons of warnings when running the npm install command for “Unsupported engine” on package after package.

Finally, when I run this:

jfj@zctl:/ziti-console$ sudo systemctl status ziti-console --lines=0 --no-pager
Unit ziti-console.service could not be found.

I’m sure this is bordering on idiotic for any dev or competent linux admin, but I’m a network security architect with outdated and rusty linux skills, so I would humbly appreciate any help here in what I’ve done incorrectly.

Thanks!

-John

I ran ZAC on ubuntu 22.04 without any issue. Here is how i install my nodejs:

cd ~
curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh

Install nodejs:

sudo apt install nodejs

Thanks, I’ll give that a shot. I may go back and start over as I seem to be having trouble with the controller and router working as well now. Will start with a clean install and go from there and use this method.

-John

What is the value of ZITI_HOME? The error message indicates it might not be set. You should also check the values of ZITI_PKI, ZITI_CTRL_EDGE_ADVERTISED_ADDRESS, and
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS.

You should have a .env file that was generated in an earlier part of the quickstart that you can source to set them all as they were set during the quickstart (called something like ~/.ziti/quickstart/zctl/zctl.env)

1 Like

I encounter the following error(s) when following your method, @JamminSoleng :

The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/28.7 MB of archives.
After this operation, 186 MB of additional disk space will be used.
(Reading database ... 134981 files and directories currently installed.)
Preparing to unpack .../nodejs_18.16.1-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (18.16.1-deb-1nodesource1) over (12.22.9~dfsg-1ubuntu3) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_18.16.1-deb-1nodesource1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/node/common.gypi', which is also in package libnode-dev 12.22.9~dfsg-1ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_18.16.1-deb-1nodesource1_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

@smilindave26 valid question- I’ve restarted a fresh attempt and I can verify that now everything is sourced and paths have been exported, etc., so I don’t think that’s an issue now but may have been in attempt #1.

Still same error after full re-install, ran the tutorial to ensure the controller and edge router were working properly. Environment variables sourced, path is exported and written to the .bashrc file and operating as expected.

jfj@zctl:~/.ziti/quickstart/zctl/ziti-console$ sudo node server.js
file:///home/jfj/.ziti/quickstart/zctl/ziti-console/server.js:39
	ziti = await loadModule('@openziti/ziti-sdk-nodejs')
	       ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)

Yeah I’m basically in a loop now where I guess I need to figure out where the nodejs setup scripts are all failing for me and why. I’ve tried version 16.x, 18.x, and 20.x using their method:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

I get the same error from dpkg as above, and my current version remains:

jfj@zctl:~/.ziti/quickstart/zctl/ziti-console$ node --version
v12.22.9

Reviewing the nodejs install script now to see if I can figure out what’s going wrong.

Update: looks like I have a conflict between two sources since Ubuntu tried to install an old version with my initial install using its package manager, and now there is an unresolvable conflict. I’ve tried a bout 10 different ways to uninstall and remove files, force overwriting, etc. Simply doesn’t work and now I can’t get any version of node or nodejs installed. Not an openZiTi problem, I guess I’ll try again if someday I resolve this nodejs issue. For now I’ve spent about 8 hours of futile struggle. This is what happens when a plumber tries to build a nuclear reactor, I suppose. :man_facepalming:

Ugh - Hopefully you’ll find some good articles on completing uninstalling node - here’s the first one that came back for me on a Google search of “completely uninstall nodejs on ubuntu”: How to Install/Uninstall NodeJS on Ubuntu 18.04 | DigitalOcean

FWIW - I backed my version of node down to v12.22.9, and see the exact same error message that you posted above (I used nvm use v12.22.9 to change my node version). Why I change to node v20.2.0, node server.js works as expected.

@smilindave26 thanks for your sympathy there, haha… I gave it one more shot and was finally able to get the old stuff removed and get a successful version, now the npm install worked and I am to the point where a browser on the local machine connects to port 1408 as expected. I get an error when I enter in my controller name and URL, (Edge Controller Not Online), but I got through the install process and I can start over on figuring out the next steps to getting ZAC to work this week when I have built up a new reservoir of patience.

Thanks for your help and responses.

-John

Phew!

I get that error when I forget to include the https in the controller URL (e.g., mistakenly enter localhost:1280 instead of https://localhost:1280)

@smilindave26 Also got that solved- after a reboot the controller and edge router were not started since I haven’t set them up to start on reboot yet. Once I started them I was able to log in through the ZAC on a local browser.

These are signs I need to walk away from the desk. :joy:

1 Like

There definitely seems like there’s a bug in the latest ZAC release. I also just followed our instructions, which have always just been “clone the repo”, run “node server.js” and it’s complaining about ports in use, complaining about port 1408 and trying 1409 etc. That’s stuff I’ve never seen before. I think we’ll need @jeremy.tellier to look at this one. I can’t seem to clone/start ZAC either

I cloned the repo when responding to the question above and it worked for me. Do you already have an instance of ZAC running?

It looks like it’s a problem when trying to server TLS. I also bet the certs have moved in the recent quickstart changes and the doc needs to get tweaked…

Yeah. nevermind. I probably should have just stayed AWAY from MY desk…I had a systemd service starting ZAC causing my problems. It’s all just fine now after stopping that service.

1 Like