question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Molecule 3.1+ docker image broken

See original GitHub issue

Issue Type

  • Bug report

Molecule and Ansible details

$ docker run -it --entrypoint /bin/sh quay.io/ansible/molecule:3.1.2
/ # molecule --version
Failed to load driver entry point Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/molecule_containers/driver.py", line 9, in <module>
    from molecule.driver.docker import Docker as DriverBackend
ModuleNotFoundError: No module named 'molecule.driver.docker'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/molecule/api.py", line 45, in drivers
    pm.load_setuptools_entrypoints("molecule.driver")
  File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.8/site-packages/molecule_containers/driver.py", line 11, in <module>
    from molecule.driver.podman import Podman as DriverBackend
ModuleNotFoundError: No module named 'molecule.driver.podman'

molecule 0.0.0
   ansible==2.10.2 python==3.8
/ # ansible --version
ansible 2.10.2
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.6 (default, Oct  5 2020, 00:23:48) [GCC 10.2.0]

Molecule installation method (one of):

  • docker (quay.io)

Ansible installation method (one of):

  • docker (quay.io) Detail any linters or test runners used:

Desired Behavior

Download docker image and run tests with it

Actual Behaviour

Running molecule --version makes the container barf errors.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
foursteppercommented, Oct 19, 2020

@bodsch try installing molecule-docker with pip, that should fix the issue

@Thulium-Drake would it be possible for you try this as well? The error message shouldn’t appear when trying to poll for the version, but just to see if it fixes the issue for you as well

1reaction
bodschcommented, Oct 19, 2020

I have a similar problem. All my Travis checks are failing suddenly.

With molecule 3.0.8 the builds are successful again.

For Example

$ pip --version
pip 20.1 from /home/travis/virtualenv/python3.6.10/lib/python3.6/site-packages/pip (python 3.6)
travis_fold:start:install

$ pip install molecule docker ansible-lint flake8
Collecting molecule
  Downloading molecule-3.1.2-py3-none-any.whl (235 kB)

Collecting docker
  Downloading docker-4.3.1-py2.py3-none-any.whl (145 kB)

Collecting ansible-lint
  Downloading ansible_lint-4.3.5-py2.py3-none-any.whl (77 kB)

...

molecule test
---
dependency:
  name: galaxy
driver:
  name: docker
lint: 'set -e

  yamllint .

  ansible-lint .

  flake8

  '
platforms:
  - command: ${MOLECULE_DOCKER_COMMAND:-""}
    image: geerlingguy/docker-${MOLECULE_DISTRO:-debian10}-ansible:latest
    name: instance
    pre_build_image: true
    privileged: true
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
  config_options:
    defaults:
      deprecation_warnings: true
      stdout_callback: yaml
  name: ansible
scenario:
  test_sequence:
    - lint
    - destroy
    - dependency
    - syntax
    - create
    - prepare
    - converge
    - destroy
verifier:
  name: testinfra

ERROR: Failed to pre-validate.

{'driver': [{'name': ['unallowed value docker']}]}
The command "molecule test" exited with 1.

Done. Your build exited with 1.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Molecule Use Cases
Common Molecule Use Cases . Running inside a container . Molecule is built into a Docker image by the Ansible Creator...
Read more >
Notes to Instructors
Activity 3.1 A Quick Review of the Properties of Water ... Experiment 3: To completely fill a sealed 500-mL glass container that contains...
Read more >
Protein-ligand docking - Galaxy Training!
This produces an SVG image of all the structures generated ordered by molecular weight. Image showing structures of compounds from ChEMBL. Figure 2:...
Read more >
eclipse-mosquitto - Official Image - Docker Hub
Eclipse Mosquitto is an open source message broker which implements MQTT version 5, 3.1.1 and 3.1.
Read more >
Ammonia | NH3 - PubChem
Ammonia is an inorganic compound composed of a single nitrogen atom ... 3.1Computed Properties ... Ammonia in container may explode in heat of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found