chirpstack / chirpstack-ansible-playbook

Ansible playbook for setting up ChirpStack.
https://www.chirpstack.io
MIT License
84 stars 43 forks source link

Cannot connect to localhost #14

Closed qbee-io closed 7 years ago

qbee-io commented 7 years ago

The Vagrant installation went well and I see that everything is installed, provisioned and started. However, I cannot connect to https://localhost:8080/.

The Virtualbox VM is in NAT mode and shows the port forwarding. Port 8080 on the host is forwarded to port 443 on the guest. Is that correct?

Any ideas? Thanks in advance.

brocaar commented 7 years ago

Are you really sure that LoRa App Server has been started? Could you post the output of:

vagrant ssh
sudo journalctl -f -n 100 -u lora-app-server
qbee-io commented 7 years ago

Hi, Thanks for your help. My first mistake was that I had not started the packet forwarder. This is corrected and it seems that it must run to prevent a problem with the app server starting. But now I get this output from your command:

Aug 02 17:55:25 ubuntu-xenial lora-app-server[1371]: time="2017-08-02T17:55:25Z" level=error msg="handler/mqtt: connecting to broker error, will retry in 2s: Network Error : dial tcp 127.0.0.1:1883: getsockopt: connection refused"

So the app server has still not started.

brocaar commented 7 years ago

It seems like Mosquitto was not started. Could you try a systemctl start mosquitto?

qbee-io commented 7 years ago

I get the following and don´t know where to get the password. I guess this is the problem.

Authentication is required to start 'mosquittosystemctl.service'. Authenticating as: Ubuntu (ubuntu) Password:

brocaar commented 7 years ago

Could you try the same command, but then with sudo in front of it, thus sudo systemctl start mosquitto? This might actually be related to https://github.com/jpmens/mosquitto-auth-plug/issues/269.

I will investigate if there is a way to work around this in the Ansible playbooks.

qbee-io commented 7 years ago

It runs without a feedback. Looking at it yields: Aug 02 18:40:41 ubuntu-xenial systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker... Aug 02 18:40:43 ubuntu-xenial mosquitto[1173]: * Starting network daemon: mosquitto Aug 02 18:40:43 ubuntu-xenial mosquitto[1173]: ...done.

But I still get:

Aug 02 18:44:13 ubuntu-xenial lora-app-server[1385]: time="2017-08-02T18:44:13Z" level=error msg="handler/mqtt: connecting to broker error, will retry in 2s: Network Error : dial tcp 127.0.0.1:1883: getsockopt: connection refused"

Your help is really appreciated. As you probably have guessed I am still very new to this.

ghost commented 7 years ago

Hi Brocaar, I'v vagranted up the new version of loraserver-setup and the virtual machine was up but it cant connect to the lora-server-app even UI or aPI.

ghost commented 7 years ago

HELLO @syntrop !

Good News1 I was attempting to access https://localhost:8080 also but it was not working :( But as @brocaar has said, we cannor forget to write the JW token at the file. So when you run "vagrant up", the Vagrantfile brings the machines up, but not the localhost page yet. Please, follow the commands bellow:

acess the virtual machine using ssh, sou at the directory of vagrantfile, open a terminal and type:

vagrant ssh

Genarate a token code:

openssl rand base64 32

Copy the code to the loraserver file and edit the almost last one topic:

sudo nano /etc/default/loraserver at: -->JWT secret used by the gateway api server for gateway authentication / author$ -->You could generate this by executing 'openssl rand -base64 32' for example GW_SERVER_JWT_SECRET=

Then realize vagrant reload!

Be happy! :1st_place_medal:

brocaar commented 7 years ago

An other option is to perform a vagrant provision. That will update all the configuration to the latest state.