DUCO: Error message 'Server Timeout', (host='server.duinocoin.com', port=443)

What to do if miners can't contact the Duinocoin server?

If the Duinocoin network is under (too) heavy load or if a comedian has started another DDoS attack, the miners will time out when trying to connect. There is a solution.

Sometimes the pool servers - for whatever reason - do not respond to requests from the miners. On the one hand, this is annoying because at that moment your own miners cannot generate a DUCO. On the other hand, it can also cost a lot of time when troubleshooting your own mining rig, because it is not always clear at first whether the error lies in the software for the rig or with the servers.

When the PC miner or the AVR miner starts, it first asks server.duinocoin.com for the IP address and the port of a mining node via HTTPS. If the server is overloaded, the miner does not receive a reply but times out.

/img/tipps_tricks/Error_I2C-Miner-Timeout.png

Duration timeout with the Duinocoin I²C miner for the Raspberry Pi.

This timeout was only 5 seconds with the older mining software and with the DuinocoinI2C-Miner for the Raspberry Pi by JK-Rolling - this is a bit too little when the mining servers are busy.

Locate the problem

When starting the AVR-I²C-Miner for the Raspberry Pi.

python3 AVR_Miner_RPI.py

it hails error messages every 20 seconds (5 seconds timeout plus 15 seconds wait):

...
21:15:47  net0  Searching for the fastest node to connect to
21:14:52  net0  Error fetching mining node: HTTPSConnectionPool(host='server.duinocoin.com', port=443): Read  timed out. (read timeout=5), retrying in 15s
21:15:07  net0  Searching for the fastest node to connect to
21:15:12  net0  Error fetching mining node: HTTPSConnectionPool(host='server.duinocoin.com', port=443): Max retries exceeded with url: /getPool (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0xb5cbcb70>, 'Connection to server.duinocoin.com timed out. (connect timeout=5)')), retrying in 15s
...

A Duinocoin miner fetches its connection data from the Duinocoin main server via a "/getPool" request. You can even simulate this in your web browser

https://server.duinocoin.com/getPool

and receive as an answer for example

{"ip":"162.55.103.174","name":"diskos-pool-1","port":6000,"server":"duino-svko-1","success":true}*

In contrast to the miners, a web browser waits much longer until it times out. This (too) high load on the Duinocoin server is usually noticed by the fact that the 'Network stats & explorer' page <https://explorer.duinocoin.com/>`_ does not load or only loads partially.

Solution: Increase timeout

The solution in this case is quite simple: increase the timeout for the query in "AVR_Miner.py" or "AVR_Miner_RPI.py" (jk-rolling) a little, for example from 5 to 30 seconds as shown below:

...
response = requests.get(
   "https://server.duinocoin.com/getPool",
   timeout=30).json()
...

Now the PC waits a full 30 seconds for a response from the mining server.

Attention. This high value blocks the mining server! The value should be set back to 5 seconds as quickly as possible.