iquidus / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
750 stars 1.33k forks source link

Not seeing blockchain #470

Closed seanjmcm closed 3 years ago

seanjmcm commented 3 years ago

There's a few hundred blocks processed but explorer isn't seeing those blocks at all.

I'm running using pm2.

The error log is empty and npm-out.log shows the following:

Starting cluster with pid: 4522
^[[0mGET /ext/getlasttxsajax/0?draw=17&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=false&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=false&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=false&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=false&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1621779583096 ^[[32m200 ^[[0m18.166 ms - 60^[[0m
^[[0mGET /ext/summary ^[[36m304 ^[[0m38.620 ms - -^[[0m
^[[0mGET / ^[[36m304 ^[[0m593.480 ms - -^[[0m
^[[0mGET /vendor/jqplot/jquery.jqplot.css ^[[36m304 ^[[0m1.855 ms - -^[[0m
^[[0mGET /themes/Lumen/bootstrap.min.css ^[[36m304 ^[[0m1.882 ms - -^[[0m
^[[0mGET /stylesheets/style.css ^[[36m304 ^[[0m1.064 ms - -^[[0m
^[[0mGET /vendor/flags-css/css/flag-icon.min.css ^[[36m304 ^[[0m0.656 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.dateAxisRenderer.min.js ^[[36m304 ^[[0m1.042 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.ohlcRenderer.min.js ^[[36m304 ^[[0m0.969 ms - -^[[0m
^[[0mGET /vendor/jqplot/jquery.jqplot.min.js ^[[36m304 ^[[0m1.007 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.highlighter.min.js ^[[36m304 ^[[0m1.558 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.barRenderer.min.js ^[[36m304 ^[[0m0.789 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.categoryAxisRenderer.min.js ^[[36m304 ^[[0m0.803 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.pieRenderer.min.js ^[[36m304 ^[[0m2.618 ms - -^[[0m
^[[0mGET /javascripts/chart.js ^[[36m304 ^[[0m0.426 ms - -^[[0m
^[[0mGET /images/logo.png ^[[36m304 ^[[0m0.438 ms - -^[[0m
^[[0mGET /ext/summary ^[[36m304 ^[[0m10.669 ms - -^[[0m
^[[0mGET /ext/getlasttxsajax/0?draw=1&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=false&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=false&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=false&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=false&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1621780551199 ^[[32m200 ^[[0m7.518 ms - 59^[[0m
^[[0mGET / ^[[36m304 ^[[0m345.690 ms - -^[[0m
^[[0mGET /themes/Lumen/bootstrap.min.css ^[[36m304 ^[[0m0.715 ms - -^[[0m
^[[0mGET /vendor/jqplot/jquery.jqplot.css ^[[36m304 ^[[0m1.419 ms - -^[[0m
^[[0mGET /vendor/flags-css/css/flag-icon.min.css ^[[36m304 ^[[0m0.650 ms - -^[[0m
^[[0mGET /vendor/jqplot/jquery.jqplot.min.js ^[[36m304 ^[[0m0.773 ms - -^[[0m
^[[0mGET /stylesheets/style.css ^[[36m304 ^[[0m0.738 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.ohlcRenderer.min.js ^[[36m304 ^[[0m0.405 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.dateAxisRenderer.min.js ^[[36m304 ^[[0m1.046 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.highlighter.min.js ^[[36m304 ^[[0m0.955 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.pieRenderer.min.js ^[[36m304 ^[[0m0.447 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.categoryAxisRenderer.min.js ^[[36m304 ^[[0m0.676 ms - -^[[0m
^[[0mGET /vendor/jqplot/plugins/jqplot.barRenderer.min.js ^[[36m304 ^[[0m0.665 ms - -^[[0m
^[[0mGET /javascripts/chart.js ^[[36m304 ^[[0m0.523 ms - -^[[0m
^[[0mGET /images/logo.png ^[[36m304 ^[[0m0.452 ms - -^[[0m
^[[0mGET /ext/summary ^[[36m304 ^[[0m16.074 ms - -^[[0m

Any ideas why it is not connecting to the blockchain and not reporting any errors?

joeuhren commented 3 years ago

Which coin are you trying to sync?

Also, how do you know a few hundred blocks were processed if you cannot see them? Do you get an error msg when trying to run the blockchain sync manually from the terminal (cd /path/to/explorer && /usr/bin/nodejs scripts/sync.js index update)?

seanjmcm commented 3 years ago

Hi

Sorry for the delay. I called the coin cryptcoin -- https://www.cryptcoin.digital/

I did a Udemy course and managed to get the core and wallet working fine. I discovered that the commands in crontab were not executed and when I ran manually it seemed to sync.

cd ~/explorer && node scripts/sync.js index update > /dev/null 2>&1
cd ~/explorer && node scripts/sync.js market > /dev/null 2>&1
cd ~/explorer && node scripts/peers.js > /dev/null 2>&1

Unfortunately on closer inspection, it didn't work properly.

http://35.246.101.188:3001/

You can see at the above it works ok to block 602 but then skips ahead to 2713.

When I attempt to run the command you gave I get the following:

sean@server2:~/cryptcoin/src$ cd ~/explorer && /usr/bin/nodejs scripts/sync.js index update
-bash: /usr/bin/nodejs: No such file or directory
sean@server2:~/explorer$ sudo find / -name nodejs
/snap/google-cloud-sdk/187/platform/ext-runtime/nodejs
/snap/google-cloud-sdk/186/platform/ext-runtime/nodejs
sean@server2:~/explorer$ cd ~/explorer && /snap/google-cloud-sdk/187/platform/ext-runtime/nodejs scripts/sync.js index update
-bash: /snap/google-cloud-sdk/187/platform/ext-runtime/nodejs: Is a directory

On the same server I get:

@server2:~/cryptcoin/src$ ./cryptcoin-cli getinfo
{
  "version": 140200,
  "protocolversion": 70015,
  "walletversion": 130000,
  "balance": 0.00000000,
  "blocks": 7694,
  "timeoffset": 0,
  "connections": 3,
  "proxy": "",
  "difficulty": 0.0002441371325370145,
  "testnet": false,
  "keypoololdest": 1623972580,
  "keypoolsize": 100,
  "paytxfee": 0.00000000,
  "relayfee": 0.00100000,
  "errors": ""
}

Any pointers you could give would be really helpful as would prefer to debug rather than reinstall in case it happens again.

seanjmcm commented 3 years ago

After deleting index.pid and running node scripts/sync.js index reindex it gets as far as 2193 and then gives the following:

2192: 0e4770a6987f63c5b25e86d9bdb9ced1dd6103154b3ea0274b3da0e039213491
2193: 685b3a314d2d692a5690fe30399666a08f9030d2559aa88b2e5800ffc09f4d37
/home/XXXX/explorer/node_modules/bluebird/js/release/async.js:49
        fn = function () { throw arg; };
                           ^

TypeError: Cannot read property 'length' of undefined
    at /home/XXXX/explorer/lib/explorer.js:557:43
    at /home/XXXX/explorer/lib/explorer.js:207:16
    at Client.<anonymous> (/home/XXXX/explorer/lib/explorer.js:27:16)
    at Client.tryCatcher (/home/XXXX/explorer/node_modules/bluebird/js/release/util.js:16:23)
    at Promise.successAdapter (/home/XXXX/explorer/node_modules/bluebird/js/release/nodeify.js:23:30)
    at Promise._settlePromise (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:601:21)
    at Promise._settlePromise0 (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:673:18)
    at Request._callback (/home/XXXX/explorer/node_modules/bluebird/js/release/nodeback.js:45:21)
    at Request.self.callback (/home/XXXX/explorer/node_modules/request/request.js:185:22)
    at Request.emit (events.js:215:7)
    at Request.<anonymous> (/home/XXXX/explorer/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/XXXX/explorer/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:299:28)

Sorry for all this I haven't been working in linux environments for a while. Seems like I'm getting closer...

c4pt000 commented 3 years ago

rename nodejs to node for /usr/bin/node "which node"

uaktags commented 3 years ago

@seanjmcm

You're definitely right about there. The last issue you posted about length is a common issues with these altcoins and iquidus. My guess is you have non-standard txes in block 2193/2194.

Line 557 is telling you that your vout is empty which is not standard for a transaction (you should have inputs and outputs).

I'll have to update this comment with the respected issue that has a workaround, but the workaround is not a "solution", it just won't fail at that point.

56

(Not sure what c4pt000 comment is for, it's unrelated to your issue)

seanjmcm commented 3 years ago

Sorry for the slow reply.

In the end, I deleted the blockchain on the server and ran node scripts/sync.js index update or possibly reindex. It went past the problem block seems to be working fine apart from the crontab. (but that's another story). I'm going to close the issue now as resolved.

TLDR

Deleted blockchain in .crytpcoin/blocks folder and resynced explorer