it-novum / openITCOCKPIT

openITCOCKPIT is an Open Source system monitoring tool built for different monitoring engines like Nagios, Naemon and Prometheus.
https://openitcockpit.io/
GNU General Public License v3.0
263 stars 50 forks source link

Satellite - Mod_gearman problem #1682

Open kbilev opened 3 months ago

kbilev commented 3 months ago

Describe the bug On Satellite systems with version 4.8.0 (RHEL and Ubuntu) the keyfile /opt/openitc/etc/mod_gearman/secret.file is missing. In the log file /opt/openitc/logs/mod_gearman/mod_gearman_worker.log we see that the mod-gearman-worker-go is doing a panic and restarts all the time.

[Error][logger.go:72] *************************
[Info][mod_gearman_worker.go:134] mod-gearman-worker-go shutdown complete
[Error][logger.go:68] ********* PANIC *********
[Error][logger.go:69] Panic: could not open keyfile
[Error][logger.go:70] **** Stack:
[Error][logger.go:71] goroutine 1 [running]:

Versions

Additional context mod-gearman-worker-go starts successfull after:

mkdir /opt/openitc/etc/mod_gearman
chmod o+rx /opt/openitc/etc/mod_gearman
echo "0c013ab34d3de983fd12e69f2895995b7" > /opt/openitc/etc/mod_gearman/secret.file
chown nagios:nagios /opt/openitc/etc/mod_gearman/secret.file
chmod u-w /opt/openitc/etc/mod_gearman/secret.file
chmod go-r /opt/openitc/etc/mod_gearman/secret.file
nook24 commented 2 weeks ago

Unfortunately I was not able to reproduce the issue on my end.

In case some one else is having the same issue, it can be resolved by execution this commands as root user.

MG_KEY=$(php -r "echo bin2hex(openssl_random_pseudo_bytes(16, \$cstrong));")
echo $MG_KEY > /opt/openitc/etc/mod_gearman/secret.file

chown nagios:nagios /opt/openitc/etc/mod_gearman/secret.file
chmod 400 /opt/openitc/etc/mod_gearman/secret.file

systemctl status mod-gearman-worker.service
kbilev commented 2 weeks ago

Hi, The workaround has a missing step. the /opt/openitc/etc/mod_gearman/ folder must be created before the secret.file is created. But I think that there is another problem with the mod-gearman-workers on the satellites. maybe we could check via Discord or Teams?

nook24 commented 2 weeks ago

Turns out there are some missing/outdated files in the latest stable build of the Satellite packages. The issue had already been fixed in the current nightly builds and will also be fixed in the next stable release scheduled for 26.08.2024.