MySQL error with librenms.cef table doesn't exist #5362

Closed
boudreau opened this Issue Jan 9, 2017 · 1 comment

Projects

None yet

2 participants

@boudreau
Contributor
boudreau commented Jan 9, 2017 edited

Hi, started receiving this error yesterday with our discovery process.

I don't recall seeing a librenms.cef table in the DB. I don't see any errors in our polling either.

Any help appreciated.

I have a few other devices that produce the same error. But I work to find where the error was coming from:

isolated it to the cisco-cef module:

./discovery.php -h 62 -m cisco-cef

produces this log entries:

2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv4' AND cef_index='1'' at line 1 (SELECT COUNT() from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv4' AND cef_index='1')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv4','1'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv4' AND cef_index='2'' at line 1 (SELECT COUNT(
) from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv4' AND cef_index='2')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv4','2'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv4' AND cef_index='3'' at line 1 (SELECT COUNT() from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv4' AND cef_index='3')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv4','3'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv4' AND cef_index='4'' at line 1 (SELECT COUNT(
) from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv4' AND cef_index='4')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv4','4'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv6' AND cef_index='1'' at line 1 (SELECT COUNT() from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv6' AND cef_index='1')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv6','1'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv6' AND cef_index='2'' at line 1 (SELECT COUNT(
) from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv6' AND cef_index='2')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv6','2'))
2017-01-09 11:35:13 MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND afi='ipv6' AND cef_index='3'' at line 1 (SELECT COUNT(*) from cef WHERE device_id = '62' AND entPhysicalIndex = '2016', AND afi='ipv6' AND cef_index='3')
2017-01-09 11:35:13 MySQL Error: Table 'librenms.cef' doesn't exist (INSERT INTO cef (device_id,entPhysicalIndex,afi,cef_path) VALUES ('62','2016','ipv6','3'))
./discovery.php 62 2017-01-09 11:35:13 - 1 devices discovered in 8.677 secs

Component Version
LibreNMS b3f6218
DB Schema 152
PHP 5.4.16
MySQL 5.5.50-MariaDB
RRDTool 1.5.6
SNMP NET-SNMP 5.7.2

DO NOT DELETE THIS INFORMATION.

Please read this information carefully.

GitHub issues is for feature requests or bugs, please do not post issues asking for help or how to do X, Y or Z.
You can use our irc channel ##librenms on freenode to ask questions or our community site.

  • Is your install up to date? Updating your install
    Please do not submit an issue if your install is not up to date within the last 24 hours or on a stable monthly release.
  • Please include all of the information between the ==================================== section of ./validate.php.
  • If you would like us to add a new device or your device is listed as Generic then please provide the information asked for here
  • Please provide as much detail as possible.
@laf
Member
laf commented Jan 9, 2017

We enabled the reporting of mysql query errors the other day hence you see it now.

This is showing us that we need to fix some code, thanks for reporting.

@laf laf added the Bug label Jan 9, 2017
@geordish geordish referenced this issue Jan 13, 2017
Merged

Fix SQL errors #5420

2 of 2 tasks complete
@laf laf closed this Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment