Branch: refs/heads/2.1.0
Home:
https://github.com/tribe29/checkmk
Commit: 568695fd89aafe931633143854123b1e7cf33dfb
https://github.com/tribe29/checkmk/commit/568695fd89aafe931633143854123b1e7…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-07-19 (Tue, 19 Jul 2022)
Changed paths:
M cmk/base/notify.py
Log Message:
-----------
Notify helper: Improve handling of corrupt spool files
* Improve logging of unhandled exception
* Fix traceback in notify.log in case of corrupt files
* Do not read files that are currently being written
(empty file created for locking during create_spoolfile())
Change-Id: I3927c929bd87fb6e32c996c43ac1362b1709e862
Commit: 6ea5cc1670338289340c601ecf8968f1185df153
https://github.com/tribe29/checkmk/commit/6ea5cc1670338289340c601ecf8968f11…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2022-07-19 (Tue, 19 Jul 2022)
Changed paths:
A .werks/14284
M cmk/base/notify.py
M cmk/utils/notify.py
Log Message:
-----------
14284 FIX Notification spooler: Fix producing corrupted spool files
The Notification Spooler could create corrupted spool files which resulted in
error messages like this in the <tt>var/log/mknotifyd.log</tt> log:
C+:
2022-07-18 21:49:14,276 [40] [cmk.mknotifyd] Corrupted spoolfile
/omd/sites/stable/var/check_mk/notify/spool/ccaae1d5-8b33-403c-bbd8-e1b8796035ca:
Traceback (most recent call last):
File "/omd/sites/stable/lib/python3/cmk/cee/mknotifyd/spool_handler.py", line
70, in _process_spool_directory
content: Message = evaluate_file(spoolfile_path)
File "/omd/sites/stable/lib/python3/cmk/cee/mknotifyd/utils.py", line 50, in
evaluate_file
return ast.literal_eval(f.read())
File "/omd/sites/stable/lib/python3.9/ast.py", line 62, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/omd/sites/stable/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 0
SyntaxError: unexpected EOF while parsing
2022-07-18 21:49:14,728 [20] [cmk.mknotifyd] got exit code 2
2022-07-18 21:49:14,728 [40] [cmk.mknotifyd] exception handling notification result 2 for
82bcd0e5-5d28-4162-9f46-84d008e1d73d:
Traceback (most recent call last):
File "/omd/sites/stable/lib/python3/cmk/cee/mknotifyd/notification_queue.py",
line 129, in _handle_result
content = evaluate_file(path.joinpath(filename))
File "/omd/sites/stable/lib/python3/cmk/cee/mknotifyd/utils.py", line 50, in
evaluate_file
return ast.literal_eval(f.read())
File "/omd/sites/stable/lib/python3.9/ast.py", line 62, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/omd/sites/stable/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 0
SyntaxError: unexpected EOF while parsing
C-:
The <tt>var/log/notify.log</tt> could also show errors in this situation, with
messages like this:
C+:
2022-07-18 20:40:55,960 [40] [cmk.base.notify] ERROR:
Traceback (most recent call last):
File "/omd/sites/stable/lib/python3/cmk/base/notify.py", line 1765, in
handle_spoolfile
raw_context = data["context"]
KeyError: 'context'
C-:
Change-Id: I8239d1c1e449b8250a9d3eba31ac3cea756e071c
Compare:
https://github.com/tribe29/checkmk/compare/7f30b856f184...6ea5cc167033