Config error or possible bug in librenms SQL query?

Hi,

I am getting this message thousands of times per day in librenms.log :
[2019-07-24 22:35:04] production.ERROR: Device Group ‘North America POPs’ generates invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘sjc-’ in ‘where clause’ (SQL: select exists(select * from devices where (sjc- REGEXP sjc) and devices.device_id = 29) as exists)

Is this a config error on my part or is it a bug ?

Here’s my version data:

Version 1.53.1-49-gad044f478 - Wed Jul 24 2019 16:50:37 GMT+1200
DB Schema 2019_05_30_225937_device_groups_rewrite (135)
Web Server nginx/1.14.2
PHP 7.3.4-2
MySQL 10.3.15-MariaDB-1
RRDtool 1.7.1

Thanks.

and the full validate?

Sorry.
Here’s the full output:

ConfigurationOk

DatabaseOk

DependenciesOk

DiskOk

DistributedpollerOk

MailOk

PhpOk

PollerFailure

Fail: Some devices have not completed their polling run in 5 minutes, this will create gaps in data.

Fix: Check <CENSORED>/pollers/tab=log/ and see: http://docs.librenms.org/Support/Performance/

  • Devices
  • CENSORED
  • CENSORED

ProgramsWarning

Warning: IPv6 is disabled on your server, you will not be able to add IPv6 devices.

RrdOk

RrdcheckOk

UpdatesOk

UserFailure

Fail: Some folders have incorrect file permissions, this may cause issues.

Fix: sudo chown -R monweb:users /data/home/monweb/librenms sudo setfacl -d -m g::rwx /data/rrd /data/home/monweb/librenms/logs /data/home/monweb/librenms/bootstrap/cache/ /data/home/monweb/librenms/storage/ sudo chmod -R ug=rwX /data/rrd /data/home/monweb/librenms/logs /data/home/monweb/librenms/bootstrap/cache/ /data/home/monweb/librenms/storage/

  • Files
  • /data/home/monweb/librenms/storage/framework/views/dac8522dbc393e986a382670d6b7f5e1d8a45a9c.php

Service is running as monweb:users so the user fix at the end doesn’t apply.
As for the devices with slow polling - they have many interfaces so they don’t complete within 1 minute (we use 1 minute polling). I don’t think that’s the cause, but I’m mentioning it anyway.

Thanks,

Could u check this?
sjc- is no standaard column or group North America POPs has an wrong SQL statement

Thanks for the pointer. I have three devices in the network (Devices -> All devices -> Network) that are called:
sjc-asr-r15-br2.our.domain
sjc-asr-br1
sjc-bdr2.our.domain

Furthermore, in Devices -> Device groups -> North America POPs : I assume this looks at our devices, so it will represent the device names above.

Could t be that there’s a bug in librenms that doesn’t like device names called ‘sjc-’ - maybe the ‘-’ is being misinterpreted as a regex or some form of delimiter? Or perhaps these devices are configured wrong in some way that I can’t seem to find?

The strange thing is that I’ve got other devices called gw1-blah-blah.domain , gw2-… , and yet only the sjc-… are problematic.

We dont have any custom SQL - libremns is a clean install and configured only via the various config files.

Thanks.

i dont know this part. we dont have domain names, we use IP
and on my test i dont have “-” yust sw01.domain.com etc

so if its a bug maybe some1 else could look into this

Can you show a screenshot of the alert rule “North America POPs”?

My initial guess is you have backticks in your rule for some reason…

Hi,

We dont have alert rules. In Alerts → Alert rules - it is empty.
Then when I click on the big green button with “add rules” , I get this screenshot.

Thanks,

Sorry, I meant device group, not alert rule…

Hi,
The device group is also empty.
Here’s the screenshot.

Thanks

I mean the definition of that device group.

Attached.
I think you’ve found the problem:
Is something wrong in the ‘Pattern’ where it says REGEXP?
I can delete that group, it’s not in use.

maybe to edit it and redo your query?

where is your “sjc” in?

I just deleted it. The device hostnames aren’t consistent and we can’t trust that devices in sjc actually have names sjc- . So the easiest solution was delete this group and the log no longer has these line.

Big thanks to you and murrant for guiding me to find the problem.

1 Like