erlang-libp2p icon indicating copy to clipboard operation
erlang-libp2p copied to clipboard

IP change not detected

Open madninja opened this issue 3 years ago • 150 comments

Many EU ISPs change consumer IP addresses every 24-48 hours.

There have been a number of reports where the IP address changes, and while the API has a recent peerbook record the IP address was not updated to reflect the change either never, or it took a very long time which put it past the time for the next IP update.

Restarting the hotspot seems to fix it every time this was observed.

The theory is that IP change detection is failing, not being done often enough or not being done at all?

madninja avatar Aug 16 '21 19:08 madninja

This occurs in the helium OG, and rak's. This happens on occasion. With about 50+ miners this has only occurred a few times with me. I have use a wifi outlet that I can remotely turn off and on. It is a minor inconvenience for me, but for others this might be worse as the hotspots aren't able to be adjusted properly.

maco2035 avatar Aug 16 '21 23:08 maco2035

This problem also happens with bobcat.

leyuansugar avatar Aug 19 '21 23:08 leyuansugar

NO BEACONS

I've recently experienced the exact problem with 2 of my hosts and miners where they did not send any beacons for over 9 days which was concerning, when we rebooted their routers beacons started to happen again in the next few hours.

This problem has now become more of a recent report of events by several people in the South African Helium Community, as our ISP also changes IPs every 24-48 hours.

And there are now several hotspots where you would see they have not sent beacons at all in the last week or more and they are not even aware of this problem or how to resolve it.

This is becoming a problem now for us as we are starting to witness less as beacons are not being sent due to this problem.

And we have seen this with Bobcat and Sensecap miners.

Hope this will get as much attention to be resolved as soon as possible, please.

wghewitt avatar Aug 19 '21 23:08 wghewitt

Can anyone affected help me troubleshoot this? I need access to an affected hotspot, or at least the logs from it.

Vagabond avatar Aug 20 '21 16:08 Vagabond

what exactly is needed, i can provide it because i am affected by this problem.

chillbreak avatar Aug 21 '21 16:08 chillbreak

@chillbreak a hotspot name would be helpful. It’s easiest for the core team if it’s an OG or Rak

abhay avatar Aug 21 '21 19:08 abhay

Prehistoric pearl dinosaur

chillbreak avatar Aug 21 '21 19:08 chillbreak

I've seen the issue and reproduced it with the following test:

  1. Hotspot behind CG NAT (shared IP) and thus relayed
  2. Route hotspot through a VPN to a public IP
  3. Forward port 44158
  4. Peerbook "listen ip" is updated from the relay address to the CG NAT shared IP, and not the VPN public IP that it's actually using. It is as if the hotspot caches the IP it initially discovered and never bothers to check it again.

radicale avatar Aug 21 '21 22:08 radicale

I know what the problem is, I just don't know why it happens. Prehistoric pearl dinosaur is not a hotspot I have support access too, unfortunately.

Vagabond avatar Aug 22 '21 00:08 Vagabond

A simple reboot of the miner/hotspots resolves the issue, as during reboot it checks for an public ip change. This has to be implemented periodically, as it is nothing high sophisticated... But this issue is quite critical, as in some cases this would result in an unreachable miner for several days/months.

westerwalder avatar Aug 22 '21 10:08 westerwalder

I know what the problem is, I just don't know why it happens. Prehistoric pearl dinosaur is not a hotspot I have support access too, unfortunately.

Perhaps try to reproduce it by changing the outward facing IP of a hotspot or test setup? Are you having trouble reproducing the issue?

radicale avatar Aug 22 '21 10:08 radicale

@Vagabond if you DM me and we have a willing volunteer from https://github.com/NebraLtd/helium-miner-software/issues/108 I can give you logs / info about the HS. I know @dakky221 has this issue

shawaj avatar Aug 22 '21 17:08 shawaj

Yeah, I'm having the same issue, and I "fixed" it by plugging the miner into a smart-plug and making it reboot the miner on IP change, but that will only decrease the lifespan of the hotspot and must be other way around, like @westerwalder said - add periodically check for public ip, for example every 5 minutes, it would fix the issue entirely.

