Hey all – first time going through the express install on a cloud vm. Always used a local docker-compose solution thus far.
I’ve installed OZ on my Ubuntu cloud host and have Ziti Controller/Ziti ER running. I have the env sourced.
ubuntu@ip-172-31-0-105:~$ echo $ZITI_HOME
/home/ubuntu/.ziti/quickstart/ip-172-31-0-105
Now installing ZAC on Controller on step 4 and I get the following error:
ubuntu@ip-172-31-0-105:~$ createZacSystemdFile
createZacSystemdFile: command not found
Ok…so that doesn’t work…move on and start ZAC manually with the following:
node "${ZITI_HOME}/ziti-console/server.js"
and get this error?
import express from 'express';
^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Strange that neither will work although I would prefer the systemd to function.
And the try? If that doesn't work, please let us know. I just ran it myself on my AWS ubuntu image and it works. I'm thinking you might have logged out and logged back in? The helper functions are not part of the .env file that gets generated expressInstall. Only a few functions are provided (like zitiLogin).
You probably just need to source ziti-cli-functions.sh again AND the env sourced. Then you'll have createZacSystemdFile
The Systemd service seems to be bouncing from activating to running continuously – found this in the logs:
Jun 28 13:20:32 ip-172-31-0-105 systemd[1]: ziti-console.service: Main process exited, code=exited, status=1/FAILURE
Jun 28 13:20:32 ip-172-31-0-105 systemd[1]: ziti-console.service: Failed with result ‘exit-code’.
Jun 28 13:20:34 ip-172-31-0-105 systemd[1]: ziti-console.service: Scheduled restart job, restart counter is at 192.
Jun 28 13:20:34 ip-172-31-0-105 systemd[1]: Stopped Ziti-Console.
Jun 28 13:20:34 ip-172-31-0-105 systemd[1]: Started Ziti-Console.
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: /home/ubuntu/.ziti/quickstart/ip-172-31-0-105/ziti-console/server.js:1
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: import express from ‘express’;
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: ^^^^^^^
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: SyntaxError: Unexpected identifier
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at Module._compile (internal/modules/cjs/loader.js:723:23)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at Module.load (internal/modules/cjs/loader.js:653:32)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at startup (internal/bootstrap/node.js:283:19)
Jun 28 13:20:35 ip-172-31-0-105 node[40590]: at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
ubuntu@ip-172-31-0-105:~$ npm install
npm WARN saveError ENOENT: no such file or directory, open ‘/home/ubuntu/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/ubuntu/package.json’
npm WARN ubuntu No description
npm WARN ubuntu No repository field.
npm WARN ubuntu No README data
npm WARN ubuntu No license field.
ubuntu@ip-172-31-0-105:~$ npm install
npm WARN saveError ENOENT: no such file or directory, open ‘/home/ubuntu/package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/home/ubuntu/package.json’
If you still have troubles, make sure you are running node v16.15.1+. The easiest thing for that is to install nvm and let it install it for you. This guide was helpful: https://heynode.com/tutorial/install-nodejs-locally-nvm/