[
https://issues.apache.org/jira/browse/METRON-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15399972#comment-15399972
]
Josh Meyer commented on METRON-324:
-----------------------------------
For me I was getting the above error when I had the incorrect version of
Vagrant (1.8.5 specifically). One difference is that my elasticsearch service
was running, and I could hit the health endpoint using CURL. I was however
still getting this exact error. If I switched the uri package that the ansible
was using to the shell package and used curl, it would work and then fail the
next time the uri package was used to hit elasticsearch. I fixed this by
downgrading Vagrant to the required version, 1.8.1.
> 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)