Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl connection plugin broken in 2.9.14 #72171

Closed
kdelee opened this issue Oct 9, 2020 · 3 comments
Closed

kubectl connection plugin broken in 2.9.14 #72171

kdelee opened this issue Oct 9, 2020 · 3 comments
Assignees
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.

Comments

@kdelee
Copy link
Member

kdelee commented Oct 9, 2020

SUMMARY

3728530#r43109609 this commit introduced a programming error, a function is called expecting 2 return values, but the function only returns 1 return value.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubectl connection plugin

ANSIBLE VERSION
ansible 2.9.14.post0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Mar 20 2020, 17:08:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION

no changes

OS / ENVIRONMENT

RHEL 7.8

STEPS TO REPRODUCE

similar to https://github.com/ansible-collections/community.kubernetes/issues/200

test.yml

---

- name: Prepare data, dispatch job in isolated environment.
  hosts: all
  gather_facts: false

  tasks:
    - command: "echo hello"

ansible-playbook -c kubectl -i 'name-of-pod-on-kubernetes' test.yml -e ansible_kubectl_config=${KUBE_CONFIG_PATH} -vvv
EXPECTED RESULTS

Works

ACTUAL RESULTS
TASK [command] *******************************************************************************************************
task path: /home/elijah/sfw/ansible/awx/foo.yml:8
<nginx-app-proxy-85cc95c5fc-8cqdr> ESTABLISH kubectl CONNECTION
The full traceback is:
Traceback (most recent call last):
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/executor/task_executor.py", line 147, in run
    res = self._execute()
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/executor/task_executor.py", line 665, in _execute
    result = self._handler.run(task_vars=variables)
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/action/command.py", line 24, in run
    results = merge_hash(results, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/action/__init__.py", line 790, in _execute_module
    self._make_tmp_path()
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/action/__init__.py", line 353, in _make_tmp_path
    tmpdir = self._remote_expand_user(self.get_shell_option('remote_tmp', default='~/.ansible/tmp'), sudoable=False)
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/action/__init__.py", line 674, in _remote_expand_user
    data = self._low_level_execute_command(cmd, sudoable=False)
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/action/__init__.py", line 1085, in _low_level_execute_command
    rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable)
  File "/home/elijah/venv/python3towerqa/lib64/python3.8/site-packages/ansible/plugins/connection/kubectl.py", line 286, in exec_command
    local_cmd, censored_local_cmd = self._build_exec_cmd([self._play_context.executable, '-c', cmd])
ValueError: too many values to unpack (expected 2)
fatal: [nginx-app-proxy-85cc95c5fc-8cqdr]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

@mattclay this is a tower blocker because we use the kubectl connection plugin for container groups

@ansibot
Copy link
Contributor

ansibot commented Oct 9, 2020

Files identified in the description:

  • lib/ansible/plugins/connection

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Oct 9, 2020
@Akasurde Akasurde self-assigned this Oct 9, 2020
@kdelee
Copy link
Member Author

kdelee commented Oct 9, 2020

connect #72130
#72131

@Akasurde
Copy link
Member

Akasurde commented Oct 9, 2020

For 2.8 - #72131
For 2.9 - #72130

Akasurde added a commit to Akasurde/ansible that referenced this issue Oct 9, 2020
PR ansible#71535 broke, _build_exec_cmd API in kubectl connection
plugin.

Fixes: ansible#72171

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Akasurde added a commit to Akasurde/ansible that referenced this issue Oct 9, 2020
PR ansible#71535 broke, _build_exec_cmd API in kubectl connection
plugin.

Fixes: ansible#72171

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
relrod pushed a commit that referenced this issue Oct 9, 2020
PR #71535 broke, _build_exec_cmd API in kubectl connection
plugin.

Fixes: #72171

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
relrod pushed a commit that referenced this issue Oct 9, 2020
PR #71535 broke, _build_exec_cmd API in kubectl connection
plugin.

Fixes: #72171

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@Akasurde Akasurde added has_pr This issue has an associated PR. and removed needs_triage Needs a first human triage before being processed. labels Oct 9, 2020
@relrod relrod closed this as completed Oct 9, 2020
@ansible ansible locked and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

4 participants