saltstack / saltstack/salt

[BUG] salt-cloud -Q -ldebug exits with python traceback (Hetzner, Debian 11)

Open
#62,023 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
On Debian 11, command salt-cloud -Q -ldebug on Hetzner provider, suddenly started returning traceback.

[DEBUG ] https://api.hetzner.cloud:443 "GET /v1/servers?page=1&per_page=50 HTTP/1.1" 200 18914
[DEBUG ] Failed to execute 'hetzner.list_nodes()' while querying for running nodes: init() got an unexpected keyword argument 'id'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/cloud/init.py", line 2345, in run_parallel_map_providers_query
salt.utils.data.simple_types_filter(cloud.cloudsdata["fun"]),
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in call
return self.loader.run(run_func, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
return _func_or_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/cloud/clouds/hetzner.py", line 199, in list_nodes
nodes = list_nodes_full()
File "/usr/lib/python3/dist-packages/salt/cloud/clouds/hetzner.py", line 174, in list_nodes_full
for node in client.servers.get_all():
File "/usr/lib/python3/dist-packages/hcloud/servers/client.py", line 377, in get_all
return super(ServersClient, self).get_all(name=name, label_selector=label_selector, status=status)
File "/usr/lib/python3/dist-packages/hcloud/core/client.py", line 57, in get_all
return self._get_all(self.get_list, self.results_list_attribute_name, *args, **kwargs)
File "/usr/lib/python3/dist-packages/hcloud/core/client.py", line 42, in _get_all
page_result = list_function(page=page, per_page=self.max_per_page, *args, **kwargs)
File "/usr/lib/python3/dist-packages/hcloud/servers/client.py", line 362, in get_list
ass_servers = [BoundServer(self, server_data) for server_data in response['servers']]
File "/usr/lib/python3/dist-packages/hcloud/servers/client.py", line 362, in
ass_servers = [BoundServer(self, server_data) for server_data in response['servers']]
File "/usr/lib/python3/dist-packages/hcloud/servers/client.py", line 48, in init
ipv6_network = IPv6Network(**public_net['ipv6'])
TypeError: init() got an unexpected keyword argument 'id'

It started happening today. Literally, yesterday I was running same command without any issues.

Setup
Salt APT source:
https://repo.saltproject.io/py3/debian/11/amd64/latest bullseye main

/etc/salt/cloud.providers.d/vw-hetzner.conf

vw-hetz:
  driver: hetzner
  key: ********

Quick fix

pip install --force-reinstall --upgrade hcloud

This bumps python3-hcloud from 1.10.0 to 1.16.0 with some of its dependencies. After that it works fine again.

Looks like there is no version dependency enforced in APT (dpkg):

# apt depends salt-cloud
salt-cloud
  Depends: python3-libcloud
  Depends: salt-common (= 3004.1+ds-1)
  Depends: <python3:any>
    python3
  Recommends: python3-netaddr
  Suggests: python3-botocore

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt/cloud/clouds/hetzner.py, especially list_nodes_full(), and compare its hcloud usage with the traceback from hcloud 1.10.0. Review the Salt APT packaging metadata for salt-cloud and its Python dependencies, then verify that salt-cloud -Q -ldebug completes successfully with the supported hcloud version.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.