Describe the issue
If External IP changes, server sometimes loses incoming connections until daemon is restarted.
Can you reliably reproduce the issue?
Yes, although it can take several attempts.
If so, please list the steps to reproduce below:
- On the router configure port forwarding to 8333 (TCP & UDP)
- On the server, run
bitcoind -listen=1 -server=1 -upnp=1 -debug=net -onlynet=ipv4 -blocksonly = 1and let it establish incoming connections. - Then disable PPPoE, wait 10 mins, enable it again (to obtain a new IP address) and wait for it to again receive incoming connections.
Sometimes I need to try 2-3 times and wait 10-15 minutes until I re-enable pppoe. I'm not sure if it's simply a matter of trying several times or the length of disconnection has to be over X minutes. And in my case I always get a new IP address, so I'm not sure if that is what messes it up or simply the fact that it went offline for a while.
Expected vs. Actual behaviour
Expected: router continues forwarding incoming 8333 to $lan-ip:8333 and bitcoind server continues accepting incoming connections.
Actual: AdvertiseLocal changes to the new IP and ProcessMessages also shows the new external IP address, but incoming connections to bitcoind never recover. Only outgoing connections to the network recover.
What version of bitcoin-core are you using?
"/Satoshi:0.14.1/UASF-Segwit:0.3(BIP148)/"(v0.14.1.0-g1809845)
Any extra information that might be useful in the debugging process.
With Port Forwarding set up, uPnP shouldn't be required. I first tried Port Forwarding alone and noticed no difference.
I first built using "default" (from build-unix.md) instructions and then one more time with libupnp explicitly enabled in --configure and bitcoin.conf and was able to reproduce this independently of uPnP.
External port-check to $router-ip:8333 confirms the port is open after router (pppoe) restart.
Errors I get after external connections start failing:
2017-04-23 08:29:21 sending headers (82 bytes) peer=22
2017-04-23 08:29:21 received: inv (217 bytes) peer=23
2017-04-23 08:29:21 got inv: tx 8c7eb2218f2440aa729c43ab7ec01a0b4a21967b5cdf6c024989fb2cb73128f3 new peer=23
2017-04-23 08:29:21 transaction (8c7eb2218f2440aa729c43ab7ec01a0b4a21967b5cdf6c024989fb2cb73128f3) inv sent in violation of protocol peer=23
2017-04-23 08:29:21 got inv: tx c45cd995af1eb3f3e93827d50ce20b497f097ceb11c17786cd279012ada6099b new peer=23
2017-04-23 08:29:21 transaction (c45cd995af1eb3f3e93827d50ce20b497f097ceb11c17786cd279012ada6099b) inv sent in violation of protocol peer=23
2017-04-23 08:29:21 got inv: tx 55d0122ba1e9ff679ea0faccb03dee635bab4b82f0de10dc642f23ab42b31757 new peer=23
2017-04-23 08:29:21 transaction (55d0122ba1e9ff679ea0faccb03dee635bab4b82f0de10dc642f23ab42b31757) inv sent in violation of protocol peer=23
2017-04-23 08:29:21 got inv: tx 5cc62dd856948bbb208fbf621d2a40b0c7cb290a47589947d7f1a378adac08f3 new peer=23
2017-04-23 08:29:21 transaction (5cc62dd856948bbb208fbf621d2a40b0c7cb290a47589947d7f1a378adac08f3) inv sent in violation of protocol peer=23
2017-04-23 08:29:21 got inv: tx a0b8c68dfdc0f46be908da01a130c6b7c5fc558eaabf8345c395091e1954ed0c new peer=23
2017-04-23 08:29:21 transaction (a0b8c68dfdc0f46be908da01a130c6b7c5fc558eaabf8345c395091e1954ed0c) inv sent in violation of protocol peer=23
2017-04-23 08:29:21 got inv: tx f350743826f242945bd471f584238d95b9b702bb5c2d51e3a152b5e64da92144 new peer=23
2017-04-23 08:29:21 transaction (f350743826f242945bd471f584238d95b9b702bb5c2d51e3a152b5e64da92144) inv sent in violation of protocol peer=23
A more detailed log which shows two pppoe restarts (the second attempt was successful) can be found here (free pastebin, so it's going to remain for 30 days): https://pastebin.com/TiYpEnJe