Mirobit / bitcoin-node-manager

:bar_chart: Lightweight dashboard and control system for bitcoin nodes
MIT License
122 stars 62 forks source link

Some errors after server maintenance #54

Closed mcjoshea closed 1 year ago

mcjoshea commented 2 years ago

After updating my server with all the latest security patches and updates, and after performing a few reboots, I checked my Bitcoin Node Manager and I'm now getting the following errors on the main page of BNM.

Notice: Undefined index: softforks in /.../src/Node.php on line 144
Warning: Invalid argument supplied for foreach() in /.../src/Utility.php on line 253

I have tried updating to the latest version of the code but that made no difference.

I also reverted back to a snapshot taken before the updates (but not before the reboots) and I still get the same issues, so this is probably to do with the rebooting of the server, rather than anything else. I also rebooted my Bitcoin node at a similar time, in case it matters. I've got two separate servers.

I'm running BNM on:

Debian Linux 10 Linux 4.19.0-20-amd64 on x86_64 PHP Version 7.3.31-1~deb10u1

Any ideas?

mcjoshea commented 2 years ago

Here are details of my node, in case it helps:

image

MeowMeNot commented 2 years ago

This also happened to me after I updated bitcoind to version 23. I made the edits shown below:

Go to /bitcoin-node-manager/src

line 144 in node.php add comment out \ (Should be two slashes)

Line 253 in Utility.php Remove:

function checkSoftFork($softForks){ foreach($softForks as $name => &$sf){ if($sf['type'] === 'bip9' && $sf['bip9']['status'] === "started"){ if(!preg_match("/[A-Za-z0-9 ]{2,25}/", $name)){ unset($softForks[$name]); continue; } $sf['status'] = ucfirst(preg_replace("/[^A-Za-z]/", '', $sf['bip9']['status'])); $sf['start_time'] = date("Y-m-d",$sf['bip9']['start_time']); $sf['timeout'] = date("Y-m-d",$sf['bip9']['timeout']); $sf['since'] = checkInt($sf['bip9']['since']); if(isset($sf['bip9']['statistics'])){ $sf['process'] = round(($sf['bip9']['statistics']['count']/$sf['bip9']['statistics']['period'])*100,1); } }else{ unset($softForks[$name]); } } return $softForks; }

mcjoshea commented 2 years ago

Thanks for that. I never even realised I had updated my node to latest version until today when I saw your message! To get rid of the errors all I had to do was to comment out line 144 of Node.php and that did the trick.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. With no activity this will be closed in 60 days.

mcjoshea commented 2 years ago

Just adding this note to keep my issue fresh.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. With no activity this will be closed in 60 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 60 days with no activity.

Mirobit commented 1 year ago

This has been fixed in #60. Thanks for reporting this.