Closed dhoffend closed 7 years ago
Hi @dhoffend, basically it should not be possible, that there are broken records in the gearman queue without a third party application consuming the same queues.
But at the moment im working on your last PR :D
Here's the example (log) for the first fix:
Mar 23 10:06:22 xxxx statusengine: notice: Notice (8): Trying to get property of non-object in [/srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 1496]
Mar 23 10:06:22 xxxx statusengine: notice: Trace:
Mar 23 10:06:22 xxxx statusengine: notice: StatusengineLegacyShell::processServicechecks() - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 1496
Mar 23 10:06:22 xxxx statusengine: notice: GearmanWorker::work() - [internal], line ??
Mar 23 10:06:22 xxxx statusengine: notice: StatusengineLegacyShell::childWork() - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 2869
Mar 23 10:06:22 xxxx statusengine: notice: StatusengineLegacyShell::waitForInstructions() - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 2846
Mar 23 10:06:22 xxxx statusengine: notice: StatusengineLegacyShell::forkWorker() - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 2728
Mar 23 10:06:22 xxxx statusengine: notice: StatusengineLegacyShell::main() - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/Command/StatusengineLegacyShell.php, line 234
Mar 23 10:06:22 xxxx statusengine: notice: Shell::runCommand() - CORE/Cake/Console/Shell.php, line 461
Mar 23 10:06:22 xxxx statusengine: notice: ShellDispatcher::dispatch() - CORE/Cake/Console/ShellDispatcher.php, line 212
Mar 23 10:06:22 xxxx statusengine: notice: ShellDispatcher::run() - CORE/Cake/Console/ShellDispatcher.php, line 66
Mar 23 10:06:22 xxxx statusengine: notice: [main] - /srv/drbd/statusengine-2.0.5/cakephp/app/Console/cake.php, line 47
The line "StatusengineLegacyShell.php, line 1496" referes to the initial bulk version https://github.com/nook24/statusengine/blob/ba13e66fa7565a2b969cd273df2f5512c2f4883d/cakephp/app/Console/Command/StatusengineLegacyShell.php#L1496
In the meantime i've locally fixed it but there's no external process pushing stuff into the servicestatus queue ... Maybe it could be a bad json formatted object. The json_decode() fails resulting in an empty payload variable. I guess additionally we should check for json parsing errors http://php.net/manual/de/function.json-last-error.php and log them. Maybe the naemon objects contains invalid characters or has syntax problems. If we log the invalid object we could easily debug them.
I've updated the pull request completly.
Fixed an issue where invalid/empty data in the gearman queues throws errors/exceptions in the workers process jobs.