Error polling unix-agent module packages

Hello, I need some help.
Since some time ago we have a error in the poller.php in the agent part.
This is error in the portal on a good number of machine.
Screenpoller.png

Data:
Validate.php: “ourvalidatephp - LibreNMS
Poller error: “poller error - LibreNMS
The erro data is from a ubuntu 20 but i get it in any linux os
The error is:

DEB Packages: 
SQL[select * from `packages` where `packages`.`device_id` = ? and `packages`.`device_id` is not null [245] 2.27ms] 
  
Error polling unix-agent module for 10.X.X.X. PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'arch' cannot be null in /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
RPM Packages:  
SQL[select * from `packages` where `packages`.`device_id` = ? and `packages`.`device_id` is not null [46] 1.74ms]  

Error polling unix-agent module for 10.100.50.81. PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'46-gpg-pubkey-rpm-(none)-352c64e5-52ae6884' for key 'packages_device_id_name_manager_arch_version_build_unique' in /opt/librenms/ve
ndor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

Workaround:
To completely remove the error from a machine, we have deleted the machine and made sure to delete all files associated with it.
Then when adding, the error disappears for the time being.

I have already found the problem and applied the correct solution.
The SQL error problem was related to how we deployed librenms-agent to the machines.
We have created a solution in saltstack that deploys the agent by cloning the entire repository and copying it to the corresponding folders. And this is the problem, when copying all the scripts locally, all of them are executed and in this case the script “rocks.sh” if it is not correctly configured, it is at the end of the agent execution check_mk_agent 4 0 and does not mark its separator.

Example with rock.sh

xinetd 1:2.3.14-7.1+deb7u1 amd64 315
xkb-data 2.5.1-3 all 5403
xml-core 0.13+nmu2 all 188
xorg-sgml-doctools 1:1.10-1 all 109
xtrans-dev 1.2.7-1 all 369
xz-utils 5.1.1alpha+20120614-2 amd64 472
zerofree 1.0.2-1 amd64 14
zlib1g 1:1.2.7.dfsg-13 amd64 162
zlib1g-dev 1:1.2.7.dfsg-13 amd64 422
0
0
0
0

This 0 generates the error in poller.php

[2022-05-16T12:10:59.031085+02:00] production.ERROR: Error polling unix-agent module for 10.100.50.175. PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'arch' cannot be null in /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

One error per 0

Solution

Remove or change right to the /local/ script we need.

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