Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #8724] Missing config validator for command arguments 'set_if' #2749

Closed
icinga-migration opened this issue Mar 12, 2015 · 3 comments
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8724

Created by KeX on 2015-03-12 15:13:09 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2015-03-20 15:17:00 +00:00)
Target Version: 2.3.3
Last Update: 2015-03-20 15:17:00 +00:00 (in Redmine)

Icinga Version: 2.3.1
Backport?: Already backported
Include in Changelog: 1

Hi,

I've just found a 'Bug' in Icinga2.
Wen you define a command like this and forget a $ at the end of the variable:

object CheckCommand "command" {
  import "plugin-check-command",
        command = [ PluginDir + "/check_command" ]
        arguments = {
                "-f" = {
                        set_if = "$command_arg"
                        description = "Check argument"
                }
        }
}

The exception is directly thrown to the log and icingaweg2:

[2015-03-12 16:08:26 +0100] critical/checker: Exception occured while checking 'test.local!command': Error: Closing $ not found in macro format string.
        (0) libicinga.so:  (+0x1538c7) [0x2ada3cb908c7]
        (1) libicinga.so:  (+0x15f980) [0x2ada3cb9c980]
        (2) libicinga.so: icinga::MacroProcessor::InternalResolveMacros(icinga::String const&, std::vector >, std::allocator > > > const&, boost]
        (3) libicinga.so: icinga::MacroProcessor::ResolveMacros(icinga::Value const&, std::vector >, std::allocator > > > const&, boost::intrusi]
        (4) libicinga.so: icinga::PluginUtility::ExecuteCommand(boost::intrusive_ptr const&, boost::intrusive_ptr const&, boost::intrusive_ptr const&, std::vector const&, boost::intrusive_ptr const&, boost::intrusive_ptr const&, bool) (+0x434) [0x2ada3d285006]
        (6) libmethods.so: icinga::Value icinga::FunctionWrapperV const&, boost::intrusive_ptr const&, boost::intrusive_ptr const&, bool>(void (*)(boost::intrusive_ptr co]
        (7) libmethods.so:  (+0xebc7) [0x2ada3d273bc7]
        (8) libmethods.so:  (+0x105f1) [0x2ada3d2755f1]
        (9) libmethods.so: boost::detail::function::function_obj_invoker1 const&, boost::intrusive_ptr const&, boost::intrusive_ptr (+0xf2694) [0x2ada268ee694]
        (11) libbase.so: icinga::Function::Invoke(std::vector > const&) (+0x2f) [0x2ada2691c251]
        (12) libicinga.so: icinga::CheckCommand::Execute(boost::intrusive_ptr const&, boost::intrusive_ptr const&, boost::intrusive_ptr const&, bool) (+0x16a) [0x2ada3cc23afa]
        (13) libicinga.so: icinga::Checkable::ExecuteCheck() (+0x420) [0x2ada3cbbb6dc]
        (14) libchecker.so: icinga::CheckerComponent::ExecuteCheckHelper(boost::intrusive_ptr const&) (+0x33) [0x2ada3d01814d]
        (15) libchecker.so:  (+0x225eb) [0x2ada3cfeb5eb]
        (16) libchecker.so:  (+0x27d6e) [0x2ada3cff0d6e]
        (17) libchecker.so:  (+0x30b5b) [0x2ada3cff9b5b]
        (18) libchecker.so:  (+0x36e9b) [0x2ada3cfffe9b]
        (19) libchecker.so: boost::detail::function::void_function_obj_invoker0 const&>, boost::_bi::list2 (+0xe3c66) [0x2ada268dfc66]
        (21) libbase.so: icinga::ThreadPool::WorkerThread::ThreadProc(icinga::ThreadPool::Queue&) (+0x2c9) [0x2ada269058bd]
        (22) libbase.so:  (+0x55cf6) [0x2ada26851cf6]
        (23) libbase.so:  (+0x5593d) [0x2ada2685193d]
        (24) libbase.so:  (+0x5369d) [0x2ada2684f69d]
        (25) libbase.so:  (+0x50128) [0x2ada2684c128]
        (26) libboost_thread.so.1.54.0:  (+0xba4a) [0x2ada2617fa4a]
        (27) libpthread.so.0:  (+0x8182) [0x2ada2794a182]
        (28) libc.so.6: clone (+0x6d) [0x2ada25ea947d]

The config validator doen't find this config error.

Changesets

2015-03-20 15:12:24 +00:00 by (unknown) e1cb543

Fix missing config validator for command arguments 'set_if'

fixes #8724

2015-03-20 15:15:22 +00:00 by (unknown) 7c07496

Fix missing config validator for command arguments 'set_if'

fixes #8724
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-12 16:52:34 +00:00

  • Subject changed from Exception caused by config error in command definition is directly thrown to log/icingaweb2 to Missing config validator for command arguments 'set_if'
  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Target Version set to 2.4.0
  • Estimated Hours set to 2
  • Backport? changed from TBD to Yes

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-20 15:13:49 +00:00

  • Target Version changed from 2.4.0 to 2.3.3

@icinga-migration
Copy link
Author

Updated by Anonymous on 2015-03-20 15:17:00 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset e1cb543.

@icinga-migration icinga-migration added bug Something isn't working area/configuration DSL, parser, compiler, error handling labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.3.3 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant