Upgrading from ansible-core-2.12 to ansible-11.8.0 (ansible-core-2.18.7) and basic tasks are failing. The issues seem to happen only in molecule testing.
I am working in a vscode devcontainer on macOS 15 and Docker Desktop
sw_vers
ProductName: macOS
ProductVersion: 15.6
BuildVersion: 24G84
docker --version
Docker version 28.3.3-1, build 980b85681696fbd95927fd8ded8f6d91bdca95b0
docker desktop
4.44.0 (201307)
python -V
Python 3.13.6
ansible --version
ansible [core 2.18.7]
config file = None
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) [Clang 20.1.4 ] (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
molecule --version
[DEPRECATION WARNING]: [defaults]collections_paths option. Reason: does not fit
var naming standard, use the singular form collections_path instead
Alternatives: none. This feature will be removed in version 2.19. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATED] [defaults]collections_paths option. Reason: does not fit var naming standard, use the singular form collections_path instead
Alternatives: none, to be removed in 2.19
molecule 25.7.0 using python 3.13
ansible:2.18.7
docker:23.7.0 from molecule_plugins requiring collections: community.docker>=3.10.2 ansible.posix>=1.4.0
gce:23.7.0 from molecule_plugins requiring collections: google.cloud>=1.0.2 community.crypto>=1.8.0
podman:23.7.0 from molecule_plugins requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0
ec2:23.7.0 from molecule_plugins
openstack:23.7.0 from molecule_plugins requiring collections: openstack.cloud>=2.1.0
azure:23.7.0 from molecule_plugins
vagrant:23.7.0 from molecule_plugins
containers:23.7.0 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1
default:25.7.0 from molecule
uv pip list | grep molecule-
molecule-plugins 23.7.0
My molecule converge.yml:
---
- name: Converge
hosts: all
gather_facts: true
become: true
pre_tasks:
- name: Package update (apt)
ansible.builtin.apt:
update_cache: true
changed_when: false
when: ansible_os_family == 'Debian'``
Non-debug and non-verbose:
$ molecule converge
WARNING Driver docker does not provide a schema.
WARNING Driver docker does not provide a schema.
INFO default ➜ discovery: scenario test matrix: dependency, create, prepare, converge
INFO default ➜ prerun: Performing prerun with role_name_check=0...
INFO default ➜ dependency: Starting
WARNING default ➜ dependency: Skipping, missing the requirements file.
WARNING default ➜ dependency: Skipping, missing the requirements file.
INFO default ➜ dependency: Completed
INFO default ➜ create: Starting
WARNING default ➜ create: Skipping, instances already created.
INFO default ➜ create: Completed
INFO default ➜ prepare: Starting
WARNING default ➜ prepare: Skipping, prepare playbook not configured.
INFO default ➜ prepare: Completed
INFO default ➜ converge: Starting
INFO default ➜ converge: ansible-playbook version: ansible-playbook
config file = None
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible-playbook
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
INFO Sanity checks: 'docker'
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [jammy]
TASK [Package update (apt)] ****************************************************
fatal: [jammy]: FAILED! => {"changed": false, "module_stderr": "", "module_stdout": "", "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error", "rc": 0}
PLAY RECAP *********************************************************************
jammy : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
CRITICAL Ansible return code was 2, command was: ansible-playbook --inventory /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory --skip-tags molecule-notest,notest /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/converge.yml[/dim]
Debug and verbose
$ MOLECULE_LOG_LEVEL=DEBUG MOLECULE_DEBUG=1 molecule converge -- -vvv
DEBUG default ➜ validate: Validating schema /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/molecule.yml.
WARNING Driver docker does not provide a schema.
DEBUG default ➜ validate: Validating schema /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/molecule.yml.
WARNING Driver docker does not provide a schema.
INFO default ➜ discovery: scenario test matrix: dependency, create, prepare, converge
INFO default ➜ prerun: Performing prerun with role_name_check=0...
INFO default ➜ dependency: Starting
WARNING default ➜ dependency: Skipping, missing the requirements file.
WARNING default ➜ dependency: Skipping, missing the requirements file.
INFO default ➜ dependency: Completed
INFO default ➜ create: Starting
WARNING default ➜ create: Skipping, instances already created.
INFO default ➜ create: Completed
INFO default ➜ prepare: Starting
WARNING default ➜ prepare: Skipping, prepare playbook not configured.
INFO default ➜ prepare: Completed
INFO default ➜ converge: Starting
INFO default ➜ converge: ansible-playbook version: ansible-playbook
config file = None
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible-playbook
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
INFO Sanity checks: 'docker'
DEBUG: ANSIBLE ENVIRONMENT:
ANSIBLE_CONFIG: /home/vscode/.ansible/tmp/molecule.ZdnW.default/ansible.cfg
ANSIBLE_FORCE_COLOR: '1'
DEBUG: MOLECULE ENVIRONMENT:
MOLECULE_DEBUG: 'True'
MOLECULE_DEPENDENCY_NAME: galaxy
MOLECULE_DRIVER_NAME: docker
MOLECULE_ENV_FILE: /workspace/collections/ansible_collections/realtime/logging/roles/alloy/.env.yml
MOLECULE_EPHEMERAL_DIRECTORY: /home/vscode/.ansible/tmp/molecule.ZdnW.default
MOLECULE_FILE: /home/vscode/.ansible/tmp/molecule.ZdnW.default/molecule.yml
MOLECULE_INSTANCE_CONFIG: /home/vscode/.ansible/tmp/molecule.ZdnW.default/instance_config.yml
MOLECULE_INVENTORY_FILE: /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory/ansible_inventory.yml
MOLECULE_LOG_LEVEL: DEBUG
MOLECULE_PROJECT_DIRECTORY: /workspace/collections/ansible_collections/realtime/logging/roles/alloy
MOLECULE_PROVISIONER_NAME: ansible
MOLECULE_SCENARIO_DIRECTORY: /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default
MOLECULE_SCENARIO_NAME: default
MOLECULE_STATE_FILE: /home/vscode/.ansible/tmp/molecule.ZdnW.default/state.yml
MOLECULE_VERIFIER_NAME: ansible
MOLECULE_VERIFIER_TEST_DIRECTORY: /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/tests
DEBUG: SHELL REPLAY:
ANSIBLE_CONFIG=/home/vscode/.ansible/tmp/molecule.ZdnW.default/ansible.cfg ANSIBLE_FORCE_COLOR=1 MOLECULE_DEBUG=True MOLECULE_DEPENDENCY_NAME=galaxy MOLECULE_DRIVER_NAME=docker MOLECULE_ENV_FILE=/workspace/collections/ansible_collections/realtime/logging/roles/alloy/.env.yml MOLECULE_EPHEMERAL_DIRECTORY=/home/vscode/.ansible/tmp/molecule.ZdnW.default MOLECULE_FILE=/home/vscode/.ansible/tmp/molecule.ZdnW.default/molecule.yml MOLECULE_INSTANCE_CONFIG=/home/vscode/.ansible/tmp/molecule.ZdnW.default/instance_config.yml MOLECULE_INVENTORY_FILE=/home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory/ansible_inventory.yml MOLECULE_LOG_LEVEL=DEBUG MOLECULE_PROJECT_DIRECTORY=/workspace/collections/ansible_collections/realtime/logging/roles/alloy MOLECULE_PROVISIONER_NAME=ansible MOLECULE_SCENARIO_DIRECTORY=/workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default MOLECULE_SCENARIO_NAME=default MOLECULE_STATE_FILE=/home/vscode/.ansible/tmp/molecule.ZdnW.default/state.yml MOLECULE_VERIFIER_NAME=ansible MOLECULE_VERIFIER_TEST_DIRECTORY=/workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/tests
ansible-playbook [core 2.18.7]
config file = /home/vscode/.ansible/tmp/molecule.ZdnW.default/ansible.cfg
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible-playbook
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) [Clang 20.1.4 ] (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
Using /home/vscode/.ansible/tmp/molecule.ZdnW.default/ansible.cfg as config file
host_list declined parsing /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory/ansible_inventory.yml as it did not pass its verify_file() method
script declined parsing /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory/ansible_inventory.yml as it did not pass its verify_file() method
Parsed /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory/ansible_inventory.yml inventory source with yaml plugin
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.
1 plays in /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/converge.yml
PLAYBOOK: converge.yml *********************************************************
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
task path: /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/converge.yml:2
<jammy> ESTABLISH DOCKER CONNECTION FOR USER: root
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', '/bin/sh -c \'( umask 77 && mkdir -p "` echo /tmp/.ansible/tmp `"&& mkdir "` echo /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695 `" && echo ansible-tmp-1754933818.4667227-8682-116366923936695="` echo /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695 `" ) && sleep 0\'']
<jammy> Attempting python interpreter discovery
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', '/bin/sh -c \'echo PLATFORM; uname; echo FOUND; command -v \'"\'"\'python3.13\'"\'"\'; command -v \'"\'"\'python3.12\'"\'"\'; command -v \'"\'"\'python3.11\'"\'"\'; command -v \'"\'"\'python3.10\'"\'"\'; command -v \'"\'"\'python3.9\'"\'"\'; command -v \'"\'"\'python3.8\'"\'"\'; command -v \'"\'"\'/usr/bin/python3\'"\'"\'; command -v \'"\'"\'python3\'"\'"\'; echo ENDFOUND && sleep 0\'']
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', "/bin/sh -c '/usr/bin/python3.10 && sleep 0'"]
<jammy> Python interpreter discovery fallback (unsupported Linux distribution: ubuntu)
Using module file /home/vscode/.venv/lib/python3.13/site-packages/ansible/modules/setup.py
<jammy> PUT /home/vscode/.ansible/tmp/ansible-local-8664b5y3y493/tmptz86g5en TO /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695/AnsiballZ_setup.py
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', "/bin/sh -c 'chmod u+rwx /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695/ /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695/AnsiballZ_setup.py && sleep 0'"]
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', '/bin/sh -c \'sudo -H -S -n -u root /bin/sh -c \'"\'"\'echo BECOME-SUCCESS-sgxabdpfbzvvrdmmvprdiovxdgpnrxsc ; /usr/bin/python3.10 /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695/AnsiballZ_setup.py\'"\'"\' && sleep 0\'']
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', "/bin/sh -c 'rm -f -r /tmp/.ansible/tmp/ansible-tmp-1754933818.4667227-8682-116366923936695/ > /dev/null 2>&1 && sleep 0'"]
ok: [jammy]
TASK [Package update (apt)] ****************************************************
task path: /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/converge.yml:10
<jammy> ESTABLISH DOCKER CONNECTION FOR USER: root
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', '/bin/sh -c \'( umask 77 && mkdir -p "` echo /tmp/.ansible/tmp `"&& mkdir "` echo /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890 `" && echo ansible-tmp-1754933819.4123073-8800-78678785547890="` echo /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890 `" ) && sleep 0\'']
Using module file /home/vscode/.venv/lib/python3.13/site-packages/ansible/modules/apt.py
<jammy> PUT /home/vscode/.ansible/tmp/ansible-local-8664b5y3y493/tmpx1zu_qvj TO /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890/AnsiballZ_apt.py
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', "/bin/sh -c 'chmod u+rwx /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890/ /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890/AnsiballZ_apt.py && sleep 0'"]
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', '/bin/sh -c \'sudo -H -S -n -u root /bin/sh -c \'"\'"\'echo BECOME-SUCCESS-stqmenxchjgirbmsuaaohbfkmdkeiodt ; /usr/bin/python3.10 /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890/AnsiballZ_apt.py\'"\'"\' && sleep 0\'']
<jammy> EXEC ['/usr/bin/docker', b'exec', b'-i', 'jammy', '/bin/sh', '-c', "/bin/sh -c 'rm -f -r /tmp/.ansible/tmp/ansible-tmp-1754933819.4123073-8800-78678785547890/ > /dev/null 2>&1 && sleep 0'"]
fatal: [jammy]: FAILED! => {
"changed": false,
"module_stderr": "",
"module_stdout": "",
"msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error",
"rc": 0
}
PLAY RECAP *********************************************************************
jammy : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
CRITICAL Ansible return code was 2, command was: ansible-playbook --diff --inventory /home/vscode/.ansible/tmp/molecule.ZdnW.default/inventory --skip-tags molecule-notest,notest -vvv /workspace/collections/ansible_collections/realtime/logging/roles/alloy/molecule/default/converge.yml[/dim]
I followed many of the posts I could find regarding “No start of json char found” and spent a lot of time with GPT-5 without any success. The posts and GPT keep stating this issue is a container problem. I do not agree.
Interactive shell and CLI works as expected. Ansible raw
works:
---
- name: Converge
hosts: all
gather_facts: true
become: true
pre_tasks:
- name: Update
raw: |
DEBIAN_FRONTEND=noninteractive apt-get update
$ molecule converge
WARNING Driver docker does not provide a schema.
WARNING Driver docker does not provide a schema.
INFO default ➜ discovery: scenario test matrix: dependency, create, prepare, converge
INFO default ➜ prerun: Performing prerun with role_name_check=0...
INFO default ➜ dependency: Starting
WARNING default ➜ dependency: Skipping, missing the requirements file.
WARNING default ➜ dependency: Skipping, missing the requirements file.
INFO default ➜ dependency: Completed
INFO default ➜ create: Starting
WARNING default ➜ create: Skipping, instances already created.
INFO default ➜ create: Completed
INFO default ➜ prepare: Starting
WARNING default ➜ prepare: Skipping, prepare playbook not configured.
INFO default ➜ prepare: Completed
INFO default ➜ converge: Starting
INFO default ➜ converge: ansible-playbook version: ansible-playbook
config file = None
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible-playbook
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
INFO Sanity checks: 'docker'
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [jammy]
TASK [Update] ******************************************************************
changed: [jammy]
PLAY RECAP *********************************************************************
jammy : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO default ➜ converge: Completed
(ansible-playbooks) vscode ➜ .../realtime/logging/roles/alloy (main) $ molecule converge
WARNING Driver docker does not provide a schema.
WARNING Driver docker does not provide a schema.
INFO default ➜ discovery: scenario test matrix: dependency, create, prepare, converge
INFO default ➜ prerun: Performing prerun with role_name_check=0...
INFO default ➜ dependency: Starting
WARNING default ➜ dependency: Skipping, missing the requirements file.
WARNING default ➜ dependency: Skipping, missing the requirements file.
INFO default ➜ dependency: Completed
INFO default ➜ create: Starting
WARNING default ➜ create: Skipping, instances already created.
INFO default ➜ create: Completed
INFO default ➜ prepare: Starting
WARNING default ➜ prepare: Skipping, prepare playbook not configured.
INFO default ➜ prepare: Completed
INFO default ➜ converge: Starting
INFO default ➜ converge: ansible-playbook version: ansible-playbook
config file = None
configured module search path = ['/home/vscode/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/vscode/.venv/lib/python3.13/site-packages/ansible
ansible collection location = /home/vscode/.ansible/collections:/usr/share/ansible/collections
executable location = /home/vscode/.venv/bin/ansible-playbook
python version = 3.13.6 (main, Aug 8 2025, 17:10:04) (/home/vscode/.venv/bin/python)
jinja version = 3.1.6
libyaml = True
INFO Sanity checks: 'docker'
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [jammy]
TASK [Update] ******************************************************************
changed: [jammy]
PLAY RECAP *********************************************************************
jammy : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
INFO default ➜ converge: Completed
Any help would be appreciated.
I think this is a molecule problem, but I am starting here.