Skip to content

Fix bugs in upgrade agents#784

Merged
jesuslinares merged 7 commits into3.3from
fix-upgrade-agents
Jun 14, 2018
Merged

Fix bugs in upgrade agents#784
jesuslinares merged 7 commits into3.3from
fix-upgrade-agents

Conversation

@Lifka
Copy link
Copy Markdown
Contributor

@Lifka Lifka commented Jun 13, 2018

Hi team,

this PR fixes the following error trying to upgrade never connected agents:

$ curl -u foo:bar -X PUT -k "http://127.0.0.1:55000/agents/003/upgrade?pretty"
{
   "error": 1000,
   "message": "Wazuh-Python Internal Error: 'NoneType' object has no attribute 'split'"
}

Now:

$ curl -u foo:bar -X PUT -k "http://127.0.0.1:55000/agents/003/upgrade?pretty"
{
   "error": 1720,
   "message": "Agent disconnected."
}

There are also several sockets that never close:

https://github.com/wazuh/wazuh/blob/55ba4d755a124d09557b77f8c41eae870a3e365d/framework/wazuh/agent.py#L2195-L2202

This PR fixes them.

Update:

This PR also fixes this issue: wazuh/wazuh-api#103. This ocurred because in some traces messages are printed outside the debug mode, therefore the API receives a message that it can not interpret.

Regards!

@Lifka Lifka added type/bug Something isn't working module/framework labels Jun 13, 2018
@Lifka Lifka requested a review from mgmacias95 June 13, 2018 10:54
@Lifka Lifka changed the title Fix bugs in update agents Fix bugs in upgrade agents Jun 13, 2018
Comment thread framework/wazuh/agent.py Outdated
'version': 'version', 'manager_host': 'manager_host', 'dateAdd': 'date_add',
'group': '`group`', 'mergedSum': 'merged_sum', 'configSum': 'config_sum',
'os.codename': 'os_codename', 'os.major': 'os_major', 'os.uname': 'os_uname',
'os.codename': 'os_codename', 'os.major': 'os_major', 'os.minor': 'os_minor', 'os.uname': 'os_uname',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has already been added in #771.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/framework type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants