{"action":"created","issue":{"url":"https://api.github.com/repos/ossec/ossec-hids/issues/703","labels_url":"https://api.github.com/repos/ossec/ossec-hids/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/ossec/ossec-hids/issues/703/comments","events_url":"https://api.github.com/repos/ossec/ossec-hids/issues/703/events","html_url":"https://github.com/ossec/ossec-hids/pull/703","id":120086368,"number":703,"title":"Agent installation. XML Error.","user":{"login":"snaow","id":1519428,"avatar_url":"https://avatars.githubusercontent.com/u/1519428?v=3","gravatar_id":"","url":"https://api.github.com/users/snaow","html_url":"https://github.com/snaow","followers_url":"https://api.github.com/users/snaow/followers","following_url":"https://api.github.com/users/snaow/following{/other_user}","gists_url":"https://api.github.com/users/snaow/gists{/gist_id}","starred_url":"https://api.github.com/users/snaow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snaow/subscriptions","organizations_url":"https://api.github.com/users/snaow/orgs","repos_url":"https://api.github.com/users/snaow/repos","events_url":"https://api.github.com/users/snaow/events{/privacy}","received_events_url":"https://api.github.com/users/snaow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T03:18:37Z","updated_at":"2015-12-07T13:25:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ossec/ossec-hids/pulls/703","html_url":"https://github.com/ossec/ossec-hids/pull/703","diff_url":"https://github.com/ossec/ossec-hids/pull/703.diff","patch_url":"https://github.com/ossec/ossec-hids/pull/703.patch"},"body":"Reverting commit: https://github.com/ossec/ossec-hids/commit/3dad0daecd2bddca5e256b3ad85a4d5f54d66f02\r\n\r\nAgent installation fails throwing the following error:\r\n\r\n`` ossec-logcollector(1226): ERROR: Error reading XML file '/var/ossec/etc/shared/agent.conf': XMLERR: File '/var/ossec/etc/shared/agent.conf' not found. (line 94).\r\n``\r\n`` \r\nossec-syscheckd(1226): ERROR: Error reading XML file '/var/ossec/etc/shared/agent.conf': XMLERR: File '/var/ossec/etc/shared/agent.conf' not found. (line 94).\r\n``\r\n`` \r\nossec-syscheckd(1226): ERROR: Error reading XML file '/var/ossec/etc/shared/agent.conf': XMLERR: File '/var/ossec/etc/shared/agent.conf' not found. (line 94).``\r\n`` \r\n**agent.conf** is not present at initial agent installation that's why we need to prevent the **merror**.\r\n\r\nIf you are interested, the full trace would be:\r\n- At src/rootcheck/config.c, src/logcollector/config.c and src/syscheckd/config.c **ReadConfig** function is called.\r\n```\r\nReadConfig(modules, AGENTCONFIG, &syscheck, NULL);\r\nReadConfig(modules, AGENTCONFIG, &log_config, NULL);\r\nReadConfig(modules, AGENTCONFIG, &rootcheck, NULL);\r\n```\r\n- At src/config/config.c, inside ReadConfig, **OS_ReadXML** function is called\r\n\r\n```\r\nOS_ReadXML(cfgfile, &xml)\r\n```\r\n\r\nSo ``cfgfile`` is ``AGENTCONFIG`` which value is *\"shared/agent.conf*, the result is OS_ReadXML can't open the file and always stop agent initialization.\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ossec/ossec-hids/issues/comments/162523244","html_url":"https://github.com/ossec/ossec-hids/pull/703#issuecomment-162523244","issue_url":"https://api.github.com/repos/ossec/ossec-hids/issues/703","id":162523244,"user":{"login":"ddpbsd","id":4983989,"avatar_url":"https://avatars.githubusercontent.com/u/4983989?v=3","gravatar_id":"","url":"https://api.github.com/users/ddpbsd","html_url":"https://github.com/ddpbsd","followers_url":"https://api.github.com/users/ddpbsd/followers","following_url":"https://api.github.com/users/ddpbsd/following{/other_user}","gists_url":"https://api.github.com/users/ddpbsd/gists{/gist_id}","starred_url":"https://api.github.com/users/ddpbsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddpbsd/subscriptions","organizations_url":"https://api.github.com/users/ddpbsd/orgs","repos_url":"https://api.github.com/users/ddpbsd/repos","events_url":"https://api.github.com/users/ddpbsd/events{/privacy}","received_events_url":"https://api.github.com/users/ddpbsd/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T13:25:50Z","updated_at":"2015-12-07T13:25:50Z","body":"I haven't seen it stop an agent from starting, is that what's happening to you?"}}