Closed raedah closed 5 years ago
anything update?
I just ran into a similar (the same?) issue after updating my testnet installation from GIT version Sep 24 to Nov 17. I have a voting only wallet (which seems work fine) and a staking wallet (buying the tickets) which fails during startup & sync with:
2018-11-17 21:32:32.216 [INF] DCRW: Attempting RPC client connection to localhost:19109
2018-11-17 21:32:32.311 [INF] SYNC: Established connection to RPC server localhost:19109
2018-11-17 21:32:32.314 [INF] TKBY: Starting ticket buyer
2018-11-17 21:32:32.314 [INF] SYNC: Headers synced through block 0000000007956f746403a5dfa159b501c598f70243f5d9c3ab4ad4ebe265969d height 59998
2018-11-17 21:32:32.314 [INF] SYNC: Transactions synced through block 0000000007956f746403a5dfa159b501c598f70243f5d9c3ab4ad4ebe265969d height 59998
2018-11-17 21:32:32.319 [INF] SYNC: Wallet voting enabled: vote bits = 0x0001, extended vote bits = 06000000
2018-11-17 21:32:32.319 [INF] SYNC: Please ensure your wallet remains unlocked so it may vote
2018-11-17 21:32:32.895 [INF] SYNC: Fetched 2000 new header(s) ending at height 61997 from wss://localhost:19109/ws
2018-11-17 21:32:33.247 [ERR] SYNC: Wallet synchronization stopped: rpcsyncer.Run: I/O error:: wallet.ChainSwitch: missing credit value
2018-11-17 21:32:33.247 [INF] TKBY: Stopping ticket buyer
2018-11-17 21:32:33.247 [INF] DCRW: Attempting RPC client connection to localhost:19109
2018-11-17 21:32:33.346 [INF] SYNC: Established connection to RPC server localhost:19109
2018-11-17 21:32:33.346 [ERR] SYNC: Websocket receive error from localhost:19109: websocket: close 1006 (abnormal closure): unexpected EOF
2018-11-17 21:32:33.347 [ERR] DCRW: Error connecting to RPC server: rpcclient.Start:: dcrd.jsonrpc.getcurrentnet: the client has been disconnected
2018-11-17 21:32:57.975 [INF] RPCS: RPC method walletinfo invoked by 127.0.0.1:36116
2018-11-17 21:34:51.516 [INF] RPCS: RPC method walletinfo invoked by 127.0.0.1:36126
In my case (see above), rebuilding teh wallet from seed did seem clear the issue I observed.
It's still not clear what is the cause of these issues. I will add additional context to the error to describe which outpoint could not be found, and that may aid in debugging if this is still an issue for new (not updated) wallets on the latest code.
This error was hit by @dajohi and I can see the problem now:
2018-12-07 12:55:21.368 [ERR] SYNC: Wallet synchronization stopped: rpcsyncer.Run: I/O error:: wallet.ChainSwitch: missing credit e57370dfea69d06ce094a7543e39331c1694e3b113cdcc22b951211378169083:6, key 83901678132151b922cccd13b1e394161c33393e54a794e06cd069eadf7073e500014b51a6e9dcc9f42449cd4eecfd6aa8a2b23c7ae7f57c5e851fc40f170ef20000000000000006, spent by 9cdbe8d0c38140fb483ecda548d44b035ea840a869ad29ff1799fe6ba2283b58
https://testnet.dcrdata.org/tx/e57370dfea69d06ce094a7543e39331c1694e3b113cdcc22b951211378169083
https://testnet.dcrdata.org/tx/9cdbe8d0c38140fb483ecda548d44b035ea840a869ad29ff1799fe6ba2283b58/in/1
The credit key contains the block hash 00000000f20e170fc41f855e7cf5e77a3cb2a2a86afdec4ecd4924f4c9dce9a6 (in unreversed form), but this is not a main chain block anymore. It seems that the key is not being correctly updated during a reorganize.
This is also happening on simnet Steps to replicate:
@equalgeek this doesn't sound like the same issue. open a new issue if you saw that behavior running master (not the 1.3.0 release). I believe it is fixed on master and 1.4.0-rc1.
I've diagnosed this problem and will be committing a fix soon. It's not db corruption or inconsistent values in the database, but a bug in the block rollback function.