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

panic: Unable to synchronize wallet to chain: unable to perform wallet recovery: json: cannot unmarshal object into Go value of type string #729

Closed
tivizi opened this issue Jan 15, 2021 · 8 comments

Comments

@tivizi
Copy link

tivizi commented Jan 15, 2021

Command

btcwallet --testnet

Error Logs

2021-01-15 15:37:02.676 [INF] BTCW: Version 0.11.0-alpha
2021-01-15 15:37:02.687 [INF] BTCW: Attempting RPC client connection to localhost:18334
2021-01-15 15:37:02.687 [INF] RPCS: Listening on 127.0.0.1:18332
2021-01-15 15:37:02.687 [INF] RPCS: Listening on [::1]:18332
2021-01-15 15:37:02.733 [INF] CHNS: Established connection to RPC server localhost:18334
2021-01-15 15:37:03.791 [INF] WLLT: Opened wallet
2021-01-15 15:37:03.791 [DBG] WLLT: Birthday block has already been verified: height=1903768, hash=0000000037e0ccc0a8863ef979ac45971e0d2ba766d5c44bc4d8731e77989928
2021-01-15 15:37:03.792 [DBG] WLLT: Waiting for chain backend to sync to tip
2021-01-15 15:37:04.793 [DBG] WLLT: Chain backend synced to tip!
2021-01-15 15:37:04.793 [INF] WLLT: RECOVERY MODE ENABLED -- rescanning for used addresses with recovery_window=250
2021-01-15 15:37:04.801 [INF] WLLT: Seed birthday surpassed, starting recovery of wallet from height=1903769 hash=0000000000000016289a6a941be1f4211973bb37a4322b31713ef317c464ab7b with recovery-window=250
2021-01-15 15:37:04.907 [INF] WLLT: Scanning 354 blocks for recoverable addresses
2021-01-15 15:37:05.302 [INF] CHNS: Fetching block height=1903895 hash=00000000000000015e3341518dc9a2e5436bc144553022a1ef0227f16f75dd2e
panic: Unable to synchronize wallet to chain: unable to perform wallet recovery: json: cannot unmarshal object into Go value of type string

goroutine 59 [running]:
github.com/btcsuite/btcwallet/wallet.(*Wallet).handleChainNotifications(0xc0000dc000)
	/home/ujued/Documents/opensource/btcwallet/wallet/chainntfns.go:117 +0x1253
created by github.com/btcsuite/btcwallet/wallet.(*Wallet).SynchronizeRPC
	/home/ujued/Documents/opensource/btcwallet/wallet/wallet.go:201 +0x1f4

BTCD Version

btcd version 0.21.0-beta
@tivizi
Copy link
Author

tivizi commented Jan 15, 2021

With debug, I found that the error occurred here:

https://github.com/btcsuite/btcd/blob/6bd4c64a54faeb343d5e3c1ee5802450a291787f/rpcclient/chain.go#L116

this func context variable res is :

{
	"hash": "00000000000000015e3341518dc9a2e5436bc144553022a1ef0227f16f75dd2e",
	"confirmations": 253,
	"strippedsize": 20932,
	"size": 33242,
	"weight": 96038,
	"height": 1903895,
	"version": 1073676288,
	"versionHex": "3fff0000",
	"merkleroot": "d55d3b0760c47d1fa8c19109a68550fdbf936764b4d50b0890c30493102e36d6",
	"tx": ["c67f291fd014ad8683989ee1776a7f3616cbbdffd27e958c312f92319250d688", "7c4c8649fc7920de049ad21cc2966fa9d9cda4a173f74317d2cc22d9fda23311", "aa83371099232a6c74da7d7ae6fbd770e7e9f0fb2ca4b72a9105c738078aff12", "1a5d54224e3b6399fd3e274520db9819beabaf6fd56f93f544df2415b4ffc314", "f2adead0c531b4699695cf114f9d78bf245ab1487dc79c2f98ca36698d21a886", "b3ea2336b9df0d697f7cbcda19fbee8e06a538499096dcdbf6145d163e2d9b43", "00824143872203f56c671a145838f3ee0c8812124f8dd7bcb5b36e41164b9a08", "cab2047afa2c71e1ba50695c07442e9d97c39b7e4c56299b4e1d2d5e404eacba", "91533235e4022645d646115445e63bbd66d14ca3464868ef6b1731d10915f7e8", "0961dd8f3acfe18c40dbf4c00e6cb1e22a1c8283884245e4db141b219db2622d", "5cd5ad4defb75ceedda99dc0b7ed66e67191f26125482b5ae0e012e94d398faa", "f013d16ae86ba10a3a59f3c6686c7d6802292bd40ffaf673306c8e18dcddeaf5", "e0da3a14ef99fb4d49a1158d1cb28f296d5752a067ef8b60a7e1fab21492e927", "62a60f3510b1ea91615678667990b9d4634952d718af9a38a5baaa3171bd3597", "ea7d645652ac4d78733a5cfe6adea5adc188974b13a1c99977f6e4322b9b33d5", "67033e55f0f53851564c9f56ebf198028ff1b2e94e694a545a7c12aa58ce44a6", "83e1a9a4db4e7ff75a1111d43df51037d06f8f3335d8ff0f2bd028b34124bd40", "b09e3e57babab08dea49139a16b733b58d05b538d1b9b053463a7c14f7eee060", "6f9bdfe0a963dfbb6563e9136bfa3cf2d88d6201380abe125802a040f919cc6e", "6d3dbaec7f21caedd2bb4e273bab8076bd5693b895776b5b48a1236d07aa3156", "9026c148432f8902b82a05e99cf8b0b9cb4a3833726f9a59a568456a59ba43a8", "9912771741276471565cbd9bdcd082ab358bf2821fd82b631f2d4bebdf277f59", "96cfaae307cf8b21ec69a6ecde55aec044130752687e5e4a64a55ae16797cb6e", "313aa757c3552a42e4b71220d13e2ba8ce348c394336a45dc336bd9c5041919d", "fcf93506ae76f6b3aa3b287872f2dc08f98edd62fb1a9de2b36f63ebc6d86ed2", "ade882657e976b1268317b7f116aab96af7c782605660a58674770e3d61640e6", "db650e12ac0bf1bfd9961627f7d3af60096a093488383a335cc84df35136af1e", "59388635d00a022118d4919ab507895b8992cf925dc5f0003c275ab3ca71e53b", "ab28ac74240507047b22c019a6cfd9cf71ae96df4f8cda89ac8bd6774839168d", "64c60d3fbe686bd00919f000fef61221e0ad94bbd02aa9378fd5bcf59d624cf9", "2d2508e956af8de9d1b87ce7eee91f659a546bdda8bb531accfd71483637467f", "196fc298901e540ca7c3abbc7d360677038f86d3a8cf94834755047fb6f473ce", "c6aaa16fec2329b3924bf61a1a4b0fbfc528271c3418d4a2085640a8fa54c464", "b338bb6e01e43a9d608c8180e4b10ffa023547a19427c1b192f28429965c436a", "d6f34764e5c2f933ac68f16cf5df62cfe716bce78df9c3a9d4c089915ea5279f", "75b0474cef1cc11f183be2ef647c62cd42b86e3530eb408ccb207cf63e2491b7", "098321a13408f44517245a95a6c26002793df6f4fb2b926939b90751178fffba", "ae1b45c5729457198c04a45020cd0b186746ad6cd41544a147970bde8ffbf0dc", "7a628157c814aa35385694be82f1570df2d106e9e132137b1065a8e1c845f3e6", "a2b3083c4deab94df1306e8822cb8d1e61b4f0d40bbc666268a6b1e4d4a212ed", "4ae3cf987693572f71489bb801f9ea6adfd109f4df5f99a191e6aabe3dd1ddf7", "96f979314a5df8246c7b74869bfae3f16e5b0d5ba72257e10aa6c0570f6b41f8", "87cb7762ddea86b406d90d41daded40eb62cd29a170b73d47b88e626b548103d", "531ebbf623b360c72718729103a25c8292dc304f7d68177e23d39cdb7cbf8c78", "245732fe2c4fd7cafd5552bf5440a2c2f2a2b11b04308cf4a990241e9c209a7b", "d74227875d2c75015cd46e1e53738758596d93a19e8d5278b4f46e44292b1590", "a01d1e4206b11f2135b568538d068cab3f78f11ef4ce903163f80dbe3b0768b7", "ab4e99bfa104b85916853e0dbb8115eaed99135ec713a5a9628f9d8d5f7273cc", "8a651f9c10d9e770753dc2dbb2f4012fc11ca61c139c09d8b4123ccea73143d0", "53a9817a6ba793861a4d40ee7126e72cd64619721308fba47e8ccca079318ad5", "6bc7f4ec727df7c5cecebb340ee5841f8b28a175ce8618edb9e53a0ed7e5c5f1", "94740898c8029cf9a4c2b784569681c7c169fbeb990b214dcce994b8b2fc0e66", "dc7f0ca88753f88a409634bea0e3d09a04ef3ee30d3953f87ed80432de9eb8b6", "023dbe37d8fe0c4537b53d17b86031bb677e31d89a9fda0203cdffef84276347", "4a56527ecaa0245e8906b027f4d97e0c6c5c5cb8f8b382493519d268c7397699", "8f20d8ad882c02c54e583387b725f690aa93cd08d71d77b27c4ad34bc816e1b7", "682cebf030aa3467e0c70e2b4d40f624d339e3445a07bee5303bad96b07a16bd", "6a8f30ee8cdf8786f73c38984f871a5d72029f379fcf6cb216b3534bb757e08c", "f695a94efad0917df328e109b913432a68f5ce5f150c92c75ff5c9fa5eec012d", "1f0c14482c69dc4808aab59773f125ed8d981f9238f7a9ad1c676554eaf3a5d3", "7104c501487565babff5e1fd1e874179b7f5779da647f04df19634f5ef1c07aa", "90b66b72c3a7fbc0158e340f6a9013b2d0add7360f55c0911c11e1cb8ec5e35f", "490979a73ba414f7a28402252e910f7105308181d473d011e8606e901281ad05", "2d89a1f7a0cf7b2afcdd21005b5257f0f4895d534649105ce698b6c21cb0e97a", "03522b51ee7ecb9bd6c4254fb1cb01bfff19161307e7bc64c3f8da6dff7a2688", "d275611fdc0bb292cef5ff028483b4f60f8362e60a69bb001d7c768080f41f64", "eb0bbcb3d0aa05b67d2fbd10638e4aac9e37465d84f13370fe4f01297bd0d2dc", "502507cd82f024c3b2b0f3f2b5d9ce550ad295b7126224f2a6772ab99efb3093", "71127c87a3101c73ea6032c532c9c6c56a99a4029669f8fb81026c6e467909f2", "0c15a462b1a872d1f8fc1468b30c49a55d3afdd88a0fc48da7ed15047e2aa6c2", "77437a0bca6876de9753eed4f06cf01f26a873cef8a305e71237ff70cc0cf973", "f99c364e8dad1fe89c4f0143975819c21c902e420a971b155581329c5fb7a0bb", "9e5c57fa8b56cb0f8abb87bfe832c232ab6f4217810514a6d834f5638a61c3af", "0b1c82f7f9dd2f538a21951219c33a82c8f328890a09d9790b752aae74a1f9f8", "603cdb72c2c98e4a22b135d4bba1e61c7f63ec784a5dddecbfa0799a8ea8d0db", "52fda2792dd32bd635084482c4371e02ffa8353398ccaf203aae9fbfa34e71f6", "54d204bb4e6820cf544da8acbdf610e6a92b2706324bc32b7837cc5d35f5b116", "f50499852761ad75baa720fa0b8d77d09d89a6d9a40f2fcbec54c808f7c9207e", "4d7ff418350a9d69d5327a8d23fd7d58b6706d6161cb1dc129e7607bc94e3c13", "ef718ae1eab08a95c0d9630a14ecb9d34b801f51163dc8b1d9e84ee70c2c542e", "7b89fb31d1dbcdd86f2a0cbb3169349160f38a2094c918feb9088495fd18f28d", "ee282372ad9c9ed50edd83d9271bf3ce361af8d99ff581a0416cd8088b2aa9c5", "cbaefde54db6f1377df343fdadbc216159318fb9f862dfa3737de4929dff9e00", "4a4a63dea958bbb8cd2b573b4e27659ffeb7d3d6d13faf3c81c1b0256a38da12", "f046d1f202afdfb96fafad022404820ff8d1d4a0e2a063d1dd8f668ab14deb1c", "62ddb364125c3887d7c49260510dc1f313494d031785aba92c7319d8e2527b20", "7de9e1b2df42b0e4379600eb998505a7409701ba98c484b81cf811e5e852f122", "c55210a7bd69a8af6c887c2056be15168943fd5864340fbe4dea24d9948c9331", "4c83076909eb0fced989bdd9526c2b07d8f0e010bdfafcb157fb49f96997783c", "01c57e7050762265f26a31ab6b815948d17073fc7ce5b856f86ad628c4d65142", "642fe575ec564ec2dc17db8db414ac0a1b2feeee44f1b668b6b6d668a641deb8", "2631011bc10c5bc67ad32a22a0b71a3908b95f88f65eac745b0abfa6e321fed4", "d56247945b0a881c2f517f39a44b563ff385770d879c4d04fbfd1563b7b88646", "002d7c3e17258b28048049da7056bfc6d259ba295a6cdf7a25a8f5d7d0debf87", "f6c34957a5d3e07abc08674712ee1b677d94a54607c3f65236c59dc3ad8514f8", "8dcca9f954ee813c82374a086565ef361e7b83e3761db14fcf24993944904f47", "d28e2bcf1c86e480d3adf4f20ef1d82cb828483eb5181c19fceb6547937df547", "4fec968306ee5cbf1e41e239b76676b4c30bcc430bf783468922c1938ae91560", "6ff6f95d6e515c5501a8d63827e4351ea7762c5151b49acaf7264222c3906a87", "71a0fd399663105e1ee54ea3f9408367bf369244f241e975d586cb2e83cf7360", "7cf1fd61b19b5aef8e428db3dd03bc7273e91dbaea696c85ca5b141b2b1f6c72", "be716268265da19b2d4d6ac50c00fc26dbc12bf48df32b9222de82ca89b43da4", "d22d80ec8b49814aa1165291f28fd436c138db36f8ee8c25b7f73f125c624aa7", "847ba589c0618724322809c116ddfeebb1f80806863364e39d12f07f8de924af", "a9e63824b7bc95b906873cc3fb7ea884abc6d1d2eff0fa326b7ec56dc2b6ddb2", "fdafd85b2265dd6a1a7422e93dfdf6954df25f516ac81cc5c71a060a1a2819b3", "05dc24f9380d75a359e19350780a6614a155c7a3a54a58c721abb8419cbba7d2", "0c64656076c8ea5172fdcea3b20504153fab766c97fbdc32ea761b9d32b9f5e8", "d6d73c6d0518c33f85a6b115ce6361d9bb77d7222f20b72808113a941b6471ed", "25cfa7dcdf5058d7abf0d28ef63ba63692dfb3319a40b79a53e7333b3df1a2f2"],
	"time": 1610577498,
	"nonce": 1249438822,
	"bits": "1916755c",
	"difficulty": 191237802.13512918,
	"previousblockhash": "00000000000000101bd4ec5781e6dfa856234bdd79ec60eb1b5bede82d851c0d",
	"nextblockhash": "000000000000000872b5d986942273342f5797ec6823dc1165b24afa0e41f357"
}

