Update stuck on script launched
I run update and it gets stuck 100% the time on script launched with pid: 32668
Only way to sync is once with reindex and after that no way to ever update.
we need more info i'm afraid - more logs, versoin/branch used etc
i had a similar issue, after initial update, thereafter hangs with zero output on
# node scripts/sync.js index update
script launched with pid: 32668
it worked for a fresh reindex, but then went back to hanging.
i deleted the explorerdb from mongo, and it seems to be working now.
Thank you @bumbacoin, but unfortunately we'd still need more information to even begin to try to track down an issue like this.
Any info about this? it is happening to me. Installed iquidus and working well. Rebooted for some update and now explorer works good but script (nodejs scripts/sync.js index update) get stuck at:
script launched with pid: 2244
No new information about this yet, we need quite a bit more information. The following is for everyone in here...its not directed at any one person, but fortunately...everyone.
What you guys are describing is that the script is launching and you're not getting any feedback. However, noones saying its crashing, so I can only imagine that it's actually running, just without output.
To show this, you guys could go into your sync.js file and see how far it goes.
For example: https://github.com/iquidus/explorer/blob/c6813065cb1fed9d7d55fbc572fef684d516803e/scripts/sync.js#L188-L189 if you were to change:
} else if (mode == 'update') {
db.update_tx_db(settings.coin, stats.last, stats.count, settings.update_timeout, function(){
to
} else if (mode == 'update') {
console.log("Coin: %s. Last stats: %s. Current BlockCount: %s",settings.coin, stats.last, stats.count);
db.update_tx_db(settings.coin, stats.last, stats.count, settings.update_timeout, function(){
This will print "Coin: Bitcoin. Last stats: 123456. Current BlockCount: 78901234" right before going directly into "db.update_tx_db" (obviously you could put any thing to console.log but hey, whatever)
If its getting to update_tx_db then you know its working pretty so far.
https://github.com/iquidus/explorer/blob/c6813065cb1fed9d7d55fbc572fef684d516803e/lib/database.js#L716-L799 In here, since noones complained about seeing "db_index lock file exists..." we know that we're making it to line 721,
https://github.com/iquidus/explorer/blob/c6813065cb1fed9d7d55fbc572fef684d516803e/lib/database.js#L729-L731 these lines are actually pretty taxing if there's a boatload of blocks to calculate through. This is where I suspect you guys are running into issues.
If you put in that console.log of (Coin: Last: BlockCount:) then you'll know that you have "BlockCount - Last" # of blocks to add to the array before we start processing. So if there's 1000 blocks in the chain, and you have only 5 done in stats.last, then this script is going to add 995 block heights to an array without outputting anything.
so if you want some more console.log'ing to see what's going on, then change https://github.com/iquidus/explorer/blob/c6813065cb1fed9d7d55fbc572fef684d516803e/lib/database.js#L728-L732 from this:
var task_limit_txs = 1;
for (i=start; i<(end+1); i++) {
blocks_to_scan.push(i);
}
async.eachLimit(blocks_to_scan, task_limit_blocks, function(block_height, next_block) {
to this:
var task_limit_txs = 1;
console.log("Start adding blocks to array. Need to sync %s blocks. This can take some time.", (end - start));
for (i=start; i<(end+1); i++) {
blocks_to_scan.push(i);
}
console.log("Finished adding blocks to array, start Syncing...");
async.eachLimit(blocks_to_scan, task_limit_blocks, function(block_height, next_block) {
And just keep going down figuring things like that out until we get enough information to be able to even begin to help. Obviously, none of this matters if the issue is occurring on a different iquidus version/fork. No one has provided us with what version of iquidus is being ran, which fork, nodejs version, etc. So here's guessing, but this is why we won't be "fixing" anything or providing any updates...we have none. So far, nothing has been shown to be broken or buggy.
thank you uaktags for description of process. Probably you are right when you say that things are working in the background. Sorry for not providing any info about our system :)
Just let me know what you find if you take any of the above steps. I really do want to make sure there isn't an issue to be fixed, but I just don't know off of whats here.
Thanks for understanding!
looks like i have another one, added log code as above
Last stats: 594999. Current BlockCount: 752764
Start adding blocks to array. Need to sync 157765 blocks. This can take some time.
Finished adding blocks to array, start Syncing...
the explorer gui is stuck at block 750954 the above output is consistent with itself, but does not match this height
- last stat (from above) is 594999, this number matches with 'Current BlockCount: 752764' and 'Need to sync 157765 blocks'
using. Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0 x86_64) node v10.19.0
i've added output for blockhash and txid here with output showing it's reaching this stage, https://github.com/bumbacoin/explorer/comit/535097260e332fdf28afa3a0935feee53739f0bd eg
is block 09850de1a12ed1393fddde9f2b9d424bbd81e81119d9f53761d41b950753bc7b
is tx a0900997a41647b001856956dbafaafa53392a0d1c2dfbd6ac61fd991bf8cca4
is tx af0fbbe4f2cdd8e91f09db1bd1d8ee5cb914d2a9831ebbd93f2ac0baf1f07844
when running the sync script it begins by using the initial starting point of getblockhash 604999 (10k above the last stat) then continues to iterate , the output from this seems to continue as expected, with consecutive blocks (i've only analysed small sections of 3 or 4 blocks so am unsure whether it's skipping anything).
when interrupting it and restarting it seems to repeat the same behaviour starting from the same height
i am currently leaving it to see what happens when it gets to the end.
hmmz false alarm? this one actually finished ok and is now fully synced. issue is resolved :P
previous examples, when left alone did not ever finish syncing.