Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

drain fail #7

Open
andreas-theswede opened this issue Feb 14, 2022 · 3 comments
Open

drain fail #7

andreas-theswede opened this issue Feb 14, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@andreas-theswede
Copy link

Hi

I am getting the following error when using the drain function.

The drain start and completes, so it is only the "ansible job" which in indicating something went wrong. Unfortunately I am a terrible at python...

{
    "module_stdout": "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n  InsecureRequestWarning)\r\nTraceback (most recent call last):\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1643867344.0378213-97863888650931/AnsiballZ_rancher_node.org\", line 102, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1643867344.0378213-97863888650931/AnsiballZ_rancher_node.org\", line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1643867344.0378213-97863888650931/AnsiballZ_rancher_node.org\", line 40, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.rancher_node', init_globals=None, run_name='__main__', alter_sys=False)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 208, in run_module\r\n    return _run_code(code, {}, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_rancher_node_payload_dzj4hizb/ansible_rancher_node_payload.zip/ansible/modules/rancher_node.py\", line 176, in <module>\r\n  File \"/tmp/ansible_rancher_node_payload_dzj4hizb/ansible_rancher_node_payload.zip/ansible/modules/rancher_node.py\", line 168, in main\r\n  File \"/tmp/ansible_rancher_node_payload_dzj4hizb/ansible_rancher_node_payload.zip/ansible/modules/rancher_node.py\", line 50, in rancher_node_drained\r\n  File \"/tmp/ansible_rancher_node_payload_dzj4hizb/ansible_rancher_node_payload.zip/ansible/modules/rancher_node.py\", line 19, in get_node\r\nKeyError: 'pagination'\r\n",
    "module_stderr": "Shared connection to NODE.DOMAIN.ORG closed.\r\n",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1,
    "_ansible_no_log": false,
    "changed": false
}
@seancallaway
Copy link
Owner

I'm wondering if the Rancher API has changed. It looks like the pagination result wasn't returned by the API.

@andreas-theswede Please provide the version of Rancher you're using as well as the code for the task where this failed.

@andreas-theswede
Copy link
Author

andreas-theswede commented Feb 15, 2022

We are running rancher 2.6.2, @seancallaway

At the moment we run

- name: Drain Node
    ignore_errors: True
    rancher_node:
      name: '{{NODE}}'
      rancher_url: 'https://{{RANCHER_URL}}.domain.se'
      api_bearer_key: '{{API_KEY}}'
      force: true
      ignoreDaemonSets: true
      deleteLocalData: true
      state: drained

Then we wait for 60 sec and run this command which completes sucessfully

 - name: Drain Node
    rancher_node:
      name: '{{NODE}}'
      rancher_url: 'https://{{RANCHER_URL}}.domain.se'
      api_bearer_key: '{{API_KEY}}'
      force: true
      ignoreDaemonSets: true
      deleteLocalData: true
      state: drained

@seancallaway
Copy link
Owner

Interesting. I am going to see if the API has changed.

@seancallaway seancallaway self-assigned this Feb 15, 2022
@seancallaway seancallaway added the bug Something isn't working label Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants