Troubleshooting
See molecule for specific molecule troubleshooting.
See dist-upgrade fails for grub-pc.
Driver vagrant does not provide a schema
Vagrant driver does have a schema and will always generate a warning.
WARNING Driver vagrant does not provide a schema.
VERR_CFGM_NOT_ENOUGH_SPACE
Vagrant path length exceeded for Molecule test (see virtualization manager).
fatal: [localhost]: FAILED! => {
"changed": false,
"cmd": [
"/usr/bin/vagrant",
"up",
"--no-provision"
],
"rc": 1
}
STDERR:
### YYYY-MM-DD 20:32:26 ###
### YYYY-MM-DD 20:32:26 ###
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "b3415658-8f60-4026-8375-f6ec52014db5", "--type", "headless"]
Stderr: VBoxManage: error: Failed to construct device 'ichac97' instance #0 (VERR_CFGM_NOT_ENOUGH_SPACE)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
MSG:
Failed to start the VM(s): See log file '.../vagrant.err'
Molecule creates a VM name using
- Molecule test name: my_test
- Molecule image test name: test-case-vm
- Image box name: inception-of-things-trixie
- OS used: debian
- Network: private_network
- Random UUID hash: 36 characters
Use shorter component names:
- VM instance name in molecule.yml.
- Rename molecule test to shorter name.
- Extreme cases may require cloning repo with a shorter root repository name.
my_role/molecule/my_test/molecule.yml
platforms:
- name: 'test-case-vm'
box: 'inception-of-things/trixie'
interfaces:
- network_name: 'private_network'
Failed to lock apt for exclusive operation
Use root to configure and test VM instance. All Molecule setup/teardown steps require root user. Always use become when creating Molecule tests or setup an ansible user after VM turnup to apply ansible tasks.
- name: 'Molecule testing step'
hosts: 'all'
gather_facts: false
# Always **become** ssh.remote_user when creating Molecule tests or setup an
# ansible user after VM turnup to apply ansible tasks.
become: true
Flaky VM
A previous molecule test likely not cleaned up properly.
# Clean all VMs and re-run.
vagrant global-status
vagrant destroy {ID}
vagrant box list
vagrant box destroy {ID}
Check GUI for additional VMs if needed.
Permission denied (publickey,password)
Vagrant SSH keys should automatically be set in images. Manual images may have forgotten to install these keys.
TASK [Install packages] ********************************************************
included: {ROLE} for 10.2.2.39
fatal: [10.2.2.39]: UNREACHABLE! => {
"changed": false,
"unreachable": true
}
MSG:
vagrant@10.2.2.39: Permission denied (publickey,password).
For Debian Images
| User | password | vagrant public key |
|---|---|---|
| root | vagrant | ✘ |
| vagrant | vagrant | ✔ |
Be sure to become root after connecting to run tests.
Confirm keys are set correctly in VM.
ls -l /home/vagrant/.ssh/id.*
> 0400 vagrant:vagrant id.*
# Install VM keys and re-create base image if needed.
wget https://raw.githubusercontent.com/hashicorp/vagrant/refs/heads/main/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys
Enable debugging if issue continues.
converge.yml
0644 {USER}:{USER}
- ansible.builtin.debug:
msg: '{{ ansible_ssh_private_key_file }}'
ERROR! couldn't resolve module/action 'vagrant'
Molecule 25.2.0+ is a bad release that broke vagrant modules.
Resolved via auto configured environments
Update configured development environment.
Issue left for clarity.
molecule create
> WARNING Driver vagrant does not provide a schema.
> INFO default scenario test matrix: dependency, create, prepare, converge
> INFO Performing prerun with role_name_check=0...
> INFO Running default > dependency
> WARNING Skipping, missing the requirements file.
> WARNING Skipping, missing the requirements file.
> INFO Running default > create
> ERROR! couldn't resolve module/action 'vagrant'. This often indicates a misspelling, missing collection, or incorrect module path.
>
> The error appears to be in '.../molecule_plugins/vagrant/playbooks/create.yml': line 8, column 7, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> tasks:
> - name: Create molecule instance(s) # noqa fqcn[action]
> ^ here
Install Molecule 25.1.0 as a temporary workaround.
Use auto configured environments
This is only a temporary solution until alternatives are found. Molecule developers quite frankly shit out a half-form glob, tosseed it over the fence, yelled fuck you, and walked away. Most consumers of Molecule have locked to 25.1 as the workarounds are ineffective or created a ton of unnecessary churn.
This is a serious breakage with an extreme lack of reponse from developers.
pip install --force-reinstall -v 'molecule==25.1.0'