Repository navigation
error "ok = out_fp.tell() == metadata['size']" in ansible #391
Copy link
Copy link
Closed
Labels
NeedsTestLabel for in-progress and closed bugs that do not yet have a corresponding regression testLabel for in-progress and closed bugs that do not yet have a corresponding regression testansibleIssues relating to Mitogen for AnsibleIssues relating to Mitogen for AnsiblebugCode feature that hinders desired execution outcomeCode feature that hinders desired execution outcomeuser-reported
Description
I want to create /etc/hosts for clients using ansible with mitogen , but there`s error message like "ok = out_fp.tell() == metadata['size']"
here is the environments
ansible version
2018-10-08 11:38:50 [minion@hqs010 ansiblecontrol]$ ansible --version
ansible 2.6.2
config file = /home/minion/D/ansiblecontrol/ansible.cfg
configured module search path = [u'/home/minion/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
2018-10-08 11:38:54 [minion@hqs010 ansiblecontrol]$
Client : ubuntu 18.04.1 / Python 3.6
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64)
administrator@dcpc056:~$ python -V
Python 3.6.5
administrator@dcpc056:~$
ansible config
DEFAULT_ROLES_PATH(/home/minion/D/ansiblecontrol/ansible.cfg) = [u'/home/minion/D/ansiblecontrol/roles']
DEFAULT_STRATEGY(/home/minion/D/ansiblecontrol/ansible.cfg) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(/home/minion/D/ansiblecontrol/ansible.cfg) = [u'/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(/home/minion/D/ansiblecontrol/ansible.cfg) = 60
HOST_KEY_CHECKING(/home/minion/D/ansiblecontrol/ansible.cfg) = False
ansible tasks
- name: load client_hosts
include_vars: client_hosts.yml
- name: load server_hosts
include_vars: server_hosts.yml
- set_fact:
_inventory_domain: "{{ inventory_hostname|inventory_domain }}"
- set_fact:
client_hosts_lines: "{{ client_hosts|as_hostentries(_inventory_domain)|list }}"
- set_fact:
server_hosts_lines: "{{ server_hosts|as_hostentries(_inventory_domain)|list }}"
- set_fact:
hosts_lines: "{{ server_hosts_lines + client_hosts_lines }}"
- name: setup /etc/hosts
template:
src: etc/hosts.j2
dest: /etc/hosts
mode: 0755
ansible error message
The full traceback is:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 138, in run
res = self._execute()
File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 576, in _execute
result = self._handler.run(task_vars=variables)
File "/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/mixins.py", line 115, in run
return super(ActionModuleMixin, self).run(tmp, task_vars)
File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/template.py", line 201, in run
result.update(copy_action.run(task_vars=task_vars))
File "/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/mixins.py", line 115, in run
return super(ActionModuleMixin, self).run(tmp, task_vars)
File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/copy.py", line 495, in run
module_return = self._copy_file(source_full, source_rel, content, content_tempfile, dest, task_vars, follow)
File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/copy.py", line 282, in _copy_file
remote_path = self._transfer_file(source_full, tmp_src)
File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/__init__.py", line 352, in _transfer_file
self._connection.put_file(local_path, remote_path)
File "/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/connection.py", line 719, in put_file
out_path=out_path
File "/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/connection.py", line 594, in call
return self.call_async(func, *args, **kwargs).get().unpickle()
File "/home/minion/D/ansiblecontrol/mitogen-0.2.2/mitogen/core.py", line 487, in unpickle
raise obj
CallError: builtins.KeyError: 'size'
File "<stdin>", line 2049, in _dispatch_calls
File "<stdin>", line 2041, in _dispatch_one
File "master:/home/minion/D/ansiblecontrol/mitogen-0.2.2/ansible_mitogen/target.py", line 123, in transfer_file
out_fp=fp,
File "master:/home/minion/D/ansiblecontrol/mitogen-0.2.2/mitogen/service.py", line 953, in get
ok = out_fp.tell() == metadata['size']
fatal: [hqpc056]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
if the client is ubuntu 14.04 then the task runs ok ,
but if the client is ubuntu 18.04 , althrough I cant pass the dryrun ,
but the task failed when really runs
any suggestions ?
update:
if clients runs ubuntu 18.04 and python 2.7 , then the task works.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
NeedsTestLabel for in-progress and closed bugs that do not yet have a corresponding regression testLabel for in-progress and closed bugs that do not yet have a corresponding regression testansibleIssues relating to Mitogen for AnsibleIssues relating to Mitogen for AnsiblebugCode feature that hinders desired execution outcomeCode feature that hinders desired execution outcomeuser-reported
Activity
dw commentedon Oct 8, 2018
Hi Eric!
Thanks for reporting this. Are you using a Git version of the extension, or a release version?
Please include the previous ~100 lines of "-vvv" output before the error occurs.
changchichung commentedon Oct 9, 2018
thanks for reply , here is the ansisble output
dw commentedon Nov 6, 2018
Hi Eric,
Sorry for the delay. I thought this might be a duplicate of #364 but it seems not. It looks a lot like a bytes vs. Unicode issue, since you are crossing major interpreter versions. The fix should therefore be simple :)
Thanks for reporting this!
issue #391: FileService metadata dict keys must be Unicode.
docs: update Changelog; closes #391.
Merge remote-tracking branch 'origin/dmw'
dw commentedon Nov 7, 2018
Hi Eric!
Thanks a ton for reporting this -- it seems nobody is actually using the code against 3.x targets. This was a supported configuration a few months back, but something really terrible happened. It turns out 3.x targets were never added to the CI whatsoever. So 3.x is quite regressed just now.
You might want to wait for 0.2.4 before trying this again, once #426 has been closed.
Thanks 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!
Merge pull request mitogen-hq#391 from spearlineltd/aus-syd2-s1-fastrack