dakky221 avatar Aug 22 '21 17:08 dakky221

btw @shawaj unfortunatley my Nebra is now behind CGNAT on a semi-static IP so my logs won't really help. I can share the Sensecap's logs though if there is a way to get them.

dakky221 avatar Aug 22 '21 17:08 dakky221

Yep, plugged my hs on a timer as well to reboot every 24h. Currently takes 2-3 hrs to reflect updated IP, but lag seems to increase (week before: ~1hr) due to network growth(?).

danggoma avatar Aug 22 '21 17:08 danggoma

By (unsafely) rebooting it that often, you can directly say goodbye to the sd-card/filesystem..

westerwalder avatar Aug 22 '21 18:08 westerwalder

I have cloned SD-Cards as backup should that happen. But I'm about to switch to tunneling a static IP instead.

danggoma avatar Aug 22 '21 19:08 danggoma

By (unsafely) rebooting it that often, you can directly say goodbye to the sd-card/filesystem..

Well, hopefully the libp2p gets updated to periodically check for external IP before the sd-card goes kaboom ;)

dakky221 avatar Aug 22 '21 22:08 dakky221

I should have a fix for this today or tomorrow that we can test.

Vagabond avatar Aug 23 '21 14:08 Vagabond

I should have a fix for this today or tomorrow that we can test.

That is fantastic, will this fix be rolled out in an OTA on all miners or how will the update be released?

wghewitt avatar Aug 23 '21 14:08 wghewitt

I should have a fix for this today or tomorrow that we can test.

I can renew the IP as many times as you wish on my VDSL2 connection, but the hotspot is Sensecap, so if they can deploy the updated firmware we can test.

dakky221 avatar Aug 23 '21 14:08 dakky221

possible related: https://github.com/helium/erlang-libp2p/issues/376

ci-work avatar Aug 24 '21 18:08 ci-work

Has this improved any now both PRs are merged and deployed?

Vagabond avatar Aug 25 '21 20:08 Vagabond

There is no way to be sure if the fix worked or it didn't. Listen addr doesn't change on external IP change, but I guess that's normal because it gets it from the API and API is too slow to be of any use. I also guess manufacturers should add to the dashboard some kind of a log if the hotspots sent the new IP to the peers to be sure...

dakky221 avatar Aug 26 '21 00:08 dakky221

My isp updated the ip address about 10 hours ago, but looking at the address on the api it still shows the previous one. but when I just checked inside peerbook it shows the correct ip address, of course I had rebooted the hotspot before that so not sure if it was the reboot that made the peerbook change. but as of the time of the comment the api still shows the wrong address.

leyuansugar avatar Aug 26 '21 09:08 leyuansugar

Rebooting the hotspot will find the new address, yes. The API may not have a perfectly up to date view of the system so it may take a while to see the IP change (if the hotspot notices it).

Vagabond avatar Aug 26 '21 13:08 Vagabond

OK, just to add: I didn't reboot the hotspot since the IP change. 10 hours already passed and it's not updated on peerbook or API. Listen addr. is still the yesterday's IP. Will reboot hotspot now, I guess 10 hours is enough of waiting to see that fix isn't working.

dakky221 avatar Aug 27 '21 10:08 dakky221

It pains me to say that my Sensecap on firmware 2021.08.24.4 still shows the same behaviour and has not updated its IP address in several days (API and peerbook). Consequently the last beacon it performed was 5 days ago (compounded by the block halt issue).

radicale avatar Aug 27 '21 11:08 radicale

Ok, I guess I can't fix it blind. I need details on these affected hotspots (manufacturer and hotspot name) so I can try to get some logs from them. You can privately provide me details via email to [email protected]

Vagabond avatar Aug 27 '21 13:08 Vagabond

All of my sensecaps (all on newest fw) are still affected. Only a reboot will result in an updated listen-ip information due to a changed ISP public ip change.

westerwalder avatar Aug 27 '21 13:08 westerwalder