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

Block stopped syncing-->Clear Cache-->Balance is 0 #2601

Closed
ishijan opened this issue Mar 6, 2023 · 33 comments
Closed

Block stopped syncing-->Clear Cache-->Balance is 0 #2601

ishijan opened this issue Mar 6, 2023 · 33 comments
Assignees
Labels
FAQ [Help documentation] Frequently Asked Questions replied stale Synchronization [FAQ] Synchronization related issues

Comments

@ishijan
Copy link

ishijan commented Mar 6, 2023

Detail of the issue

I'm using Neuron V0.106. Block stopped syncing. I clicked on Clear Cache from data setting menu. Now my balance is gone as well as history transactions. I have 2 wallets and both balances are now 0. Please help me out. Thank you

bundled-ckb.log

No response

main.log

No response

status.log

No response

@Keith-CY
Copy link
Collaborator

Keith-CY commented Mar 6, 2023

Hi @ishijan
Could you upload the log of Neuron, which can be exported by Menu => Help => Export Debug Information, then we can figure out what happened under the hood.

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

Here is debug information
neuron_debug_1678080701722.zip

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

@ishijan Hi, from your log, the ckb node is restarting always, this happened because the ckb node stop signal was captured by Neuron but the ckb node start signal was missing. So neuron stopped itself because it thought ckb node stopped. It's a recently found technical issue but not mentioned in document, so the solution was missing in Neuron. The exception will be fixed by #2574 and delivered in the next version.

Now you can resolve it by these steps currently:

  1. stop Neuron
  2. check if ckb program is running in the task manager, close it if yes; if ckb is closed, it may not cause by the above problem.
  3. start Neuron again.

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

Stop Neuron by closing the program? After I closed the program, ckb program is not running in the tast manager. I reopened the ckb program, neuron appears in the task manager. But still not syncing. What do I do next?

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

Stop Neuron by closing the program? After I closed the program, ckb program is not running in the tast manager. I reopened the ckb program, neuron appears in the task manager. But still not syncing. What do I do next?

Do you start the ckb program by yourself but not by Neuron? If you start ckb program by yourself, you may need to add --indexer parameter when starting the ckb.
If you only start Neuron and wait for a while, it also does not start syncing, you can upload logs again. Maybe there exist others problems.

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

Sorry I meant "Neuron program".
After I closed the neuron program, neuron program is not running in the task manager. I reopened the neuron program, neuron appears in the task manager. But still not syncing. Here is the debug information.
neuron_debug_1678085252634.zip

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

I'm sorry for my inaccurate description, Neuron includes neuron program, and it starts a ckb node to sync data, the program's name is ckb. After you close the neuron, you need to ensure the ckb program is closed.
This is the Neuron program:

image

And here is the ckb program:

image

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

When Neuron program is open, the ckb program kept appearing in the task manager for a few second and then disappeared. The ckb program will appear in the task manager and disappear again after a few second. It kept going on like this.
image
image

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

@ishijan Can you try to start ckb program alone? Here is the step:

First, find the mainnet data path, you can find the mainnet data path by clicking Preference->Data-> CKB Node Config & Storage, you can click and copy the path when you hover the path. Then close the Neuron program and follow these steps.

Run a mainnet node

  1. visit https://github.com/nervosnetwork/ckb/releases/tag/v0.106.0, download [ckb_v0.106.0_x86_64-pc-windows-msvc.zip](https://github.com/nervosnetwork/ckb/releases/download/v0.106.0/ckb_v0.106.0_x86_64-pc-windows-msvc.zip) and unzip it
  2. open a terminal and go to the unzipped ckb node directory
  3. execute ./ckb run -C 'your mainnet data path' --assume-valid-target 0x4e53fcf61c1250249bc201101bcc8c904b7fcd455f8db395bdb4bbe02502a499 --indexer to start synchronization, --assume-valid-target 0x4e53fcf61c1250249bc201101bcc8c904b7fcd455f8db395bdb4bbe02502a499 is used to boost
    Ref: Run a CKB Mainnet Node

After the mainnet node start success, you can try to start Neuron again.

If this works, you can close the ckb and neuron program and try to restart the Neuron again.

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

I downloaded ckb_v0.106.0_x86_64-pc-windows-msvc.zip and already unzipped it. I don't understand step 3. Please clarify.

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

I downloaded ckb_v0.106.0_x86_64-pc-windows-msvc.zip and already unzipped it. I don't understand step 3. Please clarify.

Step 3 is used to run a ckb local node. Here is my run success example.
./ckb means run ckb in the current direction. -C 'your mainnet data path' means the ckb data is in the path. --indexer means start ckb program with ckb indexer. --assume-valid-target 0x4e53fcf61c1250249bc201101bcc8c904b7fcd455f8db395bdb4bbe02502a499 is used to boost.
And I have updated something in the comment. #2601 (comment)

image

@ishijan
Copy link
Author

ishijan commented Mar 6, 2023

Step 2 - Here you want to open command prompt or open ckb-cli.exe from the unzipped folder?
Step 3- So I just opened open command prompt and type
./ckb run -C 'C:\Users\JJ\AppData\Roaming\Neuron\chains\mainnet' --indexer --assume-valid-target 0x4e53fcf61c1250249bc201101bcc8c904b7fcd455f8db395bdb4bbe02502a499
It didn't work. Which part I did wrong?

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 6, 2023

Step 2 - Here you want to open command prompt or open ckb-cli.exe from the unzipped folder? Step 3- So I just opened open command prompt and type ./ckb run -C 'C:\Users\JJ\AppData\Roaming\Neuron\chains\mainnet' --indexer --assume-valid-target 0x4e53fcf61c1250249bc201101bcc8c904b7fcd455f8db395bdb4bbe02502a499 It didn't work. Which part I did wrong?

Can you show me what happened?
Step 2 is two combinations by two operations.

  1. open a terminal
  2. go to the unzipped folder in the opened terminal
    So when typing ./ckb can find the ckb.exe binary file.

@Keith-CY Keith-CY assigned yanguoyu and unassigned Keith-CY Mar 7, 2023
@ishijan
Copy link
Author

ishijan commented Mar 9, 2023

87C6292B-0265-471F-A8E5-9B69938C2CD6

This is what happened after I followed your instruction. Did I get it right? However, the computer storage is running low. Is that also a problem? If that’s the case, I have a question regarding changing a computer and install neuron on a new computer.

  1. I haven’t finished syncing all the blocks to date on the current computer and then encountered the problem that neuron program stopped syncing and the balance went down to zero and all historical activities are gone after clearing cache. Is it possible to install neuron on the new computer and use the current wallet I have? Will it start syncing from where it left off? What do you suggest me do?
  2. Can neuron run on Drive D?

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 9, 2023

87C6292B-0265-471F-A8E5-9B69938C2CD6

This is what happened after I followed your instruction. Did I get it right? However, the computer storage is running low. Is that also a problem? If that’s the case, I have a question regarding changing a computer and install neuron on a new computer.

  1. I haven’t finished syncing all the blocks to date on the current computer and then encountered the problem that neuron program stopped syncing and the balance went down to zero and all historical activities are gone after clearing cache. Is it possible to install neuron on the new computer and use the current wallet I have? Will it start syncing from where it left off? What do you suggest me do?
  2. Can neuron run on Drive D?

You can try to move the ckb data to Drive D. Follow these steps:

  1. Open Neuron, clicking Preference->Data-> CKB Node Config & Storage, you can click and copy the path when you hover over the path.
  2. close Neuron and move the path's data to Drive D.
  3. Restart Neuron and set a new path for ckb data by clicking Preference->Data-> CKB Node Config & Storage-> Set.

@ishijan
Copy link
Author

ishijan commented Mar 9, 2023

What about changing to a new computer and install neuron? Will my unfinished sync wallet work on a new computer? What do I have to do?

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 9, 2023

What about changing to a new computer and install neuron? Will my unfinished sync wallet work on a new computer? What do I have to do?

If you use a hard wallet, you can easy to use a new computer by importing the hard wallet into the new computer.
Or else if you know your wallet's mnemonic, you can also import by mnemonic in the new computer.
Or else you should backup your wallet, and import by keystore in the new computer.

@ishijan
Copy link
Author

ishijan commented Mar 9, 2023

Can I import by wallet seed?

@yanguoyu
Copy link
Collaborator

yanguoyu commented Mar 9, 2023

Wallet seed is a group of 12 or 24 words? If so, wallet's mnemonic means wallet seed.

@ishijan
Copy link
Author

ishijan commented Mar 13, 2023

Hi there,

After I run ckb by following your instructions, this is what happened. Does this mean it is completed?
image

I opened Neuron program without closing ckb. What to do next?
image

@yanguoyu
Copy link
Collaborator

Hi there,

After I run ckb by following your instructions, this is what happened. Does this mean it is completed? image

I opened Neuron program without closing ckb. What to do next? image

It's strange why the ckb process has stopped. The ckb process should keep running then Neuron can keep in sync.

@ishijan
Copy link
Author

ishijan commented Mar 13, 2023

So, are you saying the ckb process is not finished? What does it suppose to look like when the ckb process is finished?
Please suggest the next step. Can I close ckb program and re-open the neuron program? Or do I keep both programs open?

How come block hasn't started syncing and what does "Syncing, ~- left" mean?
image

@yanguoyu
Copy link
Collaborator

So, are you saying the ckb process is not finished? What does it suppose to look like when the ckb process is finished? Please suggest the next step. Can I close ckb program and re-open the neuron program? Or do I keep both programs open?

How come block hasn't started syncing and what does "Syncing, ~- left" mean? image

You can close Neuron and ckb, and check all the ckb has closed. Then try to only open Neuron.

@ishijan
Copy link
Author

ishijan commented Mar 13, 2023

So, I closed ckb and neuron, checked that all ckb has closed. Then, open only Neuron, the ckb is shown in task manager. Is this normal?
image
image

@yanguoyu
Copy link
Collaborator

So, I closed ckb and neuron, checked that all ckb has closed. Then, open only Neuron, the ckb is shown in task manager. Is this normal? image image

Of cause, Neuron will start a ckb process for it to sync. And as your see, it keeps syncing.

@ishijan
Copy link
Author

ishijan commented Mar 14, 2023

I was wondering does the block start from 0 every time I re-open Neuron program? If yes, it will take forever to finish syncing.

The first picture was before I closed the ckb and neuron. It shows the block was uploaded to 9,272,023 blocks
image

The second picture is after I closed ckb and neuron program. However, when I re-open the neuron program, block starts to upload from 0/0 again. As you can see, I took this screenshot after I re-open Neuron for a while. The block which was previously uploaded to 9,272,023 blocks, didn't start upload from where it finished.
image

Please help me understand the usual process. Thank you

@yanguoyu
Copy link
Collaborator

I was wondering does the block start from 0 every time I re-open Neuron program? If yes, it will take forever to finish syncing.

The first picture was before I closed the ckb and neuron. It shows the block was uploaded to 9,272,023 blocks image

The second picture is after I closed ckb and neuron program. However, when I re-open the neuron program, block starts to upload from 0/0 again. As you can see, I took this screenshot after I re-open Neuron for a while. The block which was previously uploaded to 9,272,023 blocks, didn't start upload from where it finished. image

Please help me understand the usual process. Thank you

The first number is that the block number has synced. And the second number is the best-known block number. The second number gets by https://github.com/nervosnetwork/ckb/blob/master/rpc/README.md#method-sync_state, and the code is here
And Neuron will start syncing from the last synced block number after restarting.

@ishijan
Copy link
Author

ishijan commented Mar 14, 2023

10,794 blocks synced and won't continue for two full days already. Here is the debug information. Please help me resolve the issue.
neuron_debug_1678809376898.zip

@Keith-CY
Copy link
Collaborator

Keith-CY commented Mar 14, 2023

10,794 blocks synced and won't continue for two full days already. Here is the debug information. Please help me resolve the issue. neuron_debug_1678809376898.zip

Hi @ishijan

From the log(bundled-ckb.log) we can see

2023-03-14 15:50:42.425 +00:00 BlockDownload INFO ckb_sync::synchronizer  best known header number: 8700794, hash: Byte32(0xaa500badb3dc8a8af9caa73c450843fe1d8b61b513b2a9012d3798f941f73406), can't find assume valid target temporarily, hash: Byte32(0x076ffa81f8c6f2e1f22a778a1aa5d48531cc33bfd9b302e0d73fb2ce6fa4de3b) please wait

It means the built-in ckb node is still at the early stage to find a specific block from network, the target block number is 8826940(https://github.com/nervosnetwork/neuron/blob/develop/packages/neuron-wallet/.env#L120), yours reached 8700794. So the synchronization doesn't start yet. This stage is called looking for assumed valid target, which should be prompted at the left bottom corner.

Detailed explanation could be found at #2570 (comment)


It takes about 6mins to scan 10,000 blocks(based on logs) and the remaining block count is 126146, so the synchronization is expected to start after 126146 blocks / 10000 blocks * 6 mins / 60 mins = 1.26 hours.

@ishijan
Copy link
Author

ishijan commented Mar 14, 2023

Thank you @Keith-CY
Block continue to sync but slowly. At this rate, I assume it would take about 90 hours to finish syncing, correct?

And one more question. If I close the Neuron program before it finishes syncing, close the computer, restart Neuron, will block start from 0 again? I've encountered this problem earlier before, so I'm a bit scared to turn off my computer. You see my computer has been on for 5 days now. What would you suggest me to do?

@yanguoyu
Copy link
Collaborator

Thank you @Keith-CY Block continue to sync but slowly. At this rate, I assume it would take about 90 hours to finish syncing, correct?

And one more question. If I close the Neuron program before it finishes syncing, close the computer, restart Neuron, will block start from 0 again? I've encountered this problem earlier before, so I'm a bit scared to turn off my computer. You see my computer has been on for 5 days now. What would you suggest me to do?

No problem with turning off your computer, it will continue to sync from the last block number when you start it again.

@Danie0918 Danie0918 added FAQ [Help documentation] Frequently Asked Questions Synchronization [FAQ] Synchronization related issues labels Jun 15, 2023
@github-actions
Copy link
Contributor

Mark this issue stale because no activity for 60 days

@github-actions github-actions bot added the stale label Aug 15, 2023
@github-actions
Copy link
Contributor

Close this issue because it's inactive since marked stale

@Danie0918 Danie0918 removed Synchronization [FAQ] Synchronization related issues FAQ [Help documentation] Frequently Asked Questions labels Oct 31, 2023
@Danie0918 Danie0918 added FAQ [Help documentation] Frequently Asked Questions Synchronization [FAQ] Synchronization related issues labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FAQ [Help documentation] Frequently Asked Questions replied stale Synchronization [FAQ] Synchronization related issues
Projects
None yet
Development

No branches or pull requests

4 participants