Error in Ziti Controller

Hello Community!
I have the following error. When I run startZitiController the response I get is satisfactory, however when I try to access the ZAC I get a message that reads “Edge controller not Online” and when I check the log file, I see this error. Could you tell me what I’m doing wrong? I am running everything locally

<pre>[   1.713]   ERROR ziti/ziti-controller/subcmd.run: {os=[linux] revision=[a30e3496a16b] error=[unable to open controller database [/.ziti/quickstart/$(hostname)/db/ctrl.db] (timeout)] build-date=[2022-03-17T17:10:35Z] arch=[amd64] version=[v0.25.3] go-version=[go1.17.7]} error starting ziti-controller
panic: unable to open controller database [/.ziti/quickstart/$(hostname)/db/ctrl.db] (timeout)

goroutine 1 [running]:
github.com/openziti/ziti/ziti-controller/subcmd.run(0x2b57de0, {0xc0007d1270, 0x1, 0x1})
        github.com/openziti/ziti/ziti-controller/subcmd/run.go:57 +0xcc8
github.com/spf13/cobra.(*Command).execute(0x2b57de0, {0xc0007d1250, 0x1, 0x1})
        github.com/spf13/cobra@v1.4.0/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x2b57b60)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.4.0/command.go:902
github.com/openziti/ziti/ziti-controller/subcmd.Execute()
        github.com/openziti/ziti/ziti-controller/subcmd/root.go:67 +0x25
main.main()
        github.com/openziti/ziti/ziti-controller/main.go:49 +0x17
</pre>

Hi @Edwin ! welcome to the discourse. I see in your command that the $(hostname) was not properly tokenized. that’s a bug I’ve never seen before. what version of linux are you running? are you perhaps using a shell other than zsh/bash (we run expressInstall ourselves in bash/zsh).

It seems like your config is just not getting generated properly. I’m sure we can figure it out - happy to help. lemme know what linux version you’re using and what shell and i’ll see if i can reproduce the problem

Hello @TheLumberjack, thank you very much.
I am using Ubuntu 20.04 and bash which provides the same OS.
I’ll try some other shell that is ZSH, but if you could help me that would be great.
Greetings

Odd - I run this all the time with Ubuntu 20.04 and bash. I’ll try it with zsh and see if that causes this issue.

I just launched zsh (from bash) and ran the quickstart and it completed successfully. after doing that there is an environment variable on your shell… can you try running grep db "$ZITI_HOME/$(hostname).yaml" you can see my result below:

cd@sg3 ~/.ziti/quickstart/sg3
 % grep db "$ZITI_HOME/$(hostname).yaml"
db:                     "/home/cd/.ziti/quickstart/sg3/db/ctrl.db"

also - could you perhaps capture your entire expressInstall output so I might inspect it?

EDIT: for me "$ZITI_HOME/$(hostname).yaml" resolves to:

 % echo "$ZITI_HOME/$(hostname).yaml"
/home/cd/.ziti/quickstart/sg3/sg3.yaml

Hello @TheLumberjack, an apology for the delay. Of course I show you the configuration screens after running the quickstart.

Here you will see that it tells me that the environment variables had already been established, I select the yes option and as you will see in the following images, everything starts normally


However I still see the error, it tells me that the controller is not online.
What am I doing wrong?

Greetings

did you run the following commands after the installation

startZitiController
startExpressEdgeRouter

You can check this by using psz

To run psz.. you will need to load the env variables

. ~/.ziti/quickstart/$(hostname)/$(hostname).env

If the controller and edge router is not running.. you can then use the following commands to start them.

. ./ziti-cli-functions.sh && stopAllEdgeRouters

. ./ziti-cli-functions.sh && stopZitiController

1 Like

Those commands will stop the router and controller :slight_smile: but @markamind is entirely right. After the expressInstsll completes, it stops the controller and router. The last few messages tell you that you can start the programs by running startZitiController or startExpressEdgeRouter like @markamind says.

You probably just need to start them up. :slight_smile:

Ahh… nice… missed that one… good pick up

Yes I did it @markamind , @TheLumberjack.
If I run the command after expressInstall has finished, the output of both commands, startZitiController and startExpressEdgeRouter is as follows:

ziti-controller started as process id: . log located at: /home/edwin/.ziti/quickstart/edwin-asus/edwin-asus.log
[1] 4424
Express Edge Router started as process id: 4424. log located at: /home/edwin/.ziti/quickstart/edwin-asus/edwin-asus-edge-router.log

1 Like

Way to go! You're on your way to even more secure communications in no time! :slight_smile:

2 Likes

Great!
I guess the next step is to install ZAC if I don’t want to use CLI, right?
I have followed the quickstart instructions to install ZAC and I get this screen:


However when I enter the data of the controller it shows me a message saying that the controller is not online, what is my error?
I have to say that I already started the router and the controller with the commands that are also given in the guide.
Greetings!

You probably want to use url: https://edwin-asus:1280 . You want to enter the url of the controller into that box.

1 Like

type in psw to confirm the router is running.

if its not.. try starting it again..

if it still fails.. check the router logs..

you may find that you need to set the “router_name” and “ZITI_EDGE_ROUTER_RAWNAME” variables

I found that these were not set when you reload the env file

1 Like

PS… keep hacking away at it… the key is to understand how it all hangs together.

I am very close to my next breakthrough and will share my learnings when it happens.

Thank you very much for your help, I am exploring ZAC successfully.

1 Like