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

Indexing Problem - Problem with block? #56

Open
Stone-Hedge opened this issue Sep 1, 2016 · 24 comments
Open

Indexing Problem - Problem with block? #56

Stone-Hedge opened this issue Sep 1, 2016 · 24 comments
Assignees
Milestone

Comments

@Stone-Hedge
Copy link

Hi,

I am attempting to set up Iquidus for Crowncoin. Indexing always fails at block #600805. #600804 is the last successfully indexed block. The dev team are not aware of anything unusual about this block. There are no hard forks associated with it, it looks pretty normal.

The error message is as follows:

/home/ubuntu/explorer/lib/explorer.js:285
        module.exports.is_unique(arr_vout, vout[i].scriptPubKey.addresses[0], function(unique, index) {
                                                                         ^

TypeError: Cannot read property '0' of undefined
    at module.exports.syncLoop.arr_vout.(anonymous function).amount (/home/ubuntu/explorer/lib/explorer.js:285:74)
    at Object.loop.next (/home/ubuntu/explorer/lib/explorer.js:189:18)
    at Object.module.exports.syncLoop (/home/ubuntu/explorer/lib/explorer.js:205:10)
    at Object.module.exports.prepare_vout (/home/ubuntu/explorer/lib/explorer.js:279:20)
    at /home/ubuntu/explorer/lib/database.js:141:17
    at /home/ubuntu/explorer/lib/explorer.js:387:14
    at Object.loop.next (/home/ubuntu/explorer/lib/explorer.js:194:24)
    at /home/ubuntu/explorer/lib/explorer.js:373:22
    at Object.module.exports.convert_to_satoshi (/home/ubuntu/explorer/lib/explorer.js:25:12)
    at /home/ubuntu/explorer/lib/explorer.js:371:30
    at /home/ubuntu/explorer/lib/explorer.js:258:14
    at Object.loop.next (/home/ubuntu/explorer/lib/explorer.js:194:24)
    at Object.module.exports.syncLoop (/home/ubuntu/explorer/lib/explorer.js:205:10)
    at Object.module.exports.is_unique (/home/ubuntu/explorer/lib/explorer.js:247:20)
    at /home/ubuntu/explorer/lib/explorer.js:369:26
    at /home/ubuntu/explorer/lib/explorer.js:353:20

This is an explorer link to the block that is causing a problem https://www.blockexperts.com/crw/height/600805

Coin daemon is latest version and I have tried re-indexing. Daemon is running with appropriate flags.

Can anybody advise?

Many thanks,

Dan

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

very strange, looking at the raw block and tx data, everything looks normal. Nothing comes to mind right now, i will need to investigate further.

@Stone-Hedge
Copy link
Author

Thanks, I'd really appreciate any pointers you can give me. Everybody is fresh out of ideas!

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

just to confirm, you have txindex enabled? (although if you didnt, it would error out much sooner than that block)

@Stone-Hedge
Copy link
Author

Hi. Yes, I have txindex=1 in crowncoin.conf.

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

looking at the last blocks reward tx, they are identical (ignoring hashes of course). it should process it fine. Doesnt look like a code issue (either in explorer or daemon), potentially an environmental issue, what is the load on the server like?

Are you launching explorer with forever or something similar (using bin/instance) or npm start?

Also maybe try adding or increasing rpctimeout in crowncoin.conf.

tbh, this has be fairly stumped also.

random question. you're not running out of hdd space?

@Stone-Hedge
Copy link
Author

Hi. Glad its not just us!

Load is low on the server. Plenty of disk space. I have tried with forever and npm start. Will try rpctimeout change now.

You'd be very welcome to log on and take a look if you are interested! I could always change the credentials afterwards.

@Stone-Hedge
Copy link
Author

Increasing RPC timeout didn't work. I'll keep on thinking and trying things, will post here if I crack it.

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

It's always the exact same block?

@Stone-Hedge
Copy link
Author

Yes, the the last indexed block is 600804 every single time I try a reindex or update.

I even rebuilt the server today and reinstalled from scratch to try to eliminate some environmental factors with no luck.

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

https://github.com/iquidus/explorer/blob/master/routes/index.js#L52

try changing rtx.vout in that line, to JSON.parse(rtx.vout)
doesnt make a heap of sense, but wondering if vout is being read as json, or a string.

will most likely not fix it, but just in case, give it a go.

@Stone-Hedge
Copy link
Author

That doesn't work, sorry! I appreciate you spending time on this!

@iquidus
Copy link
Owner

iquidus commented Sep 7, 2016

cool, didnt think it would. I will need to set up my own instance of this to debug properly.

Can you link me to the github?

@Stone-Hedge
Copy link
Author

https://github.com/Crowndev/crowncoin.git master

This is a script I use to compile a CRW node from source on Ubuntu 16.04 just in case you needed a pointer for dependencies.

#!/bin/bash
echo "########### This script will install dependencies and compile and execute crowncoind"
echo "########### Configure swap"
sudo apt-get --yes --force-yes update
sudo apt-get --yes --force-yes install git
sudo mkdir -p /var/cache/swap/   
sudo dd if=/dev/zero of=/var/cache/swap/myswap bs=1M count=1024 
sudo mkswap /var/cache/swap/myswap 
sudo swapon /var/cache/swap/myswap 
sudo echo "/var/cache/swap/myswap    none    swap    sw    0   0" | sudo tee -a /etc/fstab
cat /etc/fstab
echo "########### Install dependencies"
sudo apt-get --yes --force-yes install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get --yes --force-yes install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo add-apt-repository ppa:bitcoin/bitcoin -y
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make
sudo make install
sudo ln -s /usr/local/BerkeleyDB.4.8 /usr/include/db4.8
sudo ln -s /usr/include/db4.8/include/* /usr/include
sudo ln -s /usr/include/db4.8/lib/* /usr/lib
echo "########### Compile Crowncoin"
mkdir ~/.crowncoin
cd ~/.crowncoin
git clone https://github.com/Crowndev/crowncoin.git -b master
cd crowncoin/
./autogen.sh && ./configure  && sudo make install -j 2
ls -s ~/.crowncoin/crowncoin/src /usr/local/bin

@Infernoman
Copy link

tx id : d031164873b08c3e7f906aac62aad28ef2968502c6a9af356b525d8caba6ea17

1LgxCV2ETBCgP6zg8U4EupxdmaMCK4dBK sends 50 000, but only sends 49750 to 1GyCGSiCLEszrYMguz2uz4ywpQ36SgjAyV and the rest go to fees
BUT the fee's don't get paid to the miner, so they in turn get burnt

@Stone-Hedge
Copy link
Author

Good spot!

@iquidus Does this explain what the problem is? Seems more than coincidental that the problem block has 250CRW unaccounted for in it.

Crowncoin has the ability to create named CRW addresses, the fee for doing so is 250 CRW which is burned. There will be more blocks like this.

I noticed that chainz.cryptoid.info can't sync past the same block either. Is there any way we can modify iquidus explorer to process this block and any others with the 250 CRW burn transaction in?

@Stone-Hedge
Copy link
Author

Sorry to hassle @iquidus , any ideas on how we can get Iquidus to cope with burn transactions? I'm very keen to use your explorer.

@kurrentproject
Copy link

Kurrent has exactly the same issue. When coins being destroyed, the block explorer no longer works. This happened when in Kurrent the coins are minted into zerocoins. That's where the exceptions seen. Dev any way to get around it?

@Stone-Hedge
Copy link
Author

Hi. Just a quick update. Iquidus is the best open source explorer out there. I'm willing to pay a decent bounty to anybody who can fix the issue so that it works with blockchains that destroy coins. Any help would be appreciated.

@leoreinaux
Copy link

@Stone-Hedge i dont know if still on time, but i fixed that on https://github.com/leoreinaux/explorer

@cvaldezscse
Copy link

for solve this problem at the first time you launch the site, and testing you have to start your explorer node application and inmediately next go to another console instance and sudo node scripts/sync.js index update

MotorMan added a commit to MotorMan/explorer that referenced this issue May 3, 2018
added a fix for insta-destroyed change that caused crashes in sync.js
fix made by rbtgit: their words from iquidus#56
"I've had this issue and fixed it by changing the following line in explorer.js:
if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata') {
to
if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata' && vout[i].scriptPubKey.hasOwnProperty("addresses")) { 
"
@dekm
Copy link

dekm commented Nov 9, 2018

anyone using zerocoin will have this issue as well @rbtgit fix above will resolve the issue though

@legends420
Copy link

tried the above fix and it was able to pass the block it was getting stuck on but moving blocks after implanting new code caused the whole explorer to mess up and not display blocks and connections counts etc..

@TheHolyRoger
Copy link
Collaborator

For anyone coming here from google, try the suggestions here: https://github.com/go140point6/pvpcoin-explorer#fix-for-length-undefined

This will eventually be resolved by modular commands for indexing altcoins with non-standard transactions.

@TheHolyRoger TheHolyRoger pinned this issue Jul 18, 2020
CryptoCoderz added a commit to CryptoCoderz/endiquidus that referenced this issue Aug 17, 2020
@B1ackt34
Copy link

what @rbtgit wrote solved my problem (indexing of BTAD coin) ... thank you so much

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

10 participants