Since we ran daily.sh overnight it seems the ports view on our Mikrotik devices is broken. Other devices show ports fine. Logs show:
(PDOException(code: HY000): SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)"}
Output from validate.php:
librenms@librenms01:~$ ./validate.php
Component
Version
LibreNMS
25.3.0-63-g43a17931a (2025-03-28T05:35:10+00:00)
DB Schema
2025_03_18_003446_drop_bouncer_tables (327)
PHP
8.3.14
Python
3.10.12
Database
MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1
RRDTool
1.7.2
SNMP
5.9.1
===========================================
[OK] Composer Version: 2.8.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[FAIL] Some poller nodes have not checked in recently
Inactive Nodes:
nam-test
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached
Similar problem, loading ports page on MikroTik devices suddenly takes very long and sometimes ends with 504 Gateway Time-out or hits PHP Memory limit.
select * from portswhereport_id in (1 billion port ids)
The problem is this doesn’t show the full stack trace, only the last file the code ran from, is that all there is?
[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)"}
I think that it is generally problem with displaying IPv6 neighbours who shares fe80::/64 subnet. And almost all devices share the same fe80::/64 subnet.
Now on each interface of each IPv6 device in ports page I see all ports of other IPv6 enabled devices in LibreNMS. On my setup with ~ 1200 devices, for some random 10 ports MikroTik router it roughly takes 10 ports x 600 neighbours → 6000 ports generated as neighbours which means 35MB of HTML and ~ 500 000 lines of HTML code.
I’ve applied the patch and run the discovery but I’m still getting the same error:
[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)"}