Discovery failing for bgp-peers.inc.php

I have been having this issue for the last few days.

[FAIL] Discovery has not completed in the last 24 hours.
[FIX] Check the cron job to make sure it is running and using discovery-wrapper.py

I ran the following ( ./discovery.php -h all -v > /tmp/disco.txt & ) and the last few lines are posted below:

[email protected]
[/tmp]$ tail -20f disco.txt
[jnxBgpM2PeerLocalAddr] => 2A 04 E8 02 00 03 60 00 00 00 00 00 00 00 00 56
[jnxBgpM2PeerLocalPort] => 179
[jnxBgpM2PeerLocalAs] => 57976
[jnxBgpM2PeerRemoteAddrType] => ipv6
[jnxBgpM2PeerRemoteAddr] => 2A 04 E8 02 00 03 60 00 00 00 00 00 00 00 00 57
[jnxBgpM2PeerRemotePort] => 49986
[jnxBgpM2PeerRemoteAs] => 64976
[jnxBgpM2PeerIndex] => 76
[jnxBgpM2PeerRoutingInstance] => 0
)

)
peerindex for ipv4 4.53.230.237 is 11

Fatal error: Uncaught Error: Call to a member function getFamily() on null in /opt/librenms/includes/discovery/bgp-peers.inc.php:89
Stack trace:
#0 /opt/librenms/includes/discovery/functions.inc.php(175): include()
#1 /opt/librenms/discovery.php(125): discover_device(Array, Array)
#2 {main}
thrown in /opt/librenms/includes/discovery/bgp-peers.inc.php on line 89

I tried to send the disco.txt file into pbin.sh but the file is too large.

[email protected]
[/opt/librenms]$ more /tmp/disco.txt | ./pbin.sh
Paste endpoint: https://p.libren.ms/api/create
title:
name: librenms
private: 1
expire: 0

413 Request Entity Too Large

413 Request Entity Too Large


nginx/1.10.2

Can you edit includes/discovery/bgp-peers.inc.php and insert the following before line 88 (before IP:fromHexString):

var_dump($entry['jnxBgpM2PeerRemoteAddr']);

Then paste the same output as before, you should have a little extra data before the Fatal error.

@murrant, below are the last few lines that you have asked for.

string(11) "04 35 E6 ED"
peerindex for ipv4 4.53.230.237 is 11
string(4) "&hT
"
PHP Fatal error: Uncaught Error: Call to a member function getFamily() on null in /opt/librenms/includes/discovery/bgp-peers.inc.php:90
Stack trace:
#0 /opt/librenms/includes/discovery/functions.inc.php(175): include()
#1 /opt/librenms/discovery.php(125): discover_device(Array, Array)
#2 {main}
thrown in /opt/librenms/includes/discovery/bgp-peers.inc.php on line 90

Fatal error: Uncaught Error: Call to a member function getFamily() on null in /opt/librenms/includes/discovery/bgp-peers.inc.php:90
Stack trace:
#0 /opt/librenms/includes/discovery/functions.inc.php(175): include()
#1 /opt/librenms/discovery.php(125): discover_device(Array, Array)
#2 {main}
thrown in /opt/librenms/includes/discovery/bgp-peers.inc.php on line 90

What the heck is &hT That isn’t hex.

Scroll up a bit and past the snmp data from that entry. Should AFTER be jnxBgpM2PeerIndex => 11

Might be an os bug, but fix is here: https://github.com/librenms/librenms/pull/7773

The fix worked without any issues. Please let me know when it’s been merged into the master.

that was merged with the master https://github.com/librenms/librenms/pull/7773

Updates applied to all Libre servers. Not seeing any more issues. OK to close.