Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmidecode is missing from host #204

Open
gboutry opened this issue Dec 4, 2024 · 1 comment
Open

dmidecode is missing from host #204

gboutry opened this issue Dec 4, 2024 · 1 comment

Comments

@gboutry
Copy link

gboutry commented Dec 4, 2024

Bug Description

A sunbeam user encountered this issue while trying to deploy using this operator. Dmidecode is not present by default in his environment.

To Reproduce

  1. juju add-machine --base [email protected]
  2. juju wait-for machine 0 --query='status=="started"'
  3. juju ssh 0 sudo apt remove --yes dmidecode
  4. juju deploy k8s --channel 1.31/beta --to 0
  5. juju wait-for unit k8s/0 --query='workload-status=="error" && agent-status=="idle"'

Environment

1.31/beta on a 22.04 host, charm deployed by sunbeam.

Relevant log output

unit-k8s-0: 10:21:51 INFO unit.k8s/0.juju-log Running legacy hooks/install.
unit-k8s-0: 10:21:51 ERROR unit.k8s/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-k8s-0/charm/./src/charm.py", line 996, in <module>
    ops.main(K8sCharm)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/ops/__init__.py", line 343, in __call__
    return _main.main(charm_class=charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/ops/_main.py", line 541, in main
    manager = _Manager(charm_class, use_juju_for_storage=use_juju_for_storage)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/ops/_main.py", line 424, in __init__
    self.charm = self._make_charm(self.framework, self.dispatcher)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/ops/_main.py", line 427, in _make_charm
    charm = self._charm_class(framework)
  File "/var/lib/juju/agents/unit-k8s-0/charm/./src/charm.py", line 155, in __init__
    self.distributor = TokenDistributor(self, self.get_node_name(), self.api_manager)
  File "/var/lib/juju/agents/unit-k8s-0/charm/./src/charm.py", line 283, in get_node_name
    if self.xcp.name == "aws":
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/charms/interface_external_cloud_provider.py", line 76, in name
    vendor = self._vendor
  File "/usr/lib/python3.10/functools.py", line 981, in __get__
    val = self.func(instance)
  File "/var/lib/juju/agents/unit-k8s-0/charm/venv/charms/interface_external_cloud_provider.py", line 67, in _vendor
    vendor = check_output(["dmidecode", "-s", "system-manufacturer"])
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode'
unit-k8s-0: 10:21:51 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1

Additional context

User reports physical machine is installed with jammy minimal

@addyess
Copy link
Contributor

addyess commented Dec 4, 2024

yes, dmidecode is used by the charm to determine which cloud vendor the machine is hosted on (openstack, aws, azure...etc) I suppose we can improve the charm to not rely on it, or to ensure its installed with apt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants