open-ethereum-pool icon indicating copy to clipboard operation
open-ethereum-pool copied to clipboard

Error while refreshing block template on main: no mining work available yet

Open elruizo opened this issue 5 years ago • 24 comments

System information

Geth version: Geth Version: 1.8.15-stable Git Commit: 89451f7c382ad2185987ee369f16416f89c28a7d Architecture: amd64 Protocol Versions: [63 62] Network Id: 1 Go Version: go1.10 Operating System: linux GOPATH= GOROOT=/usr/lib/go-1.10

Redis version: Redis server v=4.0.11 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=75d43a05cbcfbea

OS & Version: Linux Ubuntu 16.04

Commit branch and hash: master

Expected behaviour

I don't know what is expected behaviour since I never managed it to work, I've tried the process 3 times from scratch and always getting same results.

Actual behaviour

When i run /build/bin/open-ethereum-pool config.json I get following output.

Steps to reproduce the behaviour

/build/bin/open-ethereum-pool config.json

Backtrace

./build/bin/open-ethereum-pool config.json
2018/09/20 12:06:16 Loading config: /home/ubuntu/open-ethereum-pool/config.json
2018/09/20 12:06:16 Running with 2 threads
2018/09/20 12:06:16 Backend check reply: PONG
2018/09/20 12:06:16 Starting API on 0.0.0.0:8080
2018/09/20 12:06:16 Set stats collect interval to 5s
2018/09/20 12:06:16 Set purge interval to 10m0s
2018/09/20 12:06:16 Purged stale stats from backend, 0 shares affected, elapsed time 144.839µs
2018/09/20 12:06:16 Stats collection finished 6.498077ms
2018/09/20 12:06:16 Policy state refresh complete
2018/09/20 12:06:16 Set policy stats reset every 1h0m0s
2018/09/20 12:06:16 Set policy state refresh every 1m0s
2018/09/20 12:06:16 Running with 8 policy workers
2018/09/20 12:06:16 Upstream: main => http://127.0.0.1:8545
2018/09/20 12:06:16 Upstream: backup => http://127.0.0.2:8545
2018/09/20 12:06:16 Default upstream: main => http://127.0.0.1:8545
2018/09/20 12:06:16 Stratum listening on 0.0.0.0:8008
2018/09/20 12:06:17 Error while refreshing block template on main: no mining work available yet
2018/09/20 12:06:17 Set block refresh every 120ms
2018/09/20 12:06:17 Starting proxy on 0.0.0.0:8888
2018/09/20 12:06:17 Error while refreshing block template on main: no mining work available yet
```

I've also noticed that ethereum node is sometimes in sync and sometimes a little behind.

elruizo avatar Sep 20 '18 12:09 elruizo

While I am proud of you for including all the necessary info...This error has been discussed in many issues already. You cant have mining work without a fully synced chain, otherwise how would you know what hashes to mine against?

mikeyb avatar Sep 20 '18 14:09 mikeyb

Hello I have exactly the same issue, my geth is synced:

Welcome to the Geth JavaScript console!

instance: Geth/v1.8.15-stable-89451f7c/linux-amd64/go1.10 modules: eth:1.0 rpc:1.0 web3:1.0

eth.syncing false

user@hostname:~/open-ethereum-pool$ ./build/bin/open-ethereum-pool config.json 2018/09/21 14:22:31 Loading config: /home/user/open-ethereum-pool/config.json 2018/09/21 14:22:31 Running with 2 threads 2018/09/21 14:22:31 Backend check reply: PONG 2018/09/21 14:22:31 Starting API on 0.0.0.0:8080 2018/09/21 14:22:31 Set stats collect interval to 5s 2018/09/21 14:22:31 Set purge interval to 10m0s 2018/09/21 14:22:31 Purged stale stats from backend, 0 shares affected, elapsed time 9.902172ms 2018/09/21 14:22:31 Stats collection finished 203.54µs 2018/09/21 14:22:31 Policy state refresh complete 2018/09/21 14:22:31 Set policy stats reset every 1h0m0s 2018/09/21 14:22:31 Set policy state refresh every 1m0s 2018/09/21 14:22:31 Running with 8 policy workers 2018/09/21 14:22:31 Upstream: main => http://127.0.0.1:8545 2018/09/21 14:22:31 Upstream: backup => http://127.0.0.2:8545 2018/09/21 14:22:31 Default upstream: main => http://127.0.0.1:8545 2018/09/21 14:22:31 Stratum listening on 0.0.0.0:8008 2018/09/21 14:22:31 Error while refreshing block template on main: no mining work available yet 2018/09/21 14:22:31 Set block refresh every 120ms 2018/09/21 14:22:31 Starting proxy on 0.0.0.0:8888 2018/09/21 14:22:31 Error while refreshing block template on main: no mining work available yet 2018/09/21 14:22:31 Error while refreshing block template on main: no mining work available yet 2018/09/21 14:22:31 Error while refreshing block template on main: no mining work available yet 2018/09/21 14:22:32 Error while refreshing block template on main: no mining work available yet 2018/09/21 14:22:32 Error while refreshing block template on main: no mining work available yet

bgadmin avatar Sep 21 '18 14:09 bgadmin

Not in sync. If it was in sync, it fell out of sync. Use a better server. The error tells you exactly what is wrong, stop thumbs downing the proper answers, other users will mistake your lack of understanding and confusion in how blockchain works and think you are right when you are absolutely WRONG

mikeyb avatar Sep 21 '18 15:09 mikeyb

For those who don't get it. The entire blockchain on your server (ie. everyone posting here about syncing issues) must be ran, transaction by transaction. You are running a WORLD COMPUTER. If your node isnt powerful enough, you will never keep up with all the transaction processing in each block. This will cause you to go out of sync, even if just for a few minutes.

While out of sync...YOU DO NOT HAVE THE LATEST BLOCKCHAIN INFO AND THEREFORE YOU CANNOT MINE BECAUSE YOUR CLIENT WOULD BE MINING ON A BLOCK HEIGHT ALREADY MINED.

If you cannot stay in sync...IT IS BECAUSE YOUR SERVER IS A PIECE OF TRASH AND DOES NOT HAVE THE COMPUTING POWER NECESSARY TO BE PART OF A WORLD COMPUTER. STOP POSTING ISSUES DUE TO YOUR INCOMPETENCE. IT JUST MAKES YOU LOOK MORE INCOMPETENT WHEN YOU THUMBS DOWN ACCURATE INFO.

mikeyb avatar Sep 21 '18 15:09 mikeyb

@bgadmin I am betting with 100% certainty that if you looked at your geth logs it would say "Syncing" and not "Importing" when you see these issues. You didnt post those logs because they would contradict your near sighted cry for help. Just because the client synced up one time, does not mean it will stay synced. This is a misunderstanding of how blockchains work on your part.

mikeyb avatar Sep 21 '18 15:09 mikeyb

@mikeyb Thank you for the explanation of how blockchain work, you are very helpful and profesional. By going through this gh repo I managed to find that develop branch is updated and master is not - which doesn't mean you were wrong about explanation. I just want to explain here what happened because it might help other people. Geth client is not syncing well on AWS period. Even when it was in sync it couldn't keep up all the time. I've managed to fully sync with parity. This was hardware issue. By using parity v2 and develop branch everything is working normally regarding this issue.

@mikeyb There is no need for this kind of profesionalism if you are already active on public repo in community try to be friendly. Just a little suggestion, because I've saw your responses on other issues and they don't look nice for your image.

bgadmin avatar Oct 01 '18 11:10 bgadmin

=] when people learn to think for themselves they will find the answers they seek without mis-using a bug tracker

mikeyb avatar Oct 01 '18 13:10 mikeyb

What if I’m getting this error on my pool and my Blockchain is synced?

medleye27 avatar Oct 01 '18 16:10 medleye27

Then it fell out of sync. Get a more powerful server. This wont run on average hardware anymore. You are part of a world computer, so you must process EVERYTHING that comes through it. If your server gets behind, you will see this issue.

mikeyb avatar Oct 01 '18 16:10 mikeyb

The server is more than powerful enough because I’m actually using a server not just my toaster. Any other tips?

medleye27 avatar Oct 01 '18 16:10 medleye27

Nope, because that is your problem. Get a better toaster

mikeyb avatar Oct 01 '18 17:10 mikeyb

Or at least post the logs proving you are in sync instead of saying it like you know.

Let me explain in toaster language.

If your server falls behind, it cannot serve the latest hashes to your mining pool. It knows the latest block, and if our server does not have the latest block processed, then it will give that error. THAT IS THE ONLY REASON, PERIOD.

mikeyb avatar Oct 01 '18 17:10 mikeyb

2x xeon 2650s and 16gb ddr3 is not enough to run a Blockchain? What do you recommend I use?

medleye27 avatar Oct 01 '18 17:10 medleye27

Your log files

mikeyb avatar Oct 01 '18 17:10 mikeyb

I’m blaming geth and downloading parity, I’ll post my logs when this errors out, shouldn’t be long.

medleye27 avatar Oct 01 '18 17:10 medleye27

Probably a smart move considering Geth is a reference client with all features and parity is a optimized client

mikeyb avatar Oct 01 '18 17:10 mikeyb

Oh, and make sure you use the develop branch of this repo with Parity or you will hit a whole other set of problems

mikeyb avatar Oct 01 '18 17:10 mikeyb

I have same problem. Geth is synced.

eth.blockNumber 6696198 eth.getBlock("latest").number 6696198 eth.syncing false net.peerCount 22

PandemRus avatar Nov 13 '18 09:11 PandemRus

please send sample geth command i try etig geth but write pool Error while refreshing block template on main: no mining work available yet

mdikmetas avatar Dec 26 '18 18:12 mdikmetas

probably are not fully synced

mikeyb avatar Dec 26 '18 19:12 mikeyb

I'm experiencing the same issue. I am fully synced and my log files show importing, not Syncing. I verified 8545 is open and taking requests as well. This is frustrating to say the least. As for server resources, the box is a dual xeon with 10 cores per proc, 32 GB of mem and a 500GB SSD. So the server hardware is not the problem.

INFO [01-08|14:37:48.100] Imported new chain segment

eth.syncing false

2019/01/08 14:38:19 Loading config: /home/data011pool/open-ethereum-pool/config.json 2019/01/08 14:38:19 Running with 2 threads 2019/01/08 14:38:19 Backend check reply: PONG 2019/01/08 14:38:19 Starting API on 0.0.0.0:8080 2019/01/08 14:38:19 Set stats collect interval to 5s 2019/01/08 14:38:19 Set purge interval to 10m0s 2019/01/08 14:38:19 Policy state refresh complete 2019/01/08 14:38:19 Set policy stats reset every 1h0m0s 2019/01/08 14:38:19 Set policy state refresh every 1m0s 2019/01/08 14:38:19 Running with 8 policy workers 2019/01/08 14:38:19 Upstream: main => http://127.0.0.1:8545 2019/01/08 14:38:19 Upstream: backup => http://127.0.0.2:8545 2019/01/08 14:38:19 Default upstream: main => http://127.0.0.1:8545 2019/01/08 14:38:19 Stratum listening on 0.0.0.0:8008 2019/01/08 14:38:19 Purged stale stats from backend, 0 shares affected, elapsed time 1.591894ms 2019/01/08 14:38:19 Stats collection finished 240.392µs 2019/01/08 14:38:19 Error while refreshing block template on main: no mining work available yet 2019/01/08 14:38:19 Set block refresh every 120ms 2019/01/08 14:38:19 Starting proxy on 0.0.0.0:8888 2019/01/08 14:38:19 Error while refreshing block template on main: no mining work available yet

Any other ideas? Did I miss something else config wise in the config.json file?

phaelon74 avatar Jan 08 '19 22:01 phaelon74

After 2 days of banging my head against the wall, I decided to try parity. Geth ~ 5-6 hours to Sync ETH Block chain. Parity took ~35 minutes. Once Parity was up, I had to make the Open-Ethereum-pool Dev branch, but with that it's now happy as a clam.

Glad I finally got this working, kick ass sea bass!

phaelon74 avatar Jan 10 '19 16:01 phaelon74

You just need

Geth --rpc ...

add --mine

itsmylife44 avatar Feb 12 '19 12:02 itsmylife44

In my case it was the missing --mine that did the trick. Thankfully I was able to judge that my node was fully synced (it is listed on ethstats.net after all) so I know that was not the issue.

Also, since someone recommended a switch to Parity from Geth. My block import times are consistently lower on Geth than parity (it seems to have gotten worse in Parity in past releases). I'm switching from Parity to Geth for this specific reason.

salanki avatar Mar 05 '19 03:03 salanki