Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ERROR 400 from Ambari while setting up Cluster with Ansible-Hortonworks (host_groups missing in cluster_creation body)

ERROR 400 from Ambari while setting up Cluster with Ansible-Hortonworks (host_groups missing in cluster_creation body)

New Contributor

Hello Community,

i have a slight problem creating a Hadoop Cluster from by using ansible-hortonworks ansible scripts. I use the feature creating it with dynamic blueprint.
When i am through the checks and prequisites the Ambari API tells me that my request body aka. cluster_creation body has no "host_groups" content.

Can you tell how do I get the content of this "/tmp/cluster_template" or how do i fix this error ?

Error message:

fatal: [master03]: FAILED! => {
    "cache_control": "no-store", 
    "changed": false, 
    "connection": "close", 
    "content": "{\n  \"status\" : 400,\n  \"message\" : \"Invalid Cluster Creation Template: org.apache.ambari.server.topology.InvalidTopologyTemplateException: 'host_groups' element must be included in cluster create body\"\n}", 
    "content_type": "text/plain", 
    "expires": "Thu, 01 Jan 1970 00:00:00 GMT", 
    "invocation": {
        "module_args": {
            "attributes": null, 
            "backup": null, 
            "body": " {\n  \"blueprint\" : \"cxadev_blueprint\",\n  \"config_recommendation_strategy\" : \"NEVER_APPLY\",\n  \"repository_version_id\": \"1\",\n  \"default_password\" : \"PASSWORD\",\n  \"credentials\" : [\n    {\n      \"alias\" : \"kdc.********.credential\",\n      \"principal\" : \"PRINCIPAL\",\n      \"key\" : \"Zt7W4YUs11QBXyeyx649\",\n      \"type\" : \"TEMPORARY\"\n    }\n  ],\n  \"security\" : {\n    \"type\" : \"KERBEROS\"\n  },\n  \"host_groups\" :[\n    \n  ]\n}\n", 
            "body_format": "raw", 
            "client_cert": null, 
            "client_key": null, 
            "content": null, 
            "creates": null, 
            "delimiter": null, 
            "dest": null, 
            "directory_mode": null, 
            "follow": false, 
            "follow_redirects": "safe", 
            "force": false, 
            "force_basic_auth": true, 
            "group": null, 
            "headers": {
                "Authorization": "Basic YWRtaW46YWRtaW4=", 
                "X-Requested-By": "ambari"
            }, 
            "http_agent": "ansible-httpget", 
            "method": "POST", 
            "mode": null, 
            "owner": null, 
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "regexp": null, 
            "remote_src": null, 
            "removes": null, 
            "return_content": true, 
            "selevel": null, 
            "serole": null, 
            "setype": null, 
            "seuser": null, 
            "src": null, 
            "status_code": [
                "200", 
                "201", 
                "202"
            ], 
            "timeout": 120, 
            "unsafe_writes": null, 
            "url": "http://cxa-test-03<DOMAIN>:8080/api/v1/clusters/cxadev", 
            "url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "url_username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "use_proxy": true, 
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "validate_certs": true
        }
    }, 
    "json": {
        "message": "Invalid Cluster Creation Template: org.apache.ambari.server.topology.InvalidTopologyTemplateException: 'host_groups' element must be included in cluster create body", 
        "status": 400
    }, 
    "msg": "Status code was 400 and not [200, 201, 202]: HTTP Error 400: Bad Request", 
    "pragma": "no-cache", 
    "redirected": false, 
    "set_cookie": "AMBARISESSIONID=11xkc3jy8ev4320l5o6laxupo;Path=/;HttpOnly", 
    "status": 400, 
    "url": "http://cxa-test-03.<DOMAIN>:8080/api/v1/clusters/cxadev", 
    "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
    "x_content_type_options": "nosniff", 
    "x_frame_options": "DENY", 
    "x_xss_protection": "1; mode=block"
}


NO MORE HOSTS LEFT ******************************************************************************************************************************************************************************

PLAY RECAP ***************************************************




Thank you in advance regards Jörg
Don't have an account?
Coming from Hortonworks? Activate your account here