Open tremble opened 1 year ago
@richardsonky - quick question: Which version of the SSM-Agent is installed on your Windows server? There's a comment on https://github.com/ansible-collections/community.aws/issues/1725#issuecomment-1447242011 which seems to imply there are issues connecting to older SSM-Agent versions which may be fixed by updating the SSM-Agent.
@tremble,
We are hitting this bug in our environment when gathering facts. It occurs intermittently but seems to always happen when the chunk of line ends with '\r'. For testing I have a Windows 2019 Server running SSM Agent version: 3.2.1297.0 and we are using the latest aws_ssm plugin from Galaxy.
I believe the issue is in _filter_ansi().
`line = line.replace("\r\r\n", "\n")`
In the below example "\r\r\n" is spread across multiple lines so the replacement doesn't happen.
Here is a snippet of debug. Output altered to remove identifying info.
EXEC stdout line: 20,"ansible_os_name":"Microsoft Windows Server 2019 Datacenter","ansible_system_description":"","ansible_machine_id":"S-0-0-00-000000000-0000000000-0000000000","ansible_product_serial":"xxxxxxxx-xxxx-\r EXEC stdout line: EXEC stdout line: EXEC stdout line: xxxx-xxxx-xxxxxxxxxxxx","ansible_system_vendor":"Amazon EC2","gather_subset":["all"],"ansible_bios_version":"1.0","ansible_user_id":"CCCCCCC-CCCCCCC$","ansible_date_time":{"epoch_local":"1689342349.07
The first line of output ends with '\r'. The second line is probably the interpreted second '\r'. The third line is probably the interpreted '\n'. The fourth continues the second half of "ansible_product_serial".
For testing I was able to get setup to consistently work by adding an additional regex filter to _filter_ansi() but that broke things in subsequent tasks.
@tremble: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.
Here are the items we could not find in your description:
Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md
Originally posted by @richardsonky in https://github.com/ansible-collections/community.aws/issues/948#issuecomment-1438823110