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
tlog-rec-session breaks Ansible pipelining #227
Comments
|
Thank you for the report, @mikedep333. This might be a real issue. I'm not sure what Ansible pipelining exactly is, as there's not much documentation besides mostly marketing speak, but this needs to be investigated. Yes, you need to disable any port forwarding and X11 forwarding on the sshd server if you want tighter control over what goes in and out of the host without recording. |
|
Here might be a clue for what's going on: ansible/ansible@f488de8 |
|
We're also seeing issues in the native Vagrant commands and are trying to debug. It may be the method that |
|
I have some additional information related to this: If you set the shell for My guess is that this is the same issue showing in two different ways. |
|
I have now encountered this as well. It's a real issue, and there's something not playing nice when ansible uses the multiplexed ssh connections and it makes tlog confused. I'm trying to see if I can turn off all the ansible magic, but there's more magic that I initially comprehend. |
|
Thank you for reporting this issue, I am able to reproduce the problem. If I understand https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/ssh.py#L760 correctly, when However, per 3d8dbd6 tlog should be able to handle forking a child connected via pipes. More investigation required on my end here. |
|
Hi |
|
I see that tlog outputs the notice to stderr. I think this may be the reason pipelining Ansible thinks there's some problem happening |
|
@merlyel,I think you can disable the notice completely if you just set it to empty string ( |
|
I can not reproduce my problem, probably because I need ansible to do its connectivity persistence magic, and it does it when it feels like it. So, even though I see no change with the empty string I am not sure it proves anything. Also, why is that message on stderr instead of stdout? |
|
@AndreasDavour, because the message is not the primary output of the program. It's not something that the program produces as its function, but rather a note to the user. |
|
Two playbooks:
I'm reproducing the problem on RHEL8 also with ansible 2.9.1 Btw, I see the difference in debug output of ansible even with disabled pipelining:
But playbook keeps running after this 'failed to connect' and warning While without session recording:
So even without pipelining tlog causes some warning for ansible |
|
I see. Thanks @spbnick |
|
@merlyel I take it we then can conclude (if I understood your test case) that there is some issue with ansible even with an empty message? |
|
No, empty notice message did not help |
|
Just a wild stab at it: what if you completely remove the |
|
@spbnick then it falls to default one |
|
@merlyel, could you try removing it from |
|
No, it did not help.
Return code is 1, which is correct With recording enabled:
I see two differences:
I tried searching for error code 120 and found this: Python 3.6 changelog:
So I tried changing to python2.7 (which RHEL7.6 has by default just like topicstarter). The result is slightly different. 120 is gone, return code are the same. But the error output is still missing: Without recording:
With recording:
WHere's the stderr? Than switching to simple command
Recording:
141 is pipe fail As ansible in pipeline mode uses pipes, then this pipe fail error may be the reason for the problem. |
|
Hi, I have been looking into this over the past couple days - I believe the problem can be reproduced with the following command, where 'recuser' is a user configured with tlog-rec-session as their shell. More simply, and removing 'ssh' as a factor we can see the following does not output the expected command: In my debugging thus far, the problem appears to be when tlog-rec-session reads poll()'d data from stdin and the child process(whoami output). The stdin file descriptor gets read first in tlog_tty_source_read() (gdb) p pkt.data.io.buf I am still looking into how best to fix this. |
|
Hello all, It would be great if someone is willing to test and verify this fixes the ansible pipelining issue using the COPR build below: https://copr.fedorainfracloud.org/coprs/jstephen/tlog-copr/build/1338641/ |
|
@justin-stephenson I can confirm that this appears to fix output pipelines. |
|
thank you @trevor-vaughan ! |
Test setup the Ansible-manged system, ldt-4009653:
Test setup on my Ansible management system, ldt-4323517:
Running this ansible test command (and entering the password when prompted) fails:
Normally it would print out tons of facts about the managed system (what the "setup" module does.)
The stderr is not the problem. I removed the message, and the X11 forwarding message is harmless (we normally disable X11 forwarding for Ansible.)
The rc 1 seems to be the problem though.
We can workaround this by disabling pipelining and accepting the reduced Ansible performance.
The text was updated successfully, but these errors were encountered: