My rather long playbook fails with the error ERROR! Unexpected Exception, this is probably a bug: ‘_raw_params’, and I cannot see any fault.
The failing step is the disable binary logging. The playbook section is
- name: Remove MySQL test database
mysql_db: name=test state=absent
- name: Disable binary logging
ansible.builtin.lineinfile:
path: /etc/mysql/mysql.conf.d/mysqld.cnf
search_string: "disable_log_bin"
line: "disable_log_bin"
- name: Create ian user
community.mysql.mysql_user:
user: ian
password: "{{mysql_ian_password}}"
priv: '*.*: ALL'
no_log: false
At that point, root’s password has been set, and ~/.my.cnf has been setup, and those permissions have been used to delete the test database.
ian@ansible:~/ansible$ ansible --version
ansible [core 2.18.6]
config file = /home/ian/.ansible.cfg
configured module search path = [‘/home/ian/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/ian/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
The tail end of the -vvv execution is
TASK [installMySQL : Disable binary logging] *******************************************************************************************************************
task path: /home/ian/ansible/playbooks/roles/installMySQL/tasks/main.yml:57
<bitfolk.hcs> ESTABLISH SSH CONNECTION FOR USER: None
<bitfolk.hcs> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' bitfolk.hcs '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<bitfolk.hcs> (0, b'/home/ian\n', b"OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ian/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ian/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master at '/home/ian/.ansible/cp/bf80a919c9'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n")
<bitfolk.hcs> ESTABLISH SSH CONNECTION FOR USER: None
<bitfolk.hcs> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' bitfolk.hcs '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/ian/.ansible/tmp `"&& mkdir "` echo /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377 `" && echo ansible-tmp-1750671057.829696-9109-106575016560377="` echo /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377 `" ) && sleep 0'"'"''
<bitfolk.hcs> (0, b'ansible-tmp-1750671057.829696-9109-106575016560377=/home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377\n', b"OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ian/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ian/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master at '/home/ian/.ansible/cp/bf80a919c9'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n")
Using module file /usr/lib/python3/dist-packages/ansible/modules/lineinfile.py
<bitfolk.hcs> PUT /home/ian/.ansible/tmp/ansible-local-85114dtz03zk/tmpuqw31pgw TO /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py
<bitfolk.hcs> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' '[bitfolk.hcs]'
<bitfolk.hcs> (0, b'sftp> put /home/ian/.ansible/tmp/ansible-local-85114dtz03zk/tmpuqw31pgw /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py\n', b'OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts\' -> \'/home/ian/.ssh/known_hosts\'\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts2\' -> \'/home/ian/.ssh/known_hosts2\'\r\ndebug1: auto-mux: Trying existing master at \'/home/ian/.ansible/cp/bf80a919c9\'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "posix-rename@openssh.com" revision 1\r\ndebug2: Server supports extension "statvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "fstatvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "hardlink@openssh.com" revision 1\r\ndebug2: Server supports extension "fsync@openssh.com" revision 1\r\ndebug2: Server supports extension "lsetstat@openssh.com" revision 1\r\ndebug2: Server supports extension "limits@openssh.com" revision 1\r\ndebug2: Server supports extension "expand-path@openssh.com" revision 1\r\ndebug2: Server supports extension "copy-data" revision 1\r\ndebug2: Unrecognised server extension "home-directory"\r\ndebug2: Server supports extension "users-groups-by-id@openssh.com" revision 1\r\ndebug3: Sent message limits@openssh.com I:1\r\ndebug3: Received limits reply T:201 I:1\r\ndebug3: server upload/download buffer sizes 261120 / 261120; using 261120 / 261120\r\ndebug3: server handle limit 1019; using 64\r\ndebug2: Sending SSH2_FXP_REALPATH "."\r\ndebug3: Sent message fd 3 T:16 I:2\r\ndebug3: SSH2_FXP_REALPATH . -> /home/ian\r\ndebug3: Looking up /home/ian/.ansible/tmp/ansible-local-85114dtz03zk/tmpuqw31pgw\r\ndebug2: Sending SSH2_FXP_STAT "/home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py"\r\ndebug3: Sent message fd 3 T:17 I:3\r\ndebug1: stat remote: No such file or directory\r\ndebug2: sftp_upload: upload local "/home/ian/.ansible/tmp/ansible-local-85114dtz03zk/tmpuqw31pgw" to remote "/home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py"\r\ndebug2: Sending SSH2_FXP_OPEN "/home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py"\r\ndebug3: Sent dest message SSH2_FXP_OPEN I:4 P:/home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py M:0x001a\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:0 S:122284\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 122284 bytes at 0\r\ndebug3: Sent message SSH2_FXP_CLOSE I:5\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<bitfolk.hcs> ESTABLISH SSH CONNECTION FOR USER: None
<bitfolk.hcs> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' bitfolk.hcs '/bin/sh -c '"'"'chmod u+rwx /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/ /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py && sleep 0'"'"''
<bitfolk.hcs> (0, b'', b"OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ian/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ian/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master at '/home/ian/.ansible/cp/bf80a919c9'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n")
<bitfolk.hcs> ESTABLISH SSH CONNECTION FOR USER: None
<bitfolk.hcs> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' -tt bitfolk.hcs '/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible, key=tdmrcvdrorhetrkofpepsuhcuxsvmman] password:" -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-tdmrcvdrorhetrkofpepsuhcuxsvmman ; /usr/bin/python3.12 /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/AnsiballZ_lineinfile.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
<bitfolk.hcs> (0, b'\r\n\r\n{"changed": false, "msg": "", "backup": "", "diff": [{"before": "", "after": "", "before_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (content)", "after_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (content)"}, {"before_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (file attributes)", "after_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (file attributes)"}], "invocation": {"module_args": {"path": "/etc/mysql/mysql.conf.d/mysqld.cnf", "search_string": "disable_log_bin", "line": "disable_log_bin", "state": "present", "backrefs": false, "create": false, "backup": false, "firstmatch": false, "unsafe_writes": false, "regexp": null, "insertafter": null, "insertbefore": null, "validate": null, "mode": null, "owner": null, "group": null, "seuser": null, "serole": null, "selevel": null, "setype": null, "attributes": null}}}\r\n', b"OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ian/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ian/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master at '/home/ian/.ansible/cp/bf80a919c9'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to bitfolk.hcs closed.\r\n")
<bitfolk.hcs> ESTABLISH SSH CONNECTION FOR USER: None
<bitfolk.hcs> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath="/home/ian/.ansible/cp/bf80a919c9"' bitfolk.hcs '/bin/sh -c '"'"'rm -f -r /home/ian/.ansible/tmp/ansible-tmp-1750671057.829696-9109-106575016560377/ > /dev/null 2>&1 && sleep 0'"'"''
<bitfolk.hcs> (0, b'', b"OpenSSH_9.6p1 Ubuntu-3ubuntu13.12, OpenSSL 3.0.13 30 Jan 2024\r\ndebug1: Reading configuration data /home/ian/.ssh/config\r\ndebug1: /home/ian/.ssh/config line 17: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ian/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ian/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master at '/home/ian/.ansible/cp/bf80a919c9'\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 8520\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet_timeout: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n")
ok: [bitfolk.hcs] => {
"backup": "",
"changed": false,
"diff": [
{
"after": "",
"after_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (content)",
"before": "",
"before_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (content)"
},
{
"after_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (file attributes)",
"before_header": "/etc/mysql/mysql.conf.d/mysqld.cnf (file attributes)"
}
],
"invocation": {
"module_args": {
"attributes": null,
"backrefs": false,
"backup": false,
"create": false,
"firstmatch": false,
"group": null,
"insertafter": null,
"insertbefore": null,
"line": "disable_log_bin",
"mode": null,
"owner": null,
"path": "/etc/mysql/mysql.conf.d/mysqld.cnf",
"regexp": null,
"search_string": "disable_log_bin",
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"state": "present",
"unsafe_writes": false,
"validate": null
}
},
"msg": ""
}
ERROR! Unexpected Exception, this is probably a bug: '_raw_params'
the full traceback was:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ansible/cli/__init__.py", line 646, in cli_executor
exit_code = cli.run()
^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/cli/playbook.py", line 155, in run
results = pbex.run()
^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/executor/playbook_executor.py", line 188, in run
result = self._tqm.run(play=play)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/executor/task_queue_manager.py", line 344, in run
play_return = strategy.run(iterator, play_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/plugins/strategy/linear.py", line 116, in run
host_tasks = self._get_next_task_lockstep(hosts_left, iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/plugins/strategy/linear.py", line 55, in _get_next_task_lockstep
state, task = iterator.get_next_task_for_host(host, peek=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/executor/play_iterator.py", line 258, in get_next_task_for_host
display.debug(" ^ task is: %s" % task)
~~~~~~~~~~~~~~~~~^~~~~~
File "/usr/lib/python3/dist-packages/ansible/playbook/task.py", line 140, in __repr__
return "TASK: meta (%s)" % self.args['_raw_params']
~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: '_raw_params'
Picking through that, the only thing I saw was that /etc/ssh/ssh_config.d is empty. It is always been empty in every version of ubuntu I have installed.
The version of ubuntu running ansible is a LXC container
ian@ansible:/etc$ cat os-release
PRETTY_NAME=“Ubuntu 24.04.2 LTS”
NAME=“Ubuntu”
VERSION_ID=“24.04”
VERSION=“24.04.2 LTS (Noble Numbat)”
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
And on the target machine a VM
ian@bitfolk:~$ cat /etc/os-release
PRETTY_NAME=“Ubuntu 24.04.2 LTS”
NAME=“Ubuntu”
VERSION_ID=“24.04”
VERSION=“24.04.2 LTS (Noble Numbat)”
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
I need help to diagnose the problem, and perhaps tweak the failing step.
Ian