Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to the Bitcoin network failed #4995

Closed
catoptro-mancy opened this issue Dec 23, 2020 · 7 comments
Closed

Connection to the Bitcoin network failed #4995

catoptro-mancy opened this issue Dec 23, 2020 · 7 comments

Comments

@catoptro-mancy
Copy link

It's a repeat of issue first reported on May, 22 (but was closed due to inactivity): #4271

Screen Shot 2020-12-22 at 4 44 02 PM

Version 1.5.1
MacOS

It seems to be a wallet corruption, rather than connectivity issue (as suggested by error message). A new wallet created by deleting Bisq folder and recovering wallet from seed words will resolve the issue and restore any funds, but open trades can't be restored in this way. This issue can't be resolved in open trades scenario when backups of Bisq folder are not available. Highly critical IMO

Stack trace from log:

Dec-22 17:46:19.876 [JavaFX Application Thread] ERROR b.c.b.s.WalletsSetup: Service failure from state: STARTING; failure={} org.bitcoinj.wallet.UnreadableWalletException: Could not connect 1565bcccaf7611b6bb19b32358531d8616e63421c947e35d22888d9501376951 to 5727a04a8fd0e54fd8d746f22c37d54f4d583a4d90f8ff79e6747f26c52cdafd
at org.bitcoinj.wallet.WalletProtobufSerializer.connectTransactionOutputs(WalletProtobufSerializer.java:745)
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:542)
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:474)
at bisq.core.btc.setup.WalletConfig.loadWallet(WalletConfig.java:402)
at bisq.core.btc.setup.WalletConfig.createOrLoadWallet(WalletConfig.java:372)
at bisq.core.btc.setup.WalletConfig.startUp(WalletConfig.java:278)
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62)
at com.google.common.util.concurrent.Callables$4.run(Callables.java:119)
at java.base/java.lang.Thread.run(Thread.java:844)

@boring-cyborg
Copy link

boring-cyborg bot commented Dec 23, 2020

Thanks for opening your first issue here!

Be sure to follow the issue template. Your issue will be reviewed by a maintainer and labeled for further action.

@chimp1984
Copy link
Contributor

@oscarguindzberg Do you know what could cause that exception? Does not seem that the wallet file got corrupted (user has SSD drive) but rather that data from previous version does not match... How can that happen, write operation is atomic I assume, so when it was valid at write time why its not valid at read time?

@oscarguindzberg
Copy link
Contributor

oscarguindzberg commented Dec 23, 2020

The wallet being read is in fact corrupt.
Maybe not corrupt in the sense of i/o error while writing it. Corrupt in the sense it is not consistent.
There is a tx output that is marked as spent by some txId and the tx for that txId is not present in the wallet.
maybe useful:

Both links mention 2 wallets. That makes me think of BSQ and BTC wallets in bisq. Maybe the same tx instance is being saved by both wallets. Maybe related bisq-network/bitcoinj#18 and bisq-network/bitcoinj#21

Another possible cause... I found a bug in bisq a month ago. Transaction inputs and outputs have a concept of parent transaction. The tx the input was spending from was used as parent tx. Parent transaction is the tx containing the input or output. It would be good to investigate whether this bug is present somewhere else in bisq.

@chimp1984
Copy link
Contributor

@oscarguindzberg Thanks for the comments.
I checked the code base and did not find a wrong usage. In RawTransactionInput we use parentTransaction as field name but in fact its the from Tx of the spending tx. But the usage is correct, was just a unclear naming. I added a comment.
There was one txo with null as parent tx but that code was not used, I deleted it.

A search in our issues shows 3 other cases, once going back to 2016, so not related to 2 wallets as that was long before the DAO:
https://github.com/bisq-network/bisq/issues?q=UnreadableWalletException

@huey735
Copy link
Member

huey735 commented Feb 13, 2021

@oscarguindzberg @chimp1984

I've come across another instance of this error. I helped user to get back into Bisq and continue their pending trade. I recommended:

  1. Close Bisq
  2. Delete the data-directory/Bisq/btc_mainnet/wallet/ folder
  3. Restart Bisq
  4. Restore the wallet with the seedphrase and date

This seems to have worked however the Bisq client doesn't recognize that the Deposit transaction for the pending trade was successfully broadcast and confirmed.

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Jun 11, 2021
@stale
Copy link

stale bot commented Jun 22, 2021

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@stale stale bot closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants