Loss of some graphics after update 23.10.0

Hi
Apparently after updating from 23.9.1 to 23.10.0 some port graphics of some devices(Cisco IOS XR) stopped having graphics, did this happen to anyone?
In the ports that were lost, the graphics were cut off at the same time

thanks

Component Version
LibreNMS 23.10.0 (2023-10-27T00:47:36-03:00)
DB Schema 2023_10_20_075853_cisco_asa_add_default_limits (269)
PHP 8.2.10
Python 3.9.2
Database MariaDB 10.5.19-MariaDB-0+deb11u2
RRDTool 1.7.2
SNMP 5.9
===========================================

[OK] Composer Version: 2.6.5
[OK] Dependencies up-to-date.
[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] Distributed Polling setting is enabled globally
[OK] Connected to rrdcached
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached

Super strange?

So just some ports on some devices? (but not all the ports on those devices?)

Has a discovery run recently?

Check your eventlog and librenms.log. Likely your device is causing an error. If you have an error message with stack trace, we can get it fixed.

It seems that the problem is when the description of a port has " : "

port-descr-parser.inc.php

Error polling ports module for CISCO-55A1. PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\x96 ggc’ for column librenms.eventlog.message at row 1 in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580

Stack trace:

#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(580): PDOStatement->execute()

#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(788): Illuminate\Database\Connection->Illuminate\Database{closure}()

#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(755): Illuminate\Database\Connection->runQueryCallback()

#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(569): Illuminate\Database\Connection->run()

#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(533): Illuminate\Database\Connection->statement()

#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert()

#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3383): Illuminate\Database\Query\Processors\Processor->processInsertGetId()

#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1925): Illuminate\Database\Query\Builder->insertGetId()

#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1333): Illuminate\Database\Eloquent\Builder->__call()

#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1298): Illuminate\Database\Eloquent\Model->insertAndSetId()

#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1137): Illuminate\Database\Eloquent\Model->performInsert()

#11 /opt/librenms/app/Models/Eventlog.php(88): Illuminate\Database\Eloquent\Model->save()

#12 /opt/librenms/app/Models/Eventlog.php(58): App\Models\Eventlog->_log()

#13 /opt/librenms/includes/functions.php(231): App\Models\Eventlog::log()

#14 /opt/librenms/includes/polling/ports.inc.php(761): log_event()

#15 /opt/librenms/LibreNMS/Modules/LegacyModule.php(114): include(‘…’)

#16 /opt/librenms/LibreNMS/Poller.php(178): LibreNMS\Modules\LegacyModule->poll()

#17 /opt/librenms/LibreNMS/Poller.php(105): LibreNMS\Poller->pollModules()

#18 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()

#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()

#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()

#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()

#25 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()

#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(177): Symfony\Component\Console\Command\Command->run()

#27 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()

#28 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()

#29 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()

#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()

#31 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()

#32 /opt/librenms/lnms(38): App\Console\Kernel->handle()

#33 {main}

Next Illuminate\Database\QueryException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\x96 ggc’ for column librenms.eventlog.message at row 1 (Connection: mysql, SQL: insert into eventlog (reference, type, datetime, severity, message, username, device_id) values (87898, interface, 2023-10-30 20:00:25, 3, type: @intarbor nodo cache google ? ggc → @intarbor nodo cache google c, , 295)) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795

Stack trace:

#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(755): Illuminate\Database\Connection->runQueryCallback()

#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(569): Illuminate\Database\Connection->run()

#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(533): Illuminate\Database\Connection->statement()

#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert()

#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3383): Illuminate\Database\Query\Processors\Processor->processInsertGetId()

#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1925): Illuminate\Database\Query\Builder->insertGetId()

#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1333): Illuminate\Database\Eloquent\Builder->__call()

#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1298): Illuminate\Database\Eloquent\Model->insertAndSetId()

#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1137): Illuminate\Database\Eloquent\Model->performInsert()

#9 /opt/librenms/app/Models/Eventlog.php(88): Illuminate\Database\Eloquent\Model->save()

#10 /opt/librenms/app/Models/Eventlog.php(58): App\Models\Eventlog->_log()

#11 /opt/librenms/includes/functions.php(231): App\Models\Eventlog::log()

#12 /opt/librenms/includes/polling/ports.inc.php(761): log_event()

#13 /opt/librenms/LibreNMS/Modules/LegacyModule.php(114): include(‘…’)

#14 /opt/librenms/LibreNMS/Poller.php(178): LibreNMS\Modules\LegacyModule->poll()

#15 /opt/librenms/LibreNMS/Poller.php(105): LibreNMS\Poller->pollModules()

#16 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()

#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()

#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()

#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()

#23 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()

#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(177): Symfony\Component\Console\Command\Command->run()

#25 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()

#26 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()

#27 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()

#28 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()

#29 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()

#30 /opt/librenms/lnms(38): App\Console\Kernel->handle()

#31 {main}

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\x96 ggc’ for column librenms.eventlog.message at row 1 (Connection: mysql, SQL: insert into eventlog (reference, type, datetime, severity, message, username, device_id) values (87898, interface, 2023-10-30 20:00:25, 3, type: @intarbor nodo cache google ? ggc → @intarbor nodo cache google c, , 295)) {“exception”:"[object] (Illuminate\Database\QueryException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\x96 ggc’ for column librenms.eventlog.message at row 1 (Connection: mysql, SQL: insert into eventlog (reference, type, datetime, severity, message, username, device_id) values (87898, interface, 2023-10-30 20:00:25, 3, type: @intarbor nodo cache google ? ggc → @intarbor nodo cache google � ggc, , 295)) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795)

[previous exception] [object] (PDOException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\x96 ggc’ for column librenms.eventlog.message at row 1 at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580)"}

Looks like your device is returning a character that is not utf-8 compatible…
I don’t know how to fix that from the LibreNMS side.

\x96 seems to be in latin1, but that character doesn’t exist in UTF-8.
Possibly removing the will fix it or replace it with -

This error started after the update 23.10.0

find in port-descr-parser.inc.php

<?php // Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes unset($port_ifAlias); echo $this_port['ifAlias']; $split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']); **<<<<<<<<<<<<<<<<<

Not sure it would have anything to do with the version change.

One of your devices has in a port ifAlias. Find that device and fix it.

Hi @murrant! After the last upgrade we had the same problem. I dont know if is something with the new poller lnms, but there was a change that affect the port-descr-parser.inc.php, or another file that have asociations with the port poller. We had severals interfaces configured with the – (U+2013 : EN DASH) on the description of the ports, and that didn’t break the polling before.

We remove “:” from the next file and we recover the polling. We understand that the character “–” is not allowed on the database, but it was working before the last update.

port-descr-parser.inc.php
<?php

// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);

echo $this_port['ifAlias'];

$split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']);   <<<<<<<<<<<<<<<<<<< we remove the ":" 
$type = isset($split[0]) ? trim($split[0]) : null;
$descr = isset($split[1]) ? trim($split[1]) : null;

$circuit = trim(preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? '');
$notes = trim(preg_split('/[()]/', $this_port['ifAlias'])[1] ?? '');
$speed = trim(preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? '');

if ($type && $descr) {
    $type = strtolower($type);
    $port_ifAlias['type'] = $type;
    $port_ifAlias['descr'] = $descr;
    $port_ifAlias['circuit'] = $circuit;
    $port_ifAlias['speed'] = substr($speed, 0, 32);
    $port_ifAlias['notes'] = $notes;

    d_echo($port_ifAlias);
}

unset($type, $descr, $circuit, $notes, $speed, $split);

Port description TEST description – PORT: LIBRENMS

This is the info on database when port polling doesn’t work:

MariaDB [librenms]>  select ifAlias from ports WHERE port_id = '71';
+-------------------------------------+
| ifAlias                             |
+-------------------------------------+
| TEST description – PORT: LIBRENMS   |
+-------------------------------------+
1 row in set (0.000 sec)

MariaDB [librenms]>  select port_descr_type  from ports WHERE port_id = '71';
+---------------------------+
| port_descr_type           |
+---------------------------+
| test description – port   |
+---------------------------+
1 row in set (0.001 sec)

MariaDB [librenms]>  select port_descr_descr  from ports WHERE port_id = '71';
+------------------+
| port_descr_descr |
+------------------+
| LIBRENMS         |
+------------------+
1 row in set (0.001 sec)

MariaDB [librenms]>

This is the info on database with the workarraund we apply on the port-descr-parser.inc.php:

MariaDB [librenms]>  select ifAlias from ports WHERE port_id = '71';
+-------------------------------------+
| ifAlias                             |
+-------------------------------------+
| TEST description – PORT: LIBRENMS   |
+-------------------------------------+
1 row in set (0.001 sec)

MariaDB [librenms]>  select port_descr_type  from ports WHERE port_id = '71';
+-----------------+
| port_descr_type |
+-----------------+
| NULL            |
+-----------------+
1 row in set (0.001 sec)

MariaDB [librenms]>  select port_descr_descr  from ports WHERE port_id = '71';
+------------------+
| port_descr_descr |
+------------------+
| NULL             |
+------------------+
1 row in set (0.001 sec)

Thanks!
Regards

Was it working or just silently failing?

I suspect it was failing without an error. However, the new code reporting the error does block the rest of the module from proceeding, unlike before.

It will take quite some extensive code (or at least a library) to filter out non-UTF-8 characters.

Can someone give one or more example port descriptions so I don’t have to keep guessing? Thanks in advance.

I believe that like you say, the error for the incorrect caracter was there before, but that doesn’t stopped the polling.
I did a test on one device( leaving the port-descr-parser.inc.php as default), and i removed all the incorrect caracters “–”, and the polling work flawless, with no errors. Then i added the – to one interface ,and the port polling stopped when it reach the interface with the character error. I think the problem is just the – (U+2013 : EN DASH)

lnms device:poll 10.2.189.138 -m ports

Port TenGigE0/0/0/0: TenGigE0/0/0/0 (120 / #71) dot3Duplex VLAN = ? TEST description – PORT: LIBRENMSError polling ports module for 10.2.189.138. PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(580): PDOStatement->execute()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(788): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(755): Illuminate\Database\Connection->runQueryCallback()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(569): Illuminate\Database\Connection->run()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(533): Illuminate\Database\Connection->statement()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3383): Illuminate\Database\Query\Processors\Processor->processInsertGetId()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1925): Illuminate\Database\Query\Builder->insertGetId()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1333): Illuminate\Database\Eloquent\Builder->__call()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1298): Illuminate\Database\Eloquent\Model->insertAndSetId()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1137): Illuminate\Database\Eloquent\Model->performInsert()
#11 /opt/librenms/app/Models/Eventlog.php(88): Illuminate\Database\Eloquent\Model->save()
#12 /opt/librenms/app/Models/Eventlog.php(58): App\Models\Eventlog->_log()
#13 /opt/librenms/includes/functions.php(231): App\Models\Eventlog::log()
#14 /opt/librenms/includes/polling/ports.inc.php(761): log_event()
#15 /opt/librenms/LibreNMS/Modules/LegacyModule.php(114): include('...')
#16 /opt/librenms/LibreNMS/Poller.php(178): LibreNMS\Modules\LegacyModule->poll()
#17 /opt/librenms/LibreNMS/Poller.php(105): LibreNMS\Poller->pollModules()
#18 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()
#25 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(177): Symfony\Component\Console\Command\Command->run()
#27 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()
#28 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#29 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#31 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()
#32 /opt/librenms/lnms(38): App\Console\Kernel->handle()
#33 {main}

Next Illuminate\Database\QueryException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-01 22:33:00, 3, type: test description – port -> test description – port, , 4)) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(755): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(569): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(533): Illuminate\Database\Connection->statement()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3383): Illuminate\Database\Query\Processors\Processor->processInsertGetId()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1925): Illuminate\Database\Query\Builder->insertGetId()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1333): Illuminate\Database\Eloquent\Builder->__call()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1298): Illuminate\Database\Eloquent\Model->insertAndSetId()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1137): Illuminate\Database\Eloquent\Model->performInsert()
#9 /opt/librenms/app/Models/Eventlog.php(88): Illuminate\Database\Eloquent\Model->save()
#10 /opt/librenms/app/Models/Eventlog.php(58): App\Models\Eventlog->_log()
#11 /opt/librenms/includes/functions.php(231): App\Models\Eventlog::log()
#12 /opt/librenms/includes/polling/ports.inc.php(761): log_event()
#13 /opt/librenms/LibreNMS/Modules/LegacyModule.php(114): include('...')
#14 /opt/librenms/LibreNMS/Poller.php(178): LibreNMS\Modules\LegacyModule->poll()
#15 /opt/librenms/LibreNMS/Poller.php(105): LibreNMS\Poller->pollModules()
#16 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()
#23 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(177): Symfony\Component\Console\Command\Command->run()
#25 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()
#26 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#27 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#28 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#29 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()
#30 /opt/librenms/lnms(38): App\Console\Kernel->handle()
#31 {main}  
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-01 22:33:00, 3, type: test description – port -> test description – port, , 4)) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-01 22:33:00, 3, type: test description – port -> test description � port, , 4)) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795)
[previous exception] [object] (PDOException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\x96 port' for column `librenms`.`eventlog`.`message` at row 1 at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580)"} 
  
>> SNMP: [18/7.11s] MySQL: [124/1.64s] RRD: [62/0.02s]  
>> Runtime for poller module 'ports': 7.7716 seconds with 1549624 bytes  
#### Unload poller module ports ####

Regards

Are you positing that something in the port-descr-parser.inc.php file is causing the issue?

Try putting return; as the second line of that file. and see if that fixes it. (this skips port parsing)

Hi! Sorry for the delay!
I did the test putting the return; on the port-descr-parser.inc.php and the polling of the ports works without problems.

librenms@XXXXX:~/includes$ vi port-descr-parser.inc.php 
<?php
return;
// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);

echo $this_port['ifAlias'];

Regards

@Markov hmm, well that confirms what file the problem is in.

Try removing the return, and running the poller with debug output:
lnms device:poll -m ports -vv <hostname>

@murrant I removed the return on the file, and execute the command as you describe.

The problem begins with port Te0/0/0/0 whose description was modified with the character – (U+2013 : EN DASH) as a test. After that port fails, polling of the rest of the interfaces get stuck.

You will see that the interface description has the : and that is readed by the port parser.

interface TenGigE0/0/0/0
description TEST description – PORT: LIBRENMS

Port TenGigE0/0/0/0: TenGigE0/0/0/0 (120 / #71) ifHCInOctets  
ifHCOutOctets  
ifHCInUcastPkts  
ifHCOutUcastPkts  
ifInBroadcastPkts  
ifOutBroadcastPkts  
ifHCInMulticastPkts  
ifHCOutMulticastPkts  
ifHighSpeed (10000)  
dot3Duplex VLAN = ? TEST description – PORT: LIBRENMSarray (
  'type' => 'test description – port',
  'descr' => 'LIBRENMS',
  'circuit' => '',
  'speed' => '',
  'notes' => '',
)  
Error polling ports module for 10.2.189.138. PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(580): PDOStatement->execute()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(788): Illuminate\Database\Connection->Illuminate\Database\{closure}()

I tried to reproduce this, but I could not.

Any chance you could post your port description parsing file?

1 Like

Hi @murrant !
This is the description im using on the interface:

interface TenGigE0/0/0/0
description TEST description – PORT: LIBRENMS

This is the original file, which breaks the polling

root@LAB:/opt/librenms# cat includes/port-descr-parser.inc.php
<?php

// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);

echo $this_port['ifAlias'];

$split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']);
$type = isset($split[0]) ? trim($split[0]) : null;
$descr = isset($split[1]) ? trim($split[1]) : null;

$circuit = trim(preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? '');
$notes = trim(preg_split('/[()]/', $this_port['ifAlias'])[1] ?? '');
$speed = trim(preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? '');

if ($type && $descr) {
    $type = strtolower($type);
    $port_ifAlias['type'] = $type;
    $port_ifAlias['descr'] = $descr;
    $port_ifAlias['circuit'] = $circuit;
    $port_ifAlias['speed'] = substr($speed, 0, 32);
    $port_ifAlias['notes'] = $notes;

    d_echo($port_ifAlias);
}

unset($type, $descr, $circuit, $notes, $speed, $split);
root@LAB:/opt/librenms# ```


This is the file on other server, on which we applied the workaround to get the polling working

librenms@PRODUCTION:~$ cat includes/port-descr-parser.inc.php
<?php

// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);

echo $this_port['ifAlias'];

$split = preg_split('/[\[\]{}()]/', $this_port['ifAlias']);
$type = isset($split[0]) ? trim($split[0]) : null;
$descr = isset($split[1]) ? trim($split[1]) : null;

$circuit = trim(preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? '');
$notes = trim(preg_split('/[()]/', $this_port['ifAlias'])[1] ?? '');
$speed = trim(preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? '');

if ($type && $descr) {
    $type = strtolower($type);
    $port_ifAlias['type'] = $type;
    $port_ifAlias['descr'] = $descr;
    $port_ifAlias['circuit'] = $circuit;
    $port_ifAlias['speed'] = substr($speed, 0, 32);
    $port_ifAlias['notes'] = $notes;

    d_echo($port_ifAlias);
}

unset($type, $descr, $circuit, $notes, $speed, $split);

Regards

Umm I made a test with the last update, and the polling still broken.


Port TenGigE0/0/0/0: TenGigE0/0/0/0 (120 / #71) ifHCInOctets  
ifHCOutOctets  
ifHCInUcastPkts  
ifHCOutUcastPkts  
ifInBroadcastPkts  
ifOutBroadcastPkts  
ifHCInMulticastPkts  
ifHCOutMulticastPkts  
ifHighSpeed (10000)  
dot3Duplex VLAN = ? TEST description – PORT: LIBRENMSarray (
  'type' => 'test description – port',
  'descr' => 'LIBRENMS',
  'circuit' => '',
  'speed' => '',
  'notes' => '',
)  
Error polling ports module for 10.2.189.138. PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(580): PDOStatement->execute()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(788): Illuminate\Database\Connection->Illuminate\Database\{closure}()


Next Illuminate\Database\QueryException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-19 14:32:38, 3, type: test description – port -> test description – port, , 4)) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795
Stack trace:

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-19 14:32:38, 3, type: test description – port -> test description – port, , 4)) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\x96 port' for column `librenms`.`eventlog`.`message` at row 1 (Connection: mysql, SQL: insert into `eventlog` (`reference`, `type`, `datetime`, `severity`, `message`, `username`, `device_id`) values (71, interface, 2023-11-19 14:32:38, 3, type: test description – port -> test description � port, , 4)) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795)
[previous exception] [object] (PDOException(code: 22007): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\x96 port' for column `librenms`.`eventlog`.`message` at row 1 at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:580)"} 

Regards

Not that surprising since I still can’t reproduce your issue. I was able to cause an error that was similar by manually injecting “\x96”