Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Finding first block kills the website #131

Closed
GRinvest opened this issue May 4, 2017 · 18 comments
Closed

Finding first block kills the website #131

GRinvest opened this issue May 4, 2017 · 18 comments
Labels

Comments

@GRinvest
Copy link

GRinvest commented May 4, 2017

After finding the block on the Zclassic. Z-nomp stop working and get an error message:

2017-05-04 03:09:17 [Master] [Website] Website process died, spawning replacement...
2017-05-04 05:09:21 [Website] [Server] Website started on 0.0.0.0:80
undefined:3
var out='<style>\n #topCharts{\n padding: 18px;\n }\n #topCharts > div > div > svg{\n display: block;\n height: 280px;\n }\n .chartWrapper{\n border: solid 1px #c7c7c7;\n border-radius: 5px;\n padding: 5px;\n margin-bottom: 18px;\n }\n .chartLabel{\n font-size: 1.2em;\n text-align: center;\n padding: 4px;\n }\n .chartHolder{\n\n }\n\t\n\t#boxesLower {\n margin: 0 9px;\n }\n #boxesLower > div {\n display: flex;\n }\n #boxesLower > div > div {\n flex: 1 1 auto;\n margin: 0 9px 18px 9px;\n padding: 10px;\n display: flex;\n flex-direction: column;\n }\n .boxLowerHeader{\n font-size: 1.3em;\n margin: 0 0 5px 10px;\n }\n #boxStatsLeft{\n color: black;\n background-color: #cccccc;\n }\n #boxStatsRight{\n\t\tcolor: black;\n background-color: #cccccc;\n }\n .boxStats{\n color: whit

TypeError: Cannot read property '00000001967d4765f0579b46feab6adf2ca59911e647d6a0d33937dd2d1c8efc' of null
at Object.eval [as stats] (eval at doT.template (/home/z-nomp/node_modules/dot/doT.js:132:11), :3:6032)
at processTemplates (/home/z-nomp/libs/website.js:61:62)
at /home/z-nomp/libs/website.js:93:13
at /home/z-nomp/node_modules/async/dist/async.js:421:16
at iteratorCallback (/home/z-nomp/node_modules/async/dist/async.js:998:13)
at /home/z-nomp/node_modules/async/dist/async.js:906:16
at /home/z-nomp/libs/website.js:86:17
at tryToString (fs.js:449:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12)

After installation z-nomp the section Network Stats does not work. Everywhere shows 0
Any help please

@WaveringAna
Copy link
Contributor

Did you upgrade z-nomp or is this happening with a fresh install?

@WaveringAna WaveringAna added the bug label May 4, 2017
@hellcatz
Copy link
Collaborator

hellcatz commented May 4, 2017

TypeError: Cannot read property 00000001967d4765f0579b46feab6adf2ca59911e647d6a0d33937dd2d1c8efc' of null

Is this hash a block hash?
It may be trying to find a blockhash in an array and its missing causing the null exception...
I assume it is when you try to view stats.html in your browser?

@WaveringAna
Copy link
Contributor

@GRinvest
Copy link
Author

GRinvest commented May 4, 2017

This is a new installation. First I did it from here https://github.com/z-classic/z-nomp.git After I found the block This error was received. After that I installed from here https://github.com/hellcatz/z-nomp Get the same error. Pool not work After do redis-cli FLUSHALL and restart And work again. Also does not show section Network Stats Everywhere shows 0 http://zcl.minecrypto.pro/stats

@WaveringAna
Copy link
Contributor

well, FLUSHALL clears the redis DB completely hence the 0

@GRinvest
Copy link
Author

GRinvest commented May 4, 2017

not show section Network Stats

@hellcatz
Copy link
Collaborator

hellcatz commented May 4, 2017

As a test, if you clear the contents of website/pages/stats.html does this fix the problem?
(This will make the stats page blank on the pool of course, just trying to locate the exception...)

@GRinvest
Copy link
Author

GRinvest commented May 4, 2017

I cleaned up the page. I'll look at the result and write

@WaveringAna
Copy link
Contributor

I'm getting the same error as well

2017-05-05 00:28:59 [Pool]      [zcash_testnet] (Thread 1) Block found: 00103ecba349990d62a44ad4061fa9dc1bba643738d9fed56a8c12ea78c65f7e by tmEAUF32VncGNRKwbsyZWr1LYSwsnLZHEiA.cpu
2017-05-05 00:29:00 [Pool]      [zcash_testnet] (Thread 1) Block notification via RPC polling
undefined:3
var out='<style>\n    #topCharts{\n        padding: 18px;\n    }\n    #topCharts > div > div > svg{\n        display: block;\n        height: 280px;\n    }\n    .chartWrapper{\n        border: solid 1px #c7c7c7;\n        border-radius: 5px;\n        padding: 5px;\n        margin-bottom: 18px;\n    }\n    .chartLabel{\n        font-size: 1.2em;\n        text-align: center;\n        padding: 4px;\n    }\n    .chartHolder{\n\n    }\n\n\t#boxesLower {\n        margin: 0 9px;\n    }\n    #boxesLower > div {\n        display: flex;\n    }\n    #boxesLower > div > div {\n        flex: 1 1 auto;\n        margin: 0 9px 18px 9px;\n        padding: 10px;\n        display: flex;\n        flex-direction: column;\n    }\n    .boxLowerHeader{\n        font-size: 1.3em;\n        margin: 0 0 5px 10px;\n    }\n    #boxStatsLeft{\n        color: black;\n        background-color: #cccccc;\n    }\n    #boxStatsRight{\n\t\tcolor: black;\n        background-color: #cccccc;\n    }\n    .boxStats{\n        color: white;

