#Failed with "Error using REST version"

1 messages · Page 1 of 1 (latest)

rustic nebula
#

Can anyone please shed some light on what this error means?

TASK [Get NetApp cluster info] ***************************************************************************************************************************************************************
fatal: [cluster1]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python"}, "changed": false, "msg": "Error using REST for version, error: URL has an invalid label.. Error using REST for version, status_code: None."}

Task mentioned is simply:

    netapp.ontap.na_ontap_rest_info:
        gather_subset: "cluster_node_info"
    register: ontap_info
    connection: local```

However, I don't think the issue is in the task since the same task works great in another playbook.
I'm using ```hosts: all``` and limiting the scope of the playbook by using the "--limit" parameter.
dire jetty
#

possibly hostname has some character which python requests library thinks invalid, so you are getting URL has an invalid label

rustic nebula
#

You mean the hostname I limit the request to?

dire jetty
#

yes

rustic nebula
#

Don't think so, doesn't matter which other hostname I provide.

dire jetty
#

can you share -vvv run of the task that throws error?

#

we can debug

rustic nebula
#

I see there is something weird with the hostname with -vvv:

    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "changed": false,
    "invocation": {
        "module_args": {
            "cert_filepath": null,
            "feature_flags": null,
            "fields": null,
            "force_ontap_version": null,
            "gather_subset": [
                "cluster_node_info"
            ],
            "hostname": "“cluster1",
            "http_port": null,
            "https": true,
            "ignore_api_errors": null,
            "key_filepath": null,
            "max_records": 1024,
            "ontapi": null,
            "owning_resource": null,
            "parameters": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "state": null,
            "use_python_keys": false,
            "use_rest": "auto",
            "cluster1name": "domain\\user",
            "validate_certs": true
        }
    },
    "msg": "Error using REST for version, error: URL has an invalid label..  Error using REST for version, status_code: None."
}```
#

Ok, I found it. This was in the playbook:

    group/netapp.ontap.netapp_ontap:
      username: "{{ clusteruser }}"
      password: "{{ clusterpass }}"
      hostname: “{{ inventory_hostname }}
      https: true```