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

Exeception with setns connection method - kubectl_path #409

Closed
jrosser opened this issue Oct 26, 2018 · 5 comments
Closed

Exeception with setns connection method - kubectl_path #409

jrosser opened this issue Oct 26, 2018 · 5 comments
Labels

Comments

@jrosser
Copy link

@jrosser jrosser commented Oct 26, 2018

I gave openstack-ansible a spin again with mitogen.

Current master of OSA + this patch on top https://review.openstack.org/#/c/591236/, adjusted to pick up current Mitogen master.

This patch applied to mitogen to make setns connection work with OSA inventory jrosser@b1e9283

Result is an expection at the first point a connection is attempted to a container.

TASK [lxc_container_create : Gather container facts] ***************************
ERROR! [pid 22863] 17:58:55.598590 E mitogen: mitogen.service.Pool(0x7f96d1c05fd0, size=16, th='mitogen.service.Pool.7f96d1c05fd0.worker-10'): while invoking u'get' of u'ansible_mitogen.services.ContextService'
Traceback (most recent call last):
File "/etc/ansible/roles/mitogen/mitogen/service.py", line 519, in _on_service_call
return invoker.invoke(method_name, kwargs, msg)
File "/etc/ansible/roles/mitogen/mitogen/service.py", line 253, in invoke
response = self._invoke(method_name, kwargs, msg)
File "/etc/ansible/roles/mitogen/mitogen/service.py", line 239, in _invoke
ret = method(**kwargs)
File "/etc/ansible/roles/mitogen/ansible_mitogen/services.py", line 423, in get
reraise(*result)
File "/etc/ansible/roles/mitogen/ansible_mitogen/services.py", line 381, in _wait_or_start
response = self._connect(key, spec, via=via)
File "/etc/ansible/roles/mitogen/ansible_mitogen/services.py", line 330, in _connect
context = method(via=via, unidirectional=True, **spec['kwargs'])
File "/etc/ansible/roles/mitogen/mitogen/parent.py", line 1663, in setns
return self.connect(u'setns', **kwargs)
File "/etc/ansible/roles/mitogen/mitogen/parent.py", line 1621, in connect
return self._connect(klass, name=name, **kwargs)
File "/etc/ansible/roles/mitogen/mitogen/parent.py", line 1600, in _connect
stream = klass(self, context_id, **kwargs)
File "/etc/ansible/roles/mitogen/mitogen/parent.py", line 912, in init
super(Stream, self).init(*args, **kwargs)
File "/etc/ansible/roles/mitogen/mitogen/core.py", line 1083, in init
self.construct(**kwargs)
File "/etc/ansible/roles/mitogen/mitogen/setns.py", line 139, in construct
super(Stream, self).construct(**kwargs)
File "/etc/ansible/roles/mitogen/mitogen/parent.py", line 923, in construct
super(Stream, self).construct(**kwargs)
TypeError: construct() got an unexpected keyword argument 'kubectl_path'
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: super(Stream, self).construct(**kwargs)
fatal: [aio1_horizon_container-e7a20bec]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

@dw
Copy link
Member

@dw dw commented Oct 31, 2018

Thanks a ton for reporting this. It is poor PR review on my part :(

The fix is simple enough -- remove that line. But I'm keeping this open until I've fleshed out some stub tests covering connection.py<->Mitogen integration, to match the stub Mitogen<->third party tool integration I've started doing for the core library (tests/data/stubs/).

Might not be practical to setup tests for kubectl/lxc-info, but it sure is possible to ensure the code is at least trying to run the corresponding tools

@dw
Copy link
Member

@dw dw commented Oct 31, 2018

The trouble with setns in particuar is that it needs to be root to execute the relevant syscalls. It is actually the only method with that problem

dw added a commit that referenced this issue Oct 31, 2018
And add git_basedir extra variable.
dw added a commit that referenced this issue Oct 31, 2018
Allows us to reference them from playbooks easily.
dw added a commit that referenced this issue Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
So every method can be redirected to a stub implementation.
dw added a commit that referenced this issue Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
@dw dw closed this in 18af1df Oct 31, 2018
dw added a commit that referenced this issue Oct 31, 2018
- issue #409. Closes #409.
@dw
Copy link
Member

@dw dw commented Oct 31, 2018

Cheers Jonathan! Shouldn't happen again :)

This is now on the master branch and will make it into the next release. To be updated when a new release is made, subscribe to https://networkgenomics.com/mail/mitogen-announce/

Thanks for reporting this!

@jrosser
Copy link
Author

@jrosser jrosser commented Oct 31, 2018

No worries! I'll spin OSA again and see what pops up :)

@dw
Copy link
Member

@dw dw commented Oct 31, 2018

I've opened #403 for your OpenStack patches. Probably a tiny amount of work to merge it up, just haven't had a chance to look yet

@dw dw added the osa label Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants