Redis connection error: dial tcp [::1]:6379: connect: connection refused (code: 2) in Gateway OS

Hello,

I was trying to give the Gateway OS a Static IP, and as per the rules I edited the “interfaces file” under /etc/network as follows:

#Wired or wireless interfaces 
auto eth0
iface eth0 inet static
  address 192.168.1.2
  netmask 255.255.255.0
  network 192.168.1.0
  gateway 192.168.1.1

After rebooting the Gateway OS, I was able to see through ifconfig that the Static IP was allotted to it. But as soon as I accessed the Chirpstack Application Server through localhost:8080, and clicked on any registered Application, it showed the following error:
redis connection error: dial tcp [::1]:6379: connect: connection refused (code: 2)

Now, if I allot the same Static IP as above but keep the netmask and the gateway as default i.e. :-

#Wired or wireless interfaces 
auto eth0
iface eth0 inet static
  address 192.168.1.2
  netmask 255.255.255.0
  network 192.168.7.0
  gateway 192.168.7.1

and reboot the gateway, it still gets the Static IP as shown by the ifconfig command, and I am able to also access the Chirpstack Application Server without any error by the Redis.

But as can been seen, as the IP address belongs to the Class C network; the first three bytes, 192.168.1 forms the network. The final byte in this example, 2, is the host.
So the network and gateway IP’s should fall within the network.

Therefore the configurations provided in the latter case should be technically wrong, and the former configurations should be correct.
But the chirpstack application server cannot connect to Redis on the former Static IP Configurations.

Also, I cannot change the redis bind address to 0.0.0.0 in /etc/redis/redis.conf as that is not a solution to this problem and anyone can connect to this Redis instance, which is highly insecure.

It would be great if someone could solve my problem!
Thank you so much!

hey @brocaar, it would be kind of you, if you could throw some light on this!

Thank you

I don’t have an answer to your question. Hopefully somebody else can step in into this :slight_smile:

1 Like

okay thank you for replying @brocaar! :slightly_smiling_face:

Hi,

So the answer can be found here (follow the github link):

I am currently using Chirpstack Gateway OS 3.2.0test1 raspberrypi3. This bug seems to be resolved in the versions after that.

This topic can be considered as Closed.
Thank you!

Hi @brocaar,

Even though I solved the error related to the Redis, I am now having problems while assigning Static IP to the gateway os.

I want to set the Static IP Configurations as follows:

After setting it, as soon as I try to ping 192.168.1.2 , it says destination host unreachable. Also, I am not able to ssh to this ip.

But, if I set my Static Ip Configurations as follows:

I am able to ping and ssh, the ip i.e. 192.168.1.2. (Even though the latter configurations are wrong)

Can you please throw some light on this? I have been stuck on this for a while now!

Thank you!

Please lets not mix different topics :slight_smile:

1 Like