Error in Unix-agent communication?

Seems that between 31 Januari and 01 February the librenms.log started showings error for the devices where I’m polling BIND statistics.
The error:
Error in unix-agent module. Call to undefined method App\Models\Device::pollingTarget()

#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException(‘pollingTarget’)

#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1618): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), ‘pollingTarget’, Array)

#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1630): Illuminate\Database\Eloquent\Model->__call(‘pollingTarget’, Array)

#3 /opt/librenms/includes/polling/unix-agent.inc.php(15): Illuminate\Database\Eloquent\Model::__callStatic(‘pollingTarget’, Array)

#4 /opt/librenms/includes/polling/functions.inc.php(315): include(’/opt/librenms/i…’)

#5 /opt/librenms/poller.php(174): poll_device(Array, false)

#6 {main}

code is up to date. no validation errors.

Any ideas ? TIA

1 Like

Error still there in 1.59-80-g07f3c91e6

Just tested… it’s on the librenms server that the error exists, because the unix-agent on the target responds on the telnet connection.

e.g.

telnet 6556

Trying …

Connected to

Escape character is ‘^]’.

<<<check_mk>>>

Version: 1.2.6b5

AgentOS: linux

AgentDirectory: /etc/check_mk

DataDirectory: /var/lib/check_mk_agent

SpoolDirectory: /var/lib/check_mk_agent/spool

PluginsDirectory: /usr/lib/check_mk_agent/plugins

LocalDirectory: /usr/lib/check_mk_agent/local

<<>>

<<>>

[df_inodes_start]

… etc… snip…

Can confirm. Issue persists. Stopped working for all my “apps” midnight of the 31st.

$ ./validate.php

Component Version
LibreNMS 1.59-83-g02bc15c20
DB Schema 2019_12_28_180000_add_overwrite_ip_to_devices (156)
PHP 7.2.24-0ubuntu0.18.04.2
MySQL 10.1.43-MariaDB-0ubuntu0.18.04.1
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.9.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Error in unix-agent module. Call to undefined method App\Models\Device::pollingTarget()
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException(‘pollingTarget’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1618): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), ‘pollingTarget’, Array)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1630): Illuminate\Database\Eloquent\Model->__call(‘pollingTarget’, Array)
#3 /opt/librenms/includes/polling/unix-agent.inc.php(15): Illuminate\Database\Eloquent\Model::__callStatic(‘pollingTarget’, Array)
#4 /opt/librenms/includes/polling/functions.inc.php(315): include(’/opt/librenms/i…’)
#5 /opt/librenms/poller.php(174): poll_device(Array, false)
#6 {main}

Thanks

Good idea, I forgot to include my validate.php data:
./validate.php

Component Version
LibreNMS 1.59-83-g02bc15c20
DB Schema 2019_12_28_180000_add_overwrite_ip_to_devices (156)
PHP 7.2.24-0ubuntu0.18.04.1
MySQL 5.7.28-0ubuntu0.18.04.4
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.9.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Just upgraded to 1.60. Same error stil there:

Component Version
LibreNMS 1.60
DB Schema 2019_12_28_180000_add_overwrite_ip_to_devices (156)
PHP 7.2.24-0ubuntu0.18.04.1
MySQL 5.7.28-0ubuntu0.18.04.4
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.9.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Tried to give composer access to online repo via a github token
(which is not stricly necessary) and saw:

php /opt/librenms/composer.phar outdated

GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/librenms/StringBladeCompiler/contents/composer.json?ref=. Create a GitHub OAuth token to go over the API rate limit. You can also wait until 2020-02-04 21:21:02 for the rate limit to reset.

Head to Sign in to GitHub · GitHub<some_numbers>

to retrieve a token. It will be stored in “/home/librenms/.composer/auth.json” for future use by Composer.

Token (hidden):

