You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Molecule does not crash when /bin/bash is not installed. /bin/sh should be good enough.
Actual Behaviour
Molecule (with docker plugin) crashes in docker sanity check stage. It tries to execute /bin/bash even when it's not installed, which results in an unhandled FileNotFoundError:
--> Sanity checks: 'docker'
Traceback (most recent call last):
File "/builds/sio/server_common/venv/bin/molecule", line 8, in <module>
sys.exit(main())
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/command/test.py", line 148, in test
base.execute_cmdline_scenarios(scenario_name, args, command_args)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/command/base.py", line 104, in execute_cmdline_scenarios
execute_scenario(scenario)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/command/base.py", line 146, in execute_scenario
execute_subcommand(scenario.config, action)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/command/base.py", line 135, in execute_subcommand
return command(config).execute()
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/command/destroy.py", line 108, in execute
self._config.provisioner.destroy()
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/provisioner/ansible.py", line 702, in destroy
pb.execute()
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/provisioner/ansible_playbook.py", line 107, in execute
result = util.run_command(self._ansible_command, debug=self._config.debug)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/molecule/util.py", line 151, in run_command
return run(args, env=env, stdout=stdout, stderr=stderr, echo=echo or debug)
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/subprocess_tee/__init__.py", line 88, in run
result = loop.run_until_complete(_stream_subprocess(cmd, **kwargs))
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/builds/sio/server_common/venv/lib/python3.8/site-packages/subprocess_tee/__init__.py", line 32, in _stream_subprocess
process = await asyncio.create_subprocess_shell(
File "/usr/lib/python3.8/asyncio/subprocess.py", line 216, in create_subprocess_shell
transport, protocol = await loop.subprocess_shell(
File "/usr/lib/python3.8/asyncio/base_events.py", line 1597, in subprocess_shell
transport = await self._make_subprocess_transport(
File "/usr/lib/python3.8/asyncio/unix_events.py", line 197, in _make_subprocess_transport
transp = _UnixSubprocessTransport(self, protocol, args, shell,
File "/usr/lib/python3.8/asyncio/base_subprocess.py", line 36, in __init__
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "/usr/lib/python3.8/asyncio/unix_events.py", line 789, in _start
self._proc = subprocess.Popen(
File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/bash'
What changed in-between was switching from sh to subprocess_tee library and considering that molecule does not specify any shell itself, this is an upstream bug. Please raise it at https://github.com/pycontribs/subprocess-tee/issues and as soon we fix it I will update molecule to require a version of subprocess-tee that has the fix in it.
It is not unreasonable to assume that some platforms may not have bash as default shell.
Issue Type
Molecule and Ansible details
Molecule installation method (one of):
Ansible installation method (one of):
Detail any linters or test runners used:
Desired Behavior
Molecule does not crash when /bin/bash is not installed. /bin/sh should be good enough.
Actual Behaviour
Molecule (with docker plugin) crashes in docker sanity check stage. It tries to execute /bin/bash even when it's not installed, which results in an unhandled FileNotFoundError:
Full log: https://gitlab.com/sio/server_common/-/jobs/823643538
Molecule 3.1.5 worked fine on the same runner (without /bin/bash).
The text was updated successfully, but these errors were encountered: