AssertException raised in handle_options

Issue #965 resolved
Lutz Mader created an issue

Hello Tildeslash,
if monit can not access the "monitrc" file an exception will be thrown.

With monit 5.27.2 or

$ monit -Ic /usr/local/etc/monitrc
AssertException: The control file '/usr/local/etc/monitrc' is not a file
 raised in handle_options at src/monit.c:663
$ monit -Ic /usr/local/etc/monitrc
AssertException: The control file '/usr/local/etc/monitrc' is not readable
 raised in handle_options at src/monit.c:665

monit 5.28.0

$ monit -Ic /usr/local/etc/monitrc
AssertException: The control file '/usr/local/etc/monitrc' is not a file
 raised in handle_options at src/monit.c:687
$ monit -Ic /usr/local/etc/monitrc
AssertException: The control file '/usr/local/etc/monitrc' is not readable
 raised in handle_options at src/monit.c:689

This is not a problem, but does not look very nice, a proper error message should be used therefore, I think.

With regards,
Lutz

p.s.
Nice to know, without a given "monitrc" file no exception will thrown.

$ monit summary
Cannot open the control file '/usr/local/etc/monitrc' -- Permission denied
$
$ monit -c /usr/local/etc/monitrc summary
AssertException: The control file '/usr/local/etc/monitrc' is not readable
 raised in handle_options at src/monit.c:689
$ 

Comments (5)

  1. Tildeslash repo owner

    Fixed Issue #965: If you run monit CLI with custom configuration file, via the -c option, and the file cannot be read by monit, AssertException was thrown. Monit will report normal error instead of the exception now.

    → <<cset 6792304b6763>>

  2. Log in to comment