@jacohend
Copy link

jacohend commented May 17, 2021

I'm having the same issue on mainnet:

goroutine 259 [running]:
github.com/btcsuite/btcwallet/wallet.(*Wallet).handleChainNotifications(0xc00003e140)
/go/pkg/mod/github.com/btcsuite/[email protected]/wallet/chainntfns.go:117 +0x13fb
created by github.com/btcsuite/btcwallet/wallet.(*Wallet).SynchronizeRPC
/go/pkg/mod/github.com/btcsuite/[email protected]/wallet/wallet.go:201 +0x1cb

Edit:

Using LND 12.1 beta, backend is latest neutrino master on bitcoin mainnet

@wpaulino
Copy link
Contributor

@jacohend can you confirm whether it panicked with the same error message json: cannot unmarshal object into Go value of type string? This error message should not be possible with the neutrino backend as there's no JSON RPC server.

@wpaulino
Copy link
Contributor

@tivizi do you still see this issue with the latest version? This should've been fixed as of btcsuite/btcd#1577, but the dependency wasn't updated until recently.

@jacohend
Copy link

@wpaulino different error string, but same trace. The log view was purged before I copied the specific error string, but it was some issue with timing out during block retrieval. Around the same time the number of good cf-serving peers went to 0.

@tivizi
Copy link
Author

tivizi commented May 22, 2021

@wpaulino ok, i'll try again later. ^0^

@tivizi tivizi closed this as completed May 22, 2021
@wpaulino
Copy link
Contributor

@jacohend if you're able to reproduce this again, please open a new issue with as much detail as possible (logs, panic stacktrace, etc.).

@Bitcoinnoobie
Copy link

I M getting the same error when i unlock wallet
"Panic : unable to synchronise wallet to chain : -1 block number out of range"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants