[
https://issues.apache.org/jira/browse/METRON-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15377046#comment-15377046
]
Nick Allen commented on METRON-324:
-----------------------------------
Very interesting. I think you are right Neha. The only thing I don't
understand is under what conditions will the 'result' object by None. I'd like
to understand if this is expected behavior from Ansible or is this a bug in
Ansible itself. The answer might change how we choose to fix this bug.
> Deployment fails ambiguously when elasticsearch is down
> -------------------------------------------------------
>
> Key: METRON-324
> URL: https://issues.apache.org/jira/browse/METRON-324
> Project: Metron
> Issue Type: Bug
> Affects Versions: 0.2.1BETA
> Reporter: Neha Sinha
> Priority: Minor
>
> In some of the deployments where elasticsearch service goes down for no
> reason during execution, the error that user is presented with is :-
> fatal: [node1]: FAILED! => {"failed": true, "msg": "ERROR! The conditional
> check 'result.content.find(\"green\") != -1 or
> result.content.find(\"yellow\") != -1' failed. The error was: ERROR! error
> while evaluating conditional (result.content.find(\"green\") != -1 or
> result.content.find(\"yellow\") != -1): ERROR! 'dict object' has no attribute
> 'content'"}
> This is ambiguous error as the user is not sure if it's an issue with the
> ansible version or the service/product deployment itself.
> The task "Wait for Index to Become Available" in load_templates.yml reads
> like this :-
> ==========================================================
> - name: Wait for Index to Become Available
> uri:
> url: "http://{{ inventory_hostname }}:{{ elasticsearch_web_port
> }}/_cat/health"
> method: GET
> status_code: 200
> return_content: yes
> register: result
> until: result.content.find("green") != -1 or result.content.find("yellow")
> != -1
> retries: 10
> delay: 60
> ===========================================================
> We should validate foe variable "result" not being null/empty before
> executing the "until" block which specifically looks up the field
> result.content.
> Also additional check should be made that elasticservice is not down while
> the task is being executed.
> Regards,
> Neha
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)