[WARNING]: Module invocation had junk after the JSON data:
Author: TownCubeCreated Nov 3, 2025Updated Sep 13, 2026
LabelsbugP3affects_2.18
Summary
I'm seeing [WARNING]: Module invocation had junk after the JSON data: after almost every task in my Ansible logs when using "become" privilege elevation.
Issue Type
Bug Report
Component Name
core
Ansible Version
$ ansible --version
ansible [core 2.18.9]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.14/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/sbin/ansible
python version = 3.14.0 (main, Oct 7 2025, 00:00:00) [GCC 15.2.1 20250924 (Red Hat 15.2.1-2)] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True
Configuration
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /etc/ansible/ansible.cfg
EDITOR(env: EDITOR) = /usr/bin/nano
GALAXY_SERVERS:
OS / Environment
Fedora Cloud 43
Steps to Reproduce
- Create a Fedora Cloud machine from https://fedoraproject.org/cloud/download (I used the AWS link under "Launch on public cloud platforms")
- SSH into the machine
- Create an SSH config to allow loopback login in
~/.ssh/configHost local-ssh HostName x.x.x.x User fedora IdentityFile ~/.ssh/id_fedora_aws - Execute
ansible -i local-ssh, all --become -m ping
Expected Results
I do not expect to see [WARNING]: Module invocation had junk after the JSON data: in the output.
If I run without --become, the warning doesn't appear.
Actual Results
$ ansible -i local-ssh, all --become -m ping -vvvv
ansible [core 2.18.9]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/fedora/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.14/site-packages/ansible
ansible collection location = /home/fedora/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.14.0 (main, Oct 7 2025, 00:00:00) [GCC 15.2.1 20250924 (Red Hat 15.2.1-2)] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
Loading collection ansible.builtin from
Parsed local-ssh, inventory source with host_list plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python3.14/site-packages/ansible/plugins/callback/minimal.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
<local-ssh> ESTABLISH SSH CONNECTION FOR USER: None
<local-ssh> SSH: EXEC ssh -vvvv -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/fedora/.ansible/cp/2e9872eaf2"' local-ssh '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<local-ssh> (0, b'/home/fedora\n', b'debug1: OpenSSH_10.0p2, OpenSSL 3.5.1 1 Jul 2025\r\ndebug3: Running on Linux 6.17.1-300.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Oct 6 15:37:21 UTC 2025 x86_64\r\ndebug3: Started with: ssh -vvvv -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/fedora/.ansible/cp/2e9872eaf2\\\\" local-ssh "/bin/sh -c \\\\\'echo ~ && sleep 0\\\\\'"\r\ndebug1: Reading configuration data /home/fedora/.ssh/config\r\ndebug1: /home/fedora/.ssh/config line 1: Applying options for local-ssh\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf\r\ndebug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for \'final all\' host 52.64.215.251 originally local-ssh\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched \'final\'\r\ndebug2: match not found\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug1: configuration requests final Match pass\r\ndebug2: resolve_canonicalize: hostname 52.64.215.251 is address\r\ndebug1: re-parsing configuration\r\ndebug1: Reading configuration data /home/fedora/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf\r\ndebug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for \'final all\' host 52.64.215.251 originally local-ssh\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: matched \'final\'\r\ndebug2: match found\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts\' -> \'/home/fedora/.ssh/known_hosts\'\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts2\' -> \'/home/fedora/.ssh/known_hosts2\'\r\ndebug1: auto-mux: Trying existing master at \'/home/fedora/.ansible/cp/2e9872eaf2\'\r\ndebug1: Control socket "/home/fedora/.ansible/cp/2e9872eaf2" does not exist\r\ndebug3: channel_clear_timeouts: clearing\r\ndebug3: ssh_connect_direct: entering\r\ndebug1: Connecting to 52.64.215.251 [52.64.215.251] port 22.\r\ndebug3: set_sock_tos: set socket 3 IP_TOS 0x48\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/fedora/.ssh/id_fedora_aws type 3\r\ndebug1: identity file /home/fedora/.ssh/id_fedora_aws-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_10.0\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_10.0\r\ndebug1: compat_banner: match: OpenSSH_10.0 pat OpenSSH* compat 0x04000000\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to 52.64.215.251:22 as \'fedora\'\r\ndebug3: record_hostkey: found key type ED25519 in file /home/fedora/.ssh/known_hosts:1\r\ndebug3: record_hostkey: found key type RSA in file /home/fedora/.ssh/known_hosts:2\r\ndebug3: record_hostkey: found key type ECDSA in file /home/fedora/.ssh/known_hosts:3\r\ndebug3: load_hostkeys_file: loaded 3 keys from 52.64.215.251\r\ndebug1: load_hostkeys: fopen /home/fedora/.ssh/known_hosts2: No such file or directory\r\ndebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory\r\ndebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory\r\ndebug3: order_hostkeyalgs: have matching best-preference key type [email protected], using HostkeyAlgorithms verbatim\r\ndebug3: send packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug3: receive packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: local client KEXINIT proposal\r\ndebug2: KEX algorithms: mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ext-info-c,[email protected]\r\ndebug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256\r\ndebug2: ciphers ctos: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: ciphers stoc: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: compression ctos: [email protected],none\r\ndebug2: compression stoc: [email protected],none\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug2: peer server KEXINIT proposal\r\ndebug2: KEX algorithms: mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ext-info-s,[email protected]\r\ndebug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519\r\ndebug2: ciphers ctos: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: ciphers stoc: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: compression ctos: none,[email protected]\r\ndebug2: compression stoc: none,[email protected]\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug3: kex_choose_conf: will use strict KEX ordering\r\ndebug1: kex: algorithm: mlkem768x25519-sha256\r\ndebug1: kex: host key algorithm: ssh-ed25519\r\ndebug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: [email protected]\r\ndebug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: [email protected]\r\ndebug1: kex: mlkem768x25519-sha256 need=32 dh_need=32\r\ndebug1: kex: mlkem768x25519-sha256 need=32 dh_need=32\r\ndebug3: send packet: type 30\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug3: receive packet: type 31\r\ndebug1: SSH2_MSG_KEX_ECDH_REPLY received\r\ndebug1: Server host key: ssh-ed25519 SHA256:9R11ny9CuonQZO2mbwsaf9j7+1meltdQJNGXijbB8U4\r\ndebug3: record_hostkey: found key type ED25519 in file /home/fedora/.ssh/known_hosts:1\r\ndebug3: record_hostkey: found key type RSA in file /home/fedora/.ssh/known_hosts:2\r\ndebug3: record_hostkey: found key type ECDSA in file /home/fedora/.ssh/known_hosts:3\r\ndebug3: load_hostkeys_file: loaded 3 keys from 52.64.215.251\r\ndebug1: load_hostkeys: fopen /home/fedora/.ssh/known_hosts2: No such file or directory\r\ndebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory\r\ndebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory\r\ndebug1: Host \'52.64.215.251\' is known and matches the ED25519 host key.\r\ndebug1: Found key in /home/fedora/.ssh/known_hosts:1\r\ndebug3: send packet: type 21\r\ndebug1: ssh_packet_send2_wrapped: resetting send seqnr 3\r\ndebug2: ssh_set_newkeys: mode 1\r\ndebug1: rekey out after 4294967296 blocks\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: Sending SSH2_MSG_EXT_INFO\r\ndebug3: send packet: type 7\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug3: receive packet: type 21\r\ndebug1: ssh_packet_read_poll2: resetting read seqnr 3\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug2: ssh_set_newkeys: mode 0\r\ndebug1: rekey in after 4294967296 blocks\r\ndebug2: KEX algorithms: mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ext-info-c,[email protected]\r\ndebug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256\r\ndebug2: ciphers ctos: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: ciphers stoc: [email protected],[email protected],aes256-ctr,[email protected],aes128-ctr\r\ndebug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512\r\ndebug2: compression ctos: [email protected],none\r\ndebug2: compression stoc: [email protected],none\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug3: send packet: type 5\r\ndebug3: receive packet: type 7\r\ndebug1: SSH2_MSG_EXT_INFO received\r\ndebug3: kex_input_ext_info: extension server-sig-algs\r\ndebug1: kex_ext_info_client_parse: server-sig-algs=<ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,[email protected],rsa-sha2-256,rsa-sha2-512>\r\ndebug3: kex_input_ext_info: extension [email protected]\r\ndebug1: kex_ext_info_check_ver: [email protected]=<0>\r\ndebug3: kex_input_ext_info: extension [email protected]\r\ndebug1: kex_ext_info_check_ver: [email protected]=<0>\r\ndebug3: receive packet: type 6\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 7\r\ndebug1: SSH2_MSG_EXT_INFO received\r\ndebug3: kex_input_ext_info: extension server-sig-algs\r\ndebug1: kex_ext_info_client_parse: server-sig-algs=<ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,[email protected],rsa-sha2-256,rsa-sha2-512>\r\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic\r\ndebug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic\r\ndebug3: preferred gssapi-with-mic,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_lookup gssapi-with-mic\r\ndebug3: remaining preferred: gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_is_enabled gssapi-with-mic\r\ndebug1: Next authentication method: gssapi-with-mic\r\ndebug1: No credentials were supplied, or the credentials were unavailable or inaccessible\nNo Kerberos credentials available (default cache: KCM:)\n\n\r\ndebug1: No credentials were supplied, or the credentials were unavailable or inaccessible\nNo Kerberos credentials available (default cache: KCM:)\n\n\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod_lookup gssapi-keyex\r\ndebug3: remaining preferred: hostbased,publickey\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: ,publickey\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Will attempt key: /home/fedora/.ssh/id_fedora_aws ED25519 SHA256:TVin5qUcXPxSU6ET0CPh5HQWfLaBZ3Y19q24vrOFNaY explicit\r\ndebug2: pubkey_prepare: done\r\ndebug1: Offering public key: /home/fedora/.ssh/id_fedora_aws ED25519 SHA256:TVin5qUcXPxSU6ET0CPh5HQWfLaBZ3Y19q24vrOFNaY explicit\r\ndebug3: send packet: type 50\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug3: receive packet: type 60\r\ndebug1: Server accepts key: /home/fedora/.ssh/id_fedora_aws ED25519 SHA256:TVin5qUcXPxSU6ET0CPh5HQWfLaBZ3Y19q24vrOFNaY explicit\r\ndebug3: sign_and_send_pubkey: using [email protected] with ED25519 SHA256:TVin5qUcXPxSU6ET0CPh5HQWfLaBZ3Y19q24vrOFNaY\r\ndebug3: sign_and_send_pubkey: signing using ssh-ed25519 SHA256:TVin5qUcXPxSU6ET0CPh5HQWfLaBZ3Y19q24vrOFNaY\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 52\r\ndebug1: Enabling compression at level 6.\r\nAuthenticated to 52.64.215.251 ([52.64.215.251]:22) using "publickey".\r\ndebug1: pkcs11_del_provider: called, provider_id = (null)\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver_listen: temporary control path /home/fedora/.ansible/cp/2e9872eaf2.t4gJU72WdAKTs1aX\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug1: channel 0: new mux listener [/home/fedora/.ansible/cp/2e9872eaf2] (inactive timeout: 0)\r\ndebug3: muxserver_listen: mux listener channel 0 fd 4\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug3: set_sock_tos: set socket 3 IP_TOS 0x20\r\ndebug1: control_persist_detach: backgrounding master process\r\ndebug2: control_persist_detach: background process is 2827\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug1: pledge: id\r\ndebug3: client_repledge: enter\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug2: fd 5 setting O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug1: channel 1: new mux-control [mux-control] (inactive timeout: 0)\r\ndebug3: channel_post_mux_listener: new mux channel 1 fd 5\r\ndebug3: mux_master_read_cb: channel 1: hello sent\r\ndebug2: set_control_persist_exit_time: cancel scheduled exit\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: mux_master_process_hello: channel 1 client version 4\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\ndebu
Source: ansible/ansible