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

Ansible core 2.13 support #929

Closed
uumas opened this issue May 18, 2022 · 11 comments
Closed

Ansible core 2.13 support #929

uumas opened this issue May 18, 2022 · 11 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@uumas
Copy link

uumas commented May 18, 2022

Ansible core 2.13 dropped so mitogen needs to be updated again

ERROR! Your Ansible version ((2, 13, 0)) is too recent. The most recent version
supported by Mitogen for Ansible is (2, 12).x. Please check the Mitogen
release notes to see if a new version is available, otherwise
subscribe to the corresponding GitHub issue to be notified when
support becomes available.

    https://mitogen.rtfd.io/en/latest/changelog.html
    https://github.com/mitogen-hq/mitogen/issues/
@uumas uumas added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels May 18, 2022
moreati added a commit to moreati/mitogen that referenced this issue Jun 2, 2022
moreati added a commit to moreati/mitogen that referenced this issue Jun 13, 2022
moreati added a commit to moreati/mitogen that referenced this issue Jul 4, 2022
@smarakdas314
Copy link

smarakdas314 commented Jul 13, 2022

Same error after upgrading to ansible 6.0.0 on my mac
$ brew upgrade ansible

✗ ansible --version
ansible [core 2.13.1]

ERROR! Your Ansible version ((2, 13, 1)) is too recent

You can use this to stick to your current (working) ansible version, for example 5.7.1 ansible version worked with mitogen
$ brew pin ansible

Tried your referenced commit

An exception occurred during task execution. To see the full traceback, use -vvv. The error was:   File "<stdin>", line 1521, in load_module
fatal: [server1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

moreati added a commit to moreati/mitogen that referenced this issue Jul 16, 2022
@cfarrell987
Copy link

Any update when this commit will be merged and released? This is a blocker for implementing Mitogen.

@gertvdijk
Copy link

gertvdijk commented Jul 19, 2022

@cfarrell987 The PR is still a draft. #933

Perhaps comment there on the progress of it? 😃

For the time being you can pin ansible < 6 in your project and integrate mitogen.

@dr460nf1r3
Copy link

dr460nf1r3 commented Jul 24, 2022

Quick question, after updating to the most recent commit I'm still getting

[WARNING]: Unhandled error in Python interpreter discovery for host host: builtins.ModuleNotFoundError:
The Mitogen master process was unable to serve 'ansible_mitogen.target'. It may be a native Python extension,
or it may be missing entirely. Check the importer debug logs on the master for more information.   File
"<stdin>", line 3698, in _dispatch_one   File "<stdin>", line 3685, in _parse_request   File "<stdin>", line
682, in import_module   File "<stdin>", line 1521, in load_module

TASK [Gathering Facts] ***************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was:   File "<stdin>", line 1521, in load_module
fatal: [host]: FAILED! =>
msg: Unexpected failure during module execution.
stdout: ''

The ansible version used is

ansible [core 2.13.2]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/nico/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.10/site-packages/ansible
ansible collection location = /home/nico/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0]
jinja version = 3.1.2
libyaml = True

What could possibly cause this?

@moreati
Copy link
Member

moreati commented Jul 24, 2022

What could possibly cause this?

I don't know, and to my knowledge it doesn't happen in the integration tests. Could you raise a new issue, with a minimal playbook that reproduces the error?

@dr460nf1r3
Copy link

Yes of course, thanks!

@smarakdas314
Copy link

smarakdas314 commented Aug 2, 2022

with latest mitogen #929 released, still getting some weird error :/

ok: [server1] => (item=../ansible/roles/common/templates/etc/firewall.d/00-flush.j2)
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: mitogen.core.Error: An attempt was made to enqueue a message with a Broker that has already exitted. It is likely your program called Broker.shutdown() too early.
fatal: [server1]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
The full traceback is:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/ansible/6.1.0/libexec/lib/python3.10/site-packages/ansible/plugins/action/template.py", line 178, in run
    result.update(copy_action.run(task_vars=task_vars))
  File "/Users/user1/git/ansible/mitogen/ansible_mitogen/mixins.py", line 141, in run
    self._connection.on_action_run(
  File "/Users/user1/git/ansible/mitogen/ansible_mitogen/connection.py", line 551, in on_action_run
    self._put_connection()
  File "/Users/user1/git/ansible/mitogen/ansible_mitogen/connection.py", line 865, in _put_connection
    self.chain.reset()
  File "/Users/user1/git/ansible/mitogen/mitogen/parent.py", line 1852, in reset
    self.call_no_reply(mitogen.core.Dispatcher.forget_chain, saved)
  File "/Users/user1/git/ansible/mitogen/mitogen/parent.py", line 1907, in call_no_reply
    self.context.send(self.make_msg(fn, *args, **kwargs))
  File "/Users/user1/git/ansible/mitogen/mitogen/core.py", line 2310, in send
    self.router.route(msg)
  File "/Users/user1/git/ansible/mitogen/mitogen/core.py", line 3383, in route
    self.broker.defer(self._async_route, msg)
  File "/Users/user1/git/ansible/mitogen/mitogen/core.py", line 2864, in defer
    raise Error(self.broker_shutdown_msg)
mitogen.core.Error: An attempt was made to enqueue a message with a Broker that has already exitted. It is likely your program called Broker.shutdown() too early.

@gertvdijk
Copy link

@oxy-arnoldasb Your error seems unrelated to this issue of 2.13 support.
I found #822, #663 and possibly #925 that seem similar.

@upekkha
Copy link
Contributor

upekkha commented Aug 11, 2022

The Broker error is also making many of our playbooks fail at random tasks, as soon as I upgrade from ansible 5.10.0 (ansible-core 2.12.7) to ansible 6.2.0 (ansible-core 2.13.2) - for the same mitogen at current master 8cda5f5.

I can confirm the statement from #925 that commenting out the self.close() here seems to fix the issue. So it may well be that the work-around that was needed back in 2018 (commit 3584084) is becoming counter-productive for newer ansible releases.

Update: this has been fixed by commit 0af2ce8

@arhue
Copy link

arhue commented Sep 10, 2022

@upekkha I tried with Ansible 6.3.0 and python 3.8. Getting similar issue with use of loop while copying template files to destination in particular.

@yasharne
Copy link

same here:

ERROR! Your Ansible version ((2, 13, 5)) is too recent. The most recent version
supported by Mitogen for Ansible is (2, 12).x. Please check the Mitogen
release notes to see if a new version is available, otherwise
subscribe to the corresponding GitHub issue to be notified when
support becomes available.

    https://mitogen.rtfd.io/en/latest/changelog.html
    https://github.com/mitogen-hq/mitogen/issues/

mitogen version: 0.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

9 participants