question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Remote harvesters fail to connect when main farmer's IP address changes

See original GitHub issue

Describe the bug When using remote harvesters, if the farmer is set to a hostname instead of an IP address in the configuration file, then they will repeatedly fail to reconnect if the farmer changes IP address:

23:04:43.790 harvester harvester : INFO Reconnecting to peer {'host': '(OLD IP ADDRESS)', 'port': 8447}

To reproduce

  1. Set up a main farming machine and one or more remote harvesters
  2. In the configuration file, set farmer_peer->host to the hostname of the farmer
  3. Change the IP address of the farmer
  4. Check the error log of the harvester

Expected behavior The remote harvester should not cache the IP address. DNS lookups should be performed on non-caching authoritative servers, either in the first instance or once the remote harvester has failed to connect X number of times.

In the remote harvester wiki page, it does mention to use an IP address. But a hostname should also be acceptable. Firstly, because the configuration parameter is named as host and by default is set to localhost. Secondly, it will be more convenient for many people using DDNS services.

In addition, this error is repeatedly raised every ~14 seconds but is only logged at INFO level. Since it prevents farming, it should be raised at a higher level, either on the first failed connection, or after X number of repeated failed connections.

Environment

  • OS: Linux
  • OS Version/Flavor: Ubuntu Server 20.04.2

Additional context The problem may also occur with other hostname configuration fields, such as connecting to a remote note or connecting to a remote daemon in “UI only mode”. But I have not tested this and only encountered the issue with remote harvesters.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jcasccommented, Apr 28, 2021

I think this is because the hostname is only resolved once and from then on, only the IP is used. A possible fix could be to add this one line

            ...
            if peer_retry: #line 20
                #### DynDNS Fix Attempt
                peer_info = PeerInfo(socket.gethostbyname(peer_info_arg.host), peer_info_arg.port)
                ####
                log.info(f"Reconnecting to peer {peer_info}")
            ...

to chia/server/reconnect_task.py

This would hopefully re-translate the hostname whenever a reconnection is attempted.

0reactions
smasharovcommented, Jul 28, 2021

The problem still exist in the 1.2.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Please confirm expected output for remote harvester. #3157
Set up a remote harvester according to the instructions. Expected behavior. I would expect to see a connection to the wallet, full node...
Read more >
Remote harvester cannot connect to farmer, also SSH stopped ...
I tried restarting main farm with no luck, still connection refused. So I installed GPU in that PC and connected monitor to check...
Read more >
Harvester is not working - no connection to node - Chia Forum
I have a WinServ 2016 running fullnode and a ubuntu for plotting and farming. FullNode running well, but the harvester. Harvester can plot ......
Read more >
How to harvest on other machines that are not your main ...
Open the ~/.chia/mainnet/config/config.yaml file in each harvester, and enter your main machine's IP address in the remote harvester's farmer_peer section ...
Read more >
OpenBSI Harvester Manual (D5120) - Emerson
Configuring Your Controller to Work with the Harvester ... Clearing Error, Status, and Timestamp Information using 'Init Collection'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found