CESNET / pakiti-server

Pakiti provides a monitoring mechanism to check the patching status of Linux systems.
BSD 2-Clause "Simplified" License
49 stars 35 forks source link

Duplicate entry '***...***' for key 'name' on selinux clients #159

Open svamberg opened 5 years ago

svamberg commented 5 years ago

I have selinux clients. Only first client can create report, other failing with

# /usr/bin/pakiti-client --config /etc/pakiti-client.conf 
500 Internal Server Error at /usr/bin/pakiti-client line 399.

At server I see:

[/var/www/pakiti3/src/modules/feeder/FeederModule.php:107]: Report from [reporterHost=nic-new.zcu.cz, reporterIp=147.228.52.46, clientVersion=5]
[:]: Adding fake kernel 0:4.9.0-6-amd64 for nic-new.zcu.cz
[/var/www/pakiti3/src/managers/DbManager.php:154]: Exception
[:]: SQL query failed: Duplicate entry '***************************************************************' for key 'name'
"POST /feed/?protocol=5 HTTP/1.1" 500 4931

A problem is near detection of operating system, this is overview of first host:

HostGroup   N/A
Operating system    ***************************************************************
Architecture    x86_64
Kernel  4.9.0-6-amd64
Domain  zcu.cz
Reporter hostname   pandora-new.zcu.cz
Reporter IP 147.228.52.115
Installed packages  561
Cves    0
Cves with Tag   0
Last report received on 2019-02-18 23:41:51
Reports 2

The pakiti-client detect debian version from /etc/issue.net file - this is bad source for system identification. I have at /etc/issue and /etc/issue.net own message:

********************************************************************
*                                                                  *
* This system is for the use of authorized users only.  Usage of   *
* this system may be monitored and recorded by system personnel.   *
*                                                                  *
* Anyone using this system expressly consents to such monitoring   *
* and is advised that if such monitoring reveals possible          *
* evidence of criminal activity, system personnel may provide the  *
* evidence from such monitoring to law enforcement officials.      *
*                                                                  *
********************************************************************

Please use as source of release information /etc/os-release file.