TypeError: Cannot read property '00103ecba349990d62a44ad4061fa9dc1bba643738d9fed56a8c12ea78c65f7e' of null
    at Object.eval [as stats] (eval at <anonymous> (/root/git/z-nomp/node_modules/dot/doT.js:132:11), <anonymous>:3:6333)
    at processTemplates (/root/git/z-nomp/libs/website.js:61:62)
    at /root/git/z-nomp/libs/website.js:114:13
    at /root/git/z-nomp/libs/stats.js:589:13
    at /root/git/z-nomp/node_modules/async/dist/async.js:460:16
    at iteratorCallback (/root/git/z-nomp/node_modules/async/dist/async.js:1034:13)
    at /root/git/z-nomp/node_modules/async/dist/async.js:944:16
    at Multi.callback (/root/git/z-nomp/libs/stats.js:378:21)
    at multi_callback (/root/git/z-nomp/node_modules/redis/lib/multi.js:89:14)
    at Command.callback (/root/git/z-nomp/node_modules/redis/lib/multi.js:116:9)

This is with the pplnt pr

@WaveringAna
Copy link
Contributor

Restarted z-nomp and founder another block and didnt crash

@WaveringAna
Copy link
Contributor

I'm guessing it only does this with the first block

@hellcatz
Copy link
Collaborator

hellcatz commented May 5, 2017

I believe it is something in stats.html probably do to with the confirmation lookup and the fact it's missing from the array or the array itself doesn't exist yet...

@hellcatz
Copy link
Collaborator

hellcatz commented May 5, 2017

@hellcatz
Copy link
Collaborator

hellcatz commented May 5, 2017

Issue resolved with latest commit to patch-6. https://github.com/hellcatz/z-nomp/commit/8d5a13697f21e26163aa55567a00f9d54f9275b8

The problem is when the very first block is found :blocksPendingConfirms doesn't exist in redis; thus,
it.stats.pools[pool].pending.confirms doesn't exist when stats.html is generated.
This causes a null exception when if (it.stats.pools[pool].pending.confirms[block[0]]) is called.
The added if statement prevents the failure mode.

From the log below, I reproduced the crash. Reloaded the patched stats.html and no crash.

2017-05-04 18:37:12 [Pool]      [zcash_testnet] (Thread 2) Share rejected: {"job":"cccd","ip":"::ffff:10.0.2.2","worker":"tmKBPqa8qqKA7vrGq1AaXHSAr9vqa3GczzK.sherm_mac","difficulty":0.001953126,"error":"duplicate share"}
2017-05-04 18:37:18 [Website]   [Server] Reloaded file stats.html
undefined:3
var out='<script type="text/javascript">\n        $(document).ready(function(){\n                $(\'.btn-lg\').click(function(){\n                        window.location = "workers/" + $(\'.input-lg\').val();\n                });\n        });\n</script>\n\n'; function capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)} out+='\n'; function readableDate(a){ return new Date(parseInt(a)).toString(); } out+='\n'; function toISODate(a){ return new Date(parseInt(a)).toISOString(); } out+='\n'; var firstPool = true; out+='\n\n<ul class="tab">\n'; for(var pool in it.stats.pools) { out+='\n<li><a id="'+(capitalizeFirstLetter(it.stats.pools[pool].name))+'_link" href="#tabs" class="tablinks" onclick="showTab(event, \''+(capitalizeFirstLetter(it.stats.pools[pool].name))+'\')">'+(capitalizeFirstLetter(it.stats.pools[pool].name))+'</a></li>\n'; if (firstPool===true) { firstPool = capitalizeFirstLetter(it.stats.pools[pool].name); } } out+='\n<li style="float: right; padding-top: 6px; padding-

TypeError: Cannot read property '000607de73190eac4e544945647ec42bec5d79a19757540e85bd33a7c30a2080' of null
    at Object.eval [as stats] (eval at doT.template (/home/znomp/z-nomp/node_modules/dot/doT.js:132:11), <anonymous>:3:9394)
    at processTemplates (/home/znomp/z-nomp/libs/website.js:62:62)
    at /home/znomp/z-nomp/libs/website.js:94:13
    at /home/znomp/z-nomp/node_modules/async/dist/async.js:460:16
    at iteratorCallback (/home/znomp/z-nomp/node_modules/async/dist/async.js:1034:13)
    at /home/znomp/z-nomp/node_modules/async/dist/async.js:944:16
    at /home/znomp/z-nomp/libs/website.js:87:17
    at tryToString (fs.js:447:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:434:12)
2017-05-04 18:37:18 [Master]    [Website] Website process died, spawning replacement...
2017-05-04 18:37:21 [Website]   [Server] Website started on 0.0.0.0:8080
2017-05-04 18:37:24 [Payments]  [zcash_testnet] Finished interval - time spent: 94ms total, 6ms redis, 12ms daemon RPC
2017-05-04 18:37:29 [Website]   [Server] Reloaded file stats.html
^C

@WaveringAna WaveringAna changed the title Web site dead Finding first block kills the website May 5, 2017
@GRinvest
Copy link
Author

GRinvest commented May 5, 2017

I launched patch-6, And I'll take a look, But the demon's statistics do not show http://zcl.minecrypto.pro/stats section Network Stats. Shows 0

@GRinvest
Copy link
Author

GRinvest commented May 5, 2017

is ok. the problem is resolved site work. I'll close issues

@GRinvest GRinvest closed this as completed May 5, 2017
@WaveringAna WaveringAna reopened this May 5, 2017
@WaveringAna
Copy link
Contributor

lets keep it open till the PR is merged, that way duplicate issues dont get made

@ccycv
Copy link

ccycv commented Aug 8, 2017

May i know why i don't see the network stats on web interface? everything else is working

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants