raspiblitz / raspiblitz

Get your own Bitcoin & Lightning Node running - on a RaspberryPi with a nice LCD
MIT License
2.46k stars 521 forks source link

Error Code 28 #91

Closed toxicsh0ck closed 6 years ago

toxicsh0ck commented 6 years ago

sudo: unable to resolve host "USERNAME" error code: -28 error message: Rewinding blocks... error code: -28 error message: Rewinding blocks... sudo: unable to resolve host "USERNAME"

loading block index... "Unable to resolve host"

Any ideas?

rootzoll commented 6 years ago

At which point in theprocess is that happening?

toxicsh0ck commented 6 years ago

Its happening after the process has been completed and I am seeing the LND main screen, and then the error text scrolls down in orange.

Would this have anything to do with "Public IP” being in red and saying “unreachable”? This IP Is not my devices IP.

Thanks in advance and for your work on this, and appreciate your help. Not super tech savvy and the article was really helpful.

On Sep 13, 2018, at 5:43 AM, Christian Rotzoll notifications@github.com wrote:

At which point in theprocess is that happening?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rootzoll/raspiblitz/issues/91#issuecomment-420992779, or mute the thread https://github.com/notifications/unsubscribe-auth/ApMOdSBHPJxH_N3KCWMMmnn-xQnZrCcWks5ualLagaJpZM4WkfsA.

whiteyhat commented 6 years ago

Do not worry. Error code 28 means block synced. It should automatically load and connect to your blitz

vmavromatis commented 6 years ago

Same issue happens to me (copied the blockchain from my hdd). Main screen says:

                                                                              ┌────────────────── bitcoin /  ─────────────────────┐
                                                                              │  Lightning Rescanning Blockchain                  │  
                                                                              │  Progress: ?/                                     │  
                                                                              │  Please wait - this can take some long time.      │  
                                                                              │  Its OK to close terminal and ssh back in later.  │  
                                                                              └───────────────────────────────────────────────────┘  

@CarlosRoldanx @rootzoll I suppose I should just wait?

EDIT: This is my debug.log:

admin@RaspiBlitz:/mnt/hdd/bitcoin $ tail debug.log 
2018-09-16 09:42:49 LoadBlockIndexDB: last block file = 1334
2018-09-16 09:42:49 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=169, size=133459966, heights=534304...535193, time=2018-07-29...2018-08-04)
2018-09-16 09:42:49 Checking all blk files are present...
2018-09-16 09:42:49 Unable to open file /home/bitcoin/.bitcoin/blocks/blk01335.dat
2018-09-16 09:42:49 : Error loading block database.
Please restart with -reindex or -reindex-chainstate to recover.
2018-09-16 09:42:49 Aborted block database rebuild. Exiting.
2018-09-16 09:42:49 Shutdown: In progress...
2018-09-16 09:42:49 scheduler thread interrupt
2018-09-16 09:42:49 Shutdown: done
whiteyhat commented 6 years ago

Yes, make sure you're connected to the internet and try the funding option.

If you're not synced he wallet will not be created and will display the same error.

Try again after X amount of time. If this time the wallet is created blocks are synced and you're connected

vmavromatis commented 6 years ago

Update: Restarted and now getting the following

****************************************************************************
Unlock LND Wallet --> lncli --chain=bitcoin unlock
****************************************************************************
HELP: Enter your PASSWORD C
****************************************************************************
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)
Input wallet password: 

Funding error:

[lncli] rpc error: code = Unavailable desc = grpc: the connection is unavailable
FAIL PRECHECK - lncli getinfo shows 'synced_to_chain': false - wait until chain is sync 

******************************
TODO
******************************
Send REAL Bitcoin to address --> 
Whats next? --> Wait for confirmations. You can use lnbalance for main menu or info on LCD to check if funds have arrived.

Press ENTER to return to main menu.
^Cadmin@vasilightning:~ $ lncli --chain=bitcoin newaddress np2wkh
[lncli] rpc error: code = Unavailable desc = grpc: the connection is unavailable

After another restart:

****************************************************************************
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)
Input wallet password: 
[lncli] rpc error: code = Unavailable desc = grpc: the connection is unavailable

And here are the lnd service logs:

Sep 16 13:25:07 vasilightning systemd[1]: Stopped LND Lightning Daemon.
Sep 16 13:25:25 vasilightning systemd[1]: Started LND Lightning Daemon.
Sep 16 13:25:26 vasilightning lnd[14561]: Attempting automatic RPC configuration to bitcoind
Sep 16 13:25:26 vasilightning lnd[14561]: Automatically obtained bitcoind's RPC credentials
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.058 [WRN] LTND: /home/bitcoin/.lnd/lnd.conf:22: unknown option: bitcoind.rpchost
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.059 [INF] LTND: Version 0.5.0-beta commit=a1f549754b61c1ba84466f0226997687127f7fc0
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.059 [INF] LTND: Active chain: Bitcoin (network=mainnet)
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.059 [INF] CHDB: Checking for schema update: latest_version=5, db_version=5
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.064 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.065 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.068 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
^C
admin@vasilightning:~ $ lncli unlock
Input wallet password: 

lnd successfully unlocked!
admin@vasilightning:~ $ sudo journalctl -f -u lnd
-- Logs begin at Sun 2018-09-16 13:08:34 CEST. --
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.059 [INF] LTND: Active chain: Bitcoin (network=mainnet)
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.059 [INF] CHDB: Checking for schema update: latest_version=5, db_version=5
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.064 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.065 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
Sep 16 13:25:26 vasilightning lnd[14561]: 2018-09-16 13:25:26.068 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
Sep 16 13:26:10 vasilightning lnd[14561]: 2018-09-16 13:26:10.384 [INF] LNWL: Opened wallet
Sep 16 13:26:11 vasilightning lnd[14561]: 2018-09-16 13:26:11.132 [INF] LTND: Primary chain is set to: bitcoin
Sep 16 13:26:11 vasilightning systemd[1]: lnd.service: Main process exited, code=exited, status=1/FAILURE
Sep 16 13:26:11 vasilightning systemd[1]: lnd.service: Unit entered failed state.
Sep 16 13:26:11 vasilightning systemd[1]: lnd.service: Failed with result 'exit-code'.
toxicsh0ck commented 6 years ago

Thank you,

Moving forward, I tried to establish some channels and fund them, but received this error. I believe this has to do with the earlier error message I was receiving. Any thoughts?

Thanks again in advance for the help.

On Sep 15, 2018, at 4:02 PM, WhiteyHat notifications@github.com wrote:

Do not worry. Error code 28 means block synced. It should automatically load and connect to your blitz

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rootzoll/raspiblitz/issues/91#issuecomment-421650269, or mute the thread https://github.com/notifications/unsubscribe-auth/ApMOdQVJNUE9eyR84TjZEnotraqV6djtks5ubYcagaJpZM4WkfsA.

whiteyhat commented 6 years ago

I think it is related with either connection to the Internet. Or syncing issues with LND

toxicsh0ck commented 6 years ago

Great, thanks for the feedback. If its a syncing issue with LND, any suggestions on how to remedy?

If its an internet connection issue, I assume this would be within the Router settings. Can you guys please confirm what port LND runs on so I can ensure the device is set up appropriately?

Thank you.

On Sep 16, 2018, at 11:04 AM, WhiteyHat notifications@github.com wrote:

I think it is related with either connection to the Internet. Or syncing issues with LND

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rootzoll/raspiblitz/issues/91#issuecomment-421805616, or mute the thread https://github.com/notifications/unsubscribe-auth/ApMOdRLEvMYLWGCy9rRRD95sJawAd3K_ks5ubpLKgaJpZM4WkfsA.

whiteyhat commented 6 years ago

9735 But normally doesn't need a manual correction. You should be able to sync automatically, if you need a quicker help, ping me on telegram. I'm @whiteyhat

rootzoll commented 6 years ago

Just a side note: Error Code 28 can also be displayed while bitcoind is doing some migration work or catchup/verifing. Normally this just takes time ... but if anybody has still a permanent Error Code 28 even with the latest version sd card image (2018-09-22) please write your report here. I will check after I get back from vacation.

svorob commented 6 years ago

Here's what I am getting during set up after upgrading to the latest image:

OK - bitcoind is running
Next step run Lightning

*** Checking bitcoin ***
OK - bitcoind is running

*** Test if chaninnetwork is ready ...
1537720422
result()
error(error code: -28
error message:
Verifying blocks...)
2018-09-23T16:32:13Z Opening LevelDB in /home/bitcoin/.bitcoin/indexes/txindex
2018-09-23T16:32:13Z Opened LevelDB successfully
2018-09-23T16:32:13Z Using obfuscation key for /home/bitcoin/.bitcoin/indexes/txindex: 0000000000000000
2018-09-23T16:32:13Z Upgrading txindex database... [0%]
2018-09-23T16:32:13Z Upgrading txindex database... [39%]
Waiting 1 minute and then trying again ...

and goes on indefinitely without actually making any progress. However, every time I restart, the second number gets a little bit larger. Would appreciate any help, thank you.

svorob commented 6 years ago

Never mind, it started making progress after I left it for a while.

machasm1 commented 6 years ago

This error is caused by the bitcoind still catching up or restarting. In particular if you have copied the blockchain from another devide WITHOUT txindex enabled then the blockchain will need to be rebuilt which takes a loooong time (Days or even weeks if you are trying to rebuild on the pi). Make sure you have a copy of the blockchain which has been synced using the txindex set. I had this problem myself and ended up firing up bitcoin-qt on my main PC which has a much more powerful CPU and RAM and then re-indexed the blockchain on that machine using the txindex option. Once completed I then copied the chainstate and index folders to the raspibolt in the /mnt/hdd/bitcoin directory (chainstate) and /mnt/hdd/bitcoin/blocks directory for (Index). After that it all started working just fine.

rootzoll commented 6 years ago

The update of torrent and FTP (issue #127) should fix/reduce this for next release.

rootzoll commented 6 years ago

With the transition to bitcoin 0.17.0 and the new blockchain downloads, this should not be a an issue anymore. closing.