Error in log: Error discovering services module

Yes. I later found out that upgrading php didn’t actually cause librenms to fail, It’s actually a weathermap issue.

Current validate:

[librenms@librenms ~]$ ./validate.php

Component Version
LibreNMS 22.8.0-1-g465fa3986
DB Schema 2022_07_19_081224_plugins_unique_index (244)
PHP 8.1.9
Python 3.6.8
Database MariaDB 10.8.4-MariaDB
RRDTool 1.7.0
SNMP 5.8

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

[OK] Composer Version: 2.4.0
[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]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

1 Like

I can NOT confirm that the errors are gone with upgrading PHP:

Next Illuminate\Database\QueryException: SQLSTATE[HY093]: Invalid parameter number (SQL: select * from `devices` where `devices`.`device_id` not in (select `device_id` from `service_templates_device` where `service_template_id` = 1) and `devices`.`device_id` not in (select `device_id` from `device_group_device` where `device_group_id` = ?)) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\Database\Connection->select()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\Database\Query\Builder->runSelect()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\Database\Query\Builder->get()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\Database\Eloquent\Builder->getModels()
#8 /opt/librenms/app/Http/Controllers/ServiceTemplateController.php(324): Illuminate\Database\Eloquent\Builder->get()
#9 /opt/librenms/app/Http/Controllers/ServiceTemplateController.php(305): App\Http\Controllers\ServiceTemplateController->apply()
#10 /opt/librenms/includes/discovery/services.inc.php(7): App\Http\Controllers\ServiceTemplateController->applyAll()
#11 /opt/librenms/includes/discovery/functions.inc.php(153): include('...')
#12 /opt/librenms/discovery.php(118): discover_device()
#13 {main}

Still the same error. And still wondering why no one seems to be able to fix this.

1 Like

Side note: After removing everything within “Services Templates” (/services/templates) the mentioned error disappears. If I add a service template again, the error reoccurs reproducable.

I would say the services templates feature is unusable at the moment.

2 Likes

Headsup to prevent This topic will close 3 months after the last reply.

1 Like

I will try this myself to see if it happens to me as well. Thank you for suggesting this!

1 Like

I can confirm that this works for me as well. Thank you!

1 Like

You’re welcome :slight_smile:

But… my post wasn’t meant as a solution. It was meant as a hint for the developers to identify the source of the bug and finally get it fixed.

Next week this bug celebrates its “one year birthday” … not sure if funny.

1 Like

Oh I know…I just appreciate that you found the workaround and helped me clear out 80,000 excess entries in my event log.

2 Likes

Same problem here… lets keep it alive!

1 Like

I use service templates a lot and I’m getting the same error. Had to disable service discovery to get rid of the error :frowning_face:

I have the same issue:

Component Version
LibreNMS 23.1.0-24-gb0ac39e30 (2023-02-10T12:51:42-08:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.1.10
Python 3.6.8
Database MariaDB 10.3.35-MariaDB
RRDTool 1.7.0
SNMP 5.8
===========================================

When the service template is added it finds device that match the dynamic criteria but further discovery fails with the same error message.

1 Like

Same issue here. Registering for interest.

1 Like

Hello! I’ve submitted a PR to solve the issue…

PR #14939.

Please check if it also working for you!

1 Like

Thanks @eltiodex for your work on this :grinning:

The fix did work for me when I manually applied it but since upgrading to 23.5.0 it’s come back but with a different error :tired_face:

InvalidArgumentException: Nested arrays may not be passed to whereIn method. in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1082

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