Token stored successfully.
amenadiel/jpgraph 3.6.21 4.0.3 jpGraph, library to make graphs and charts
darkghosthunter/larapoke v3.1.0 v4.0.0 Keep your forms alive, avoid TokenMismatchException by gently po…
dnoegel/php-xdg-base-dir 0.1 v0.1.1 implementation of xdg base directory specification for php
doctrine/cache 1.9.1 1.10.0 PHP Doctrine Cache library is a popular cache implementation tha…
doctrine/dbal v2.9.3 v2.10.1 Powerful PHP database abstraction layer (DBAL) with many feature…
doctrine/lexer 1.0.2 1.2.0 PHP Doctrine Lexer parser library that can be used in Top-Down, …
egulias/email-validator 2.1.11 2.1.15 A library for validating emails against several RFCs
erusev/parsedown 1.7.3 1.7.4 Parser for Markdown.
fideloper/proxy 4.2.1 4.2.2 Set trusted proxies for Laravel
guzzlehttp/guzzle 6.4.1 6.5.2 Guzzle is a PHP HTTP client library
laravel/framework v5.8.35 v6.14.0 The Laravel Framework.
laravel/laravel v5.8.35 v6.12.0 The Laravel Framework.
laravel/tinker v1.0.10 v2.1.0 Powerful REPL for the Laravel framework.
league/flysystem 1.0.57 1.0.63 Filesystem abstraction: Many filesystems, one API.
monolog/monolog 1.25.2 2.0.2 Sends your logs to files, sockets, inboxes, databases and variou…
nesbot/carbon 2.27.0 2.29.1 An API extension for DateTime that supports 281 different langua…
opis/closure 3.4.1 3.5.1 A library that can be used to serialize closures (anonymous func…
php-amqplib/php-amqplib v2.0.2 v2.11.0 This library is a pure PHP implementation of the AMQP protocol. …
phpmailer/phpmailer v6.1.3 v6.1.4 PHPMailer is a full-featured email creation and transfer class f…
phpoption/phpoption 1.5.2 1.7.2 Option Type for PHP
psy/psysh v0.9.9 v0.9.12 An interactive shell for modern PHP.
ramsey/uuid 3.8.0 3.9.2 Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 412…
spatie/laravel-cors 1.3.3 1.6.0 Send CORS headers in a Laravel or Lumen application
symfony/console v4.4.0 v5.0.4 Symfony Console Component
symfony/css-selector v4.4.0 v5.0.4 Symfony CssSelector Component
symfony/debug v4.4.0 v4.4.4 Symfony Debug Component
symfony/dotenv v3.4.35 v5.0.4 Registers environment variables from a .env file
symfony/error-handler v4.4.0 v5.0.4 Symfony ErrorHandler Component
symfony/event-dispatcher v4.4.0 v5.0.4 Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.7 v2.0.1 Generic abstractions related to dispatching event
symfony/finder v4.4.0 v5.0.4 Symfony Finder Component
symfony/http-foundation v4.4.0 v5.0.4 Symfony HttpFoundation Component
symfony/http-kernel v4.4.0 v5.0.4 Symfony HttpKernel Component
symfony/mime v4.4.0 v5.0.4 A library to manipulate MIME messages
symfony/polyfill-ctype v1.12.0 v1.13.1 Symfony polyfill for ctype functions
symfony/polyfill-iconv v1.12.0 v1.13.1 Symfony polyfill for the Iconv extension
symfony/polyfill-intl-idn v1.12.0 v1.13.1 Symfony polyfill for intl’s idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring v1.12.0 v1.13.1 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.12.0 v1.13.1 Symfony polyfill backporting some PHP 7.2+ features to lower PHP…
symfony/polyfill-php73 v1.12.0 v1.13.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP…
symfony/process v4.4.0 v5.0.4 Symfony Process Component
symfony/routing v4.4.0 v5.0.4 Symfony Routing Component
symfony/service-contracts v1.1.8 v2.0.1 Generic abstractions related to writing services
symfony/translation v4.4.0 v5.0.4 Symfony Translation Component
symfony/translation-contracts v1.1.7 v2.0.1 Generic abstractions related to translation
symfony/var-dumper v4.4.0 v5.0.4 Symfony mechanism for exploring and dumping PHP variables
symfony/yaml v4.4.0 v5.0.4 Symfony Yaml Component
tecnickcom/tcpdf 6.2.26 6.3.2 TCPDF is a PHP class for generating PDF documents and barcodes.
tightenco/ziggy v0.7.1 v0.8.1 Generates a Blade directive exporting all of your named Laravel …
vlucas/phpdotenv v3.6.0 v4.1.0 Loads environment variables from .env to getenv(), $_ENV a…
wpb/string-blade-compiler 3.8.x-dev b3e340b dev-master 1263244 Laravel Blade String Compiler, render string as blade templates

But a ./scripts/composer_wrapper.php install --no-dev

LibreNMS\ComposerHelper::preInstall

Loading composer repositories with package information

Installing dependencies from lock file

Nothing to install or update

Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump

@php artisan package:discover --ansi

Discovered Package: darkghosthunter/larapoke

Discovered Package: fideloper/proxy

Discovered Package: laravel/laravel

Discovered Package: laravel/tinker

Discovered Package: martinlindhe/laravel-vue-i18n-generator

Discovered Package: nesbot/carbon

Discovered Package: oriceon/toastr-5-laravel

Discovered Package: spatie/laravel-cors

Discovered Package: tightenco/ziggy

Package manifest generated successfully.

LibreNMS\ComposerHelper::postInstall

Illuminate\Foundation\ComposerScripts::postInstall

@php artisan vue-i18n:generate --multi-locales --format=umd

Doesn’t seem to update anything. Any other ideas ?
TIA

This is a bug in librenms. I submitted a PR that will fix it.

1 Like

in issue #11102 it says that the merge is blocked.
When does the code get available then ?

Juste updated code:
./validate.php

Component Version
LibreNMS 1.60-1-g4e18e8b5c
DB Schema 2019_12_28_180000_add_overwrite_ip_to_devices (156)
PHP 7.2.24-0ubuntu0.18.04.1
MySQL 5.7.28-0ubuntu0.18.04.4
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

But bug fix hasn’t made it yet into. Same error.

@zoeloe : The fix need to be reviewed, tested, approved and merged. This takes some time as LibreNMS is a community project. But it will happen in the next hours/days.

@PipoCanaja : I see, the review process is more complex than I expected.
Thanks for explaining this.
If it helps, I’ve modded manually the file with the fix, and I’m seeing values and graphs again.
my 2 cents worth.

Not necessary so complex, but I am currently at work, like the other team members, and we do it on spare time. So step 1 is to have spare time :smiley:

2 Likes

looks like it’s working. I changed it manually on my server this morning.

2 Likes