Mikrotik ports view broken

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.

our problem is the same, is it because of the latest update?

Seems like some update broke something.

I tried to reproduce this issue and I could not. Can anyone give me more info or perhaps a full error backtrace?

https://p.libren.ms/view/643c84ab

Full output of my logs here. If you need any further info let me know. Thanks!

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)"}

Yes that’s all that shows in my logs other than the usual polling messages.

is your user an admin?

Yes. Full admin user

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.

1 Like

Can someone test this PR? it stops treating link local addresses like they are a network common to ALL interfaces that have IPv6 enabled :smiley:

You will need to run ipv6-addresses discovery after applying the patch.
./discovery.php -h all -m ipv6-addresses

1 Like

Tried in production, problem is fixed :slight_smile:

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)"}

This looks to be fixed now. Thanks!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.