Welcome, Guest. Please login or register.

Author Topic: Devices-List.php is blank (debug error below)  (Read 2692 times)

tristanbob

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Devices-List.php is blank (debug error below)
« on: December 11, 2020, 07:21:55 pm »
Most of our Nedi is working, but for some reason the Devices-List page does not show any output below the top menu bar.  I know we have devices in the database, because they show up in the reports.

PHP Version 7.4.11
System   Linux Hostname 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64
Build Date   Oct 18 2020 19:39:42
Server API   FPM/FastCGI

Here is some of the debug output from clicking on the "bug" on the top-right corner:

Code: [Select]
Self: Devices-List
Version: 1.9.100
NeDipath: /var/nedi

Fatal error: Uncaught Error: Call to undefined function snmp_set_quick_print() in /var/nedi/html/inc/libsnmp.php:8 Stack trace: #0 /var/nedi/html/Devices-List.php(9): include_once() #1 {main} thrown in /var/nedi/html/inc/libsnmp.php on line 8
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
    • View Profile
    • NeDi
Re: Devices-List.php is blank (debug error below)
« Reply #1 on: December 17, 2020, 03:14:11 pm »
Make sure, your PHP has the snmp module installed...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

tristanbob

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Re: Devices-List.php is blank (debug error below)
« Reply #2 on: January 11, 2021, 09:24:40 pm »
Remo, once again, you nailed it!  I have no idea how this got removed, it might have been during an Ubuntu upgrade.  The way I fixed this is:


Code: [Select]
me@nedi:~$ php -m | grep snmp
me@nedi:~$
me@nedi:~$ sudo apt-get install php-snmp
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

tristanbob

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Re: Devices-List.php is blank (debug error below)
« Reply #3 on: March 10, 2021, 06:46:17 pm »
I'm not sure why this keeps happening (perhaps OS updates), but the Devices List page is blank again.  Here is the current output.

Code: [Select]
Warning: Undefined array key "lim" in /var/nedi/html/Devices-List.php on line 23

Fatal error: Uncaught Error: Undefined constant "a" in /var/nedi/html/inc/libmisc.php:472 Stack trace: #0 /var/nedi/html/Devices-List.php(136): Filters() #1 {main} thrown in /var/nedi/html/inc/libmisc.php on line 472

The Nodes List page is also blank, with this error:

Code: [Select]
Fatal error: Uncaught TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, string given in /var/nedi/html/Nodes-List.php:11 Stack trace: #0 /var/nedi/html/Nodes-List.php(11): error_reporting() #1 {main} thrown in /var/nedi/html/Nodes-List.php on line 11
FYI - We are running version 1.9.100.
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

tristanbob

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Re: Devices-List.php is blank (debug error below)
« Reply #4 on: July 08, 2021, 09:18:31 pm »
I managed to make Nodes List work using two VERY hacky fixes (that might break other things).  I'm sharing them in case someone else can benefit from it.  I was NOT able to paste the diff on this post (perhaps due to special characters or PHP code) so I had to attach it as a text file.

Here is what I did:

Nodes-List.php: Comment line 8.  It now looks like this:
# error_reporting( ~'E_Notice');

libmisc.php: Delete the single "a" character on line 472.  It now looks like this:
<?php   if( $num == 1 ) return; ?>


Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

tristanbob

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Re: Devices-List.php is blank (debug error below)
« Reply #5 on: July 09, 2021, 02:03:07 am »
I went ahead and upgraded to Nedi 2.0c. 

My Devices List started working automatically, but I still had the same problem with Nodes List where I had to comment this line (12):

Code: [Select]
# error_reporting( ~'E_Notice');
Now I can see my nodes and devices!  :)
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!