Host and service discovery error no closing quotation

Hi,

I have a new issue when I try to inventorise a host over WATO and then Save & go to service configuration I got the following error. It happens randomly, WATO service discovery for other hosts monitored by the same slave works. Any idea?

Got invalid data:
Internal automation error: Error running automation call try-inventory (exit code 2), error: 
No closing quotation

Traceback (most recent call last):
  File "/omd/sites/slave1/lib/python3/cmk/gui/wato/pages/automation.py", line 168, in _execute_automation_command
    html.write(repr(automation.execute(automation.get_request())))
  File "/omd/sites/slave1/lib/python3/cmk/gui/wato/pages/services.py", line 193, in execute
    return repr(execute_discovery_job(request)._asdict())
  File "/omd/sites/slave1/lib/python3/cmk/gui/watolib/services.py", line 480, in execute_discovery_job
    r = job.get_result(request)
  File "/omd/sites/slave1/lib/python3/cmk/gui/watolib/services.py", line 650, in get_result
    check_table_created, result = self._get_try_discovery(request)
  File "/omd/sites/slave1/lib/python3/cmk/gui/watolib/services.py", line 671, in _get_try_discovery
    check_mk_automation(
  File "/omd/sites/slave1/lib/python3/cmk/gui/watolib/automations.py", line 68, in check_mk_automation
    return check_mk_local_automation(command, args, indata, stdin_data, timeout)
  File "/omd/sites/slave1/lib/python3/cmk/gui/watolib/automations.py", line 143, in check_mk_local_automation
    raise _local_automation_failure(command=command,
cmk.utils.exceptions.MKGeneralException: Error running automation call try-inventory (exit code 2), error: 
No closing quotation

This looks to be related with the new agent 2.0.0p1, after downgrading to 1.6.0p22-1 it works again. This could be a bug

Then it would be good if you can test the service discovery from the command line.
Automation errors most times are only the result of another error or problem.

cmk --debug -vvII hostname

Hi Andreas, there you go:

$ cmk --debug -vvII DEN.virt1a
Discovering services and host labels on: DEN.virt1a
DEN.virt1a:
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.TCP
[cpu_tracking] Start [7efffb2f6070]
Connecting via TCP to 192.168.217.101:6556 (5.0s timeout)
[TCPFetcher] Fetch with cache settings: DefaultAgentFileCache(path=PosixPath('/omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a'), max_age=0, disabled=False, use_outdated=False, simulation=False), Cache enabled: True
Not using cache (Too old. Age is 118 sec, allowed is 0 sec)
[TCPFetcher] Execute data source
Reading data from agent
Output is not encrypted
Write data to cache file /omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a
Try aquire lock on /omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a
Got lock on /omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a
Releasing lock on /omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a
Released lock on /omd/sites/slave1/tmp/check_mk/cache/DEN.virt1a
Closing TCP connection to 192.168.217.101:6556
[cpu_tracking] Stop [7efffb2f6070 - Snapshot(process=posix.times_result(user=0.010000000000000009, system=0.0, children_user=0.0, children_system=0.0, elapsed=31.66000000014901))]
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7efffb2f6640]
No piggyback files for 'DEN.virt1a'. Skip processing.
No piggyback files for '192.168.217.101'. Skip processing.
[PiggybackFetcher] Fetch with cache settings: NoCache(path=PosixPath('/omd/sites/slave1/tmp/check_mk/data_source_cache/piggyback/DEN.virt1a'), max_age=0, disabled=False, use_outdated=False, simulation=False), Cache enabled: True
[PiggybackFetcher] Execute data source
[cpu_tracking] Stop [7efffb2f6640 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.TCP
Loading autochecks from /omd/sites/slave1/var/check_mk/autochecks/DEN.virt1a.mk
No persisted sections loaded
  -> Add sections: ['check_mk', 'cifsmounts', 'cpu', 'df', 'diskstat', 'drbd', 'ipmi', 'ipmi_discrete', 'job', 'kernel', 'lnx_bonding', 'lnx_if', 'lnx_thermal', 'local', 'lvm_lvs', 'lvm_vgs', 'md', 'mem', 'mounts', 'mrpe', 'nfsmounts', 'postfix_mailq', 'postfix_mailq_status', 'ps_lnx', 'systemd_units', 'tcp_conn_stats', 'uptime', 'vbox_guest']
  Source: SourceType.HOST/FetcherType.PIGGYBACK
No persisted sections loaded
  -> Add sections: []
Received no piggyback data
+ EXECUTING HOST LABEL DISCOVERY
Try aquire lock on /omd/sites/slave1/var/check_mk/crashes/base/9c50e2a4-98fb-11eb-b28b-02ff01d93908/crash.info
Got lock on /omd/sites/slave1/var/check_mk/crashes/base/9c50e2a4-98fb-11eb-b28b-02ff01d93908/crash.info
Releasing lock on /omd/sites/slave1/var/check_mk/crashes/base/9c50e2a4-98fb-11eb-b28b-02ff01d93908/crash.info
Released lock on /omd/sites/slave1/var/check_mk/crashes/base/9c50e2a4-98fb-11eb-b28b-02ff01d93908/crash.info
Traceback (most recent call last):
  File "/omd/sites/slave1/bin/cmk", line 92, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
  File "/omd/sites/slave1/lib/python3/cmk/base/modes/__init__.py", line 69, in call
    return handler(*handler_args)
  File "/omd/sites/slave1/lib/python3/cmk/base/modes/check_mk.py", line 1531, in mode_discover
    discovery.do_discovery(
  File "/omd/sites/slave1/lib/python3/cmk/base/discovery.py", line 378, in do_discovery
    _do_discovery_for(
  File "/omd/sites/slave1/lib/python3/cmk/base/discovery.py", line 435, in _do_discovery_for
    discovered_services, host_label_discovery_result = _discover_host_labels_and_services(
  File "/omd/sites/slave1/lib/python3/cmk/base/discovery.py", line 1398, in _discover_host_labels_and_services
    discovered_host_labels = _discover_host_labels(
  File "/omd/sites/slave1/lib/python3/cmk/base/discovery.py", line 1217, in _discover_host_labels
    discovered_host_labels = _discover_host_labels_for_source_type(
  File "/omd/sites/slave1/lib/python3/cmk/base/discovery.py", line 1250, in _discover_host_labels_for_source_type
    applicable_sections = multi_host_sections.determine_applicable_sections(
  File "/omd/sites/slave1/lib/python3/cmk/base/checkers/host_sections.py", line 353, in determine_applicable_sections
    parsed = self._get_parsing_result(host_key, section)
  File "/omd/sites/slave1/lib/python3/cmk/base/checkers/host_sections.py", line 385, in _get_parsing_result
    return self._parsing_results.setdefault(cache_key, section.parse_function(data))
  File "/omd/sites/slave1/lib/python3/cmk/base/plugins/agent_based/local.py", line 165, in parse_local
    stripped_line = [six.ensure_text(s) for s in shlex.split(six.ensure_str(line[0]))]
  File "/omd/sites/slave1/lib/python3.8/shlex.py", line 311, in split
    return list(lex)
  File "/omd/sites/slave1/lib/python3.8/shlex.py", line 300, in __next__
    token = self.get_token()
  File "/omd/sites/slave1/lib/python3.8/shlex.py", line 109, in get_token
    raw = self.read_token()
  File "/omd/sites/slave1/lib/python3.8/shlex.py", line 191, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation

It looks like a problem with the “local” section of your agent output.
Can you check this or remove the local checks from this machine for a test.

indeed Andreas, now it works. Now I need to know which local check is causing this mess.

Thank you very much

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.