saltstack / saltstack/salt

[BUG] Creating a salt-master vm on azurearm fails

Open
#58,096 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation help-wanted severity-high time-estimate-sprint
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

following the cloud map guide, specifically the part on setting up new salt master https://docs.saltstack.com/en/latest/topics/cloud/map.html#setting-up-new-salt-masters, i have the map file:

azure_ubuntu:
  - smvm:
      make_master: True

backed up by the following profile:

azure_ubuntu:
  provider: my-azurearm-config
  image: Canonical|UbuntuServer|18.04-LTS|latest
  size: Basic_A0
  #location: westus
  #network: my_network
  #subnet: subnet
  #resource_group: my_rg
  allocate_public_ip: True
  ssh_username: azureuser
  ssh_publickeyfile: /root/.ssh/id_rsa.pub
  ssh_keyfile: /root/.ssh/id_rsa
  disable_password_authentication: True

Launching a regular instance works just fine however when make_master is True, salt-cloud trows the following error

[ERROR   ] There was a query error: dictionary update sequence element #0 has length 1; 2 is required
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/cloud/cli.py", line 352, in run
    ret = mapper.run_map(dmap)
  File "/usr/lib/python3/dist-packages/salt/cloud/__init__.py", line 2126, in run_map
    out = self.create(master_profile, local_master=local_master)
  File "/usr/lib/python3/dist-packages/salt/cloud/__init__.py", line 1242, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python3/dist-packages/salt/cloud/clouds/azurearm.py", line 1362, in create
    ret = __utils__["cloud.bootstrap"](vm_, __opts__)
  File "/usr/lib/python3/dist-packages/salt/utils/cloud.py", line 547, in bootstrap
    master_conf = master_config(opts, vm_)
  File "/usr/lib/python3/dist-packages/salt/utils/cloud.py", line 361, in master_config
    "master", vm_, opts, default={}, search_global=True
ValueError: dictionary update sequence element #0 has length 1; 2 is required

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

Reproduce the failure with the shown Azure ARM map and profile, then inspect salt/cloud/clouds/azurearm.py around create and salt/utils/cloud.py around bootstrap and master_config. Done means creating the salt master with make_master succeeds without the reported ValueError while regular Azure ARM instance creation continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.