saltstack / saltstack/salt

[BUG] User creation never happens on Debian 11 Bullseye

Open
#62,237 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
I am using a user.present state to create a user, and requiring the user in several states. When I call sudo salt-call state.apply test=False, the user.present state does not create the user. The log for the state says

----------
          ID: foo
    Function: user.present
      Result: None
     Comment: User foo set to be added
     Changes:
----------

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit: on-prem libvirt/Vagrant hypervisor running Debian Buster 64; virtualized Debian Bullseye 64 master and minions
  • jails if it is FreeBSD

Steps to Reproduce the behavior

  1. Install Saltstack 3004.2 on Debian Bullseye 64, using boot strap script
  2. create and apply a state like:
foo:
  user.present:
    - shell: /bin/bash
    - home: /home/foo
    - password: ...
    - optional_groups:
      - libvirt
      - salt
      - vagrant
  ssh_auth:
    - present
    - user: foo
    - source: salt://private/keys/foo.pub
    - require:
      - user: foo

Expected behavior
The user foo is created

Relevant parts of log

[DEBUG   ] LazyLoaded ssh_auth.present
[DEBUG   ] LazyLoaded user.present
[DEBUG   ] LazyLoaded file.managed
[INFO    ] Running state [foo] at time 04:14:04.550460
[DEBUG   ] LazyLoaded group.info                                                                      
[DEBUG   ] Optional group "libvirt" for user "foo" is not present
[DEBUG   ] LazyLoaded shadow.info
[INFO    ] Running state [/home/foo/.bashrc] at time 04:14:04.566879
[INFO    ] Executing state file.managed for [/home/foo/.bashrc]
[DEBUG   ] LazyLoaded file.user_to_uid
[ERROR   ] User foo is not available
[INFO    ] Completed state [/home/foo/.bashrc] at time 04:14:04.571742 (duration_in_ms=4.863)         
[INFO    ] Running state [foo] at time 04:14:04.572454
[INFO    ] Executing state ssh_auth.present for [foo]                                                 
[DEBUG   ] LazyLoaded cp.get_url
[DEBUG   ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'devel.bar.lan', 'tcp://1$2.168.10.100:4506')
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://192.168.10.100:4506
[DEBUG   ] Trying to connect to: tcp://192.168.10.100:4506
[DEBUG   ] In saltenv 'devel', looking at rel_path 'private/keys/foo@bar.pub' to reso$ve 'salt://private/keys/foo@bar.pub'
[DEBUG   ] In saltenv 'devel', ** considering ** path '/var/cache/salt/minion/files/devel/private/key$/foo@bar.pub' to resolve 'salt://private/keys/foo@bar.pub'
[DEBUG   ] Fetching file from saltenv 'devel', ** attempting ** 'salt://private/keys/foo@bar.pub'
[DEBUG   ] No dest file found
[INFO    ] Fetching file from saltenv 'devel', ** done ** 'private/keys/foo@bar.pub'
[DEBUG   ] In saltenv 'devel', looking at rel_path 'private/keys/foo@bar.pub' to reso$ve 'salt://private/keys/foo@bar.pub'
[DEBUG   ] In saltenv 'devel', ** considering ** path '/var/cache/salt/minion/files/devel/private/key$/foo@bar.pub' to resolve 'salt://private/keys/foo@bar.pub'
[DEBUG   ] LazyLoaded ssh.set_auth_key
[DEBUG   ] LazyLoaded test.ping
[ERROR   ] Failed to add the ssh key. Is the home directory available, and/or does the key file exist$
[INFO    ] Completed state [foo] at time 04:14:04.651674 (duration_in_ms=79.219)

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

salt-call --versions-report:


Salt Version:
          Salt: 3004.2

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.3
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.0
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.9.7
        pygit2: Not Installed
        Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
  python-gnupg: Not Installed
        PyYAML: 5.3.1
         PyZMQ: 20.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: debian 11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.10.0-13-amd64
        system: Linux
       version: Debian GNU/Linux 11 bullseye

Additional context

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 Debian Bullseye case with Salt 3004.2 using the shown user.present and ssh_auth.present states. Start by tracing the user.present execution and its require relationship to ssh_auth.present, then compare the state output with the expected creation of user foo and successful SSH-key setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
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.