user.add not working + multiple returns

84 views
Skip to first unread message

Donnie Kim

unread,
Feb 23, 2021, 10:26:59 AM2/23/21
to Salt-users
Hello,

I am very new to salt and trying to learn and got stuck on adding a new user here are the outputs in debug mode:

donnie@dirac /e/salt [11]> sudo salt 'dirac' user.add 'donnie' -l debug                                                       (base)
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/roots.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/roots.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: dirac
[DEBUG   ] Missing configuration file: /home/donnie/.saltrc
[DEBUG   ] Configuration file path: /etc/salt/master
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/roots.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/roots.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: dirac
[DEBUG   ] Missing configuration file: /home/donnie/.saltrc
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new AsyncZeroMQReqChannel for ('/var/lib/salt/pki/master', 'dirac_master', 'tcp://127.0.0.1:4506', 'clear')
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] LazyLoaded local_cache.get_load
[DEBUG   ] Reading minion list from /var/cache/salt/master/jobs/6b/6ddae9c0d124996d1f11d9262c9d305fec2ad89f145e66be6b2517cdcb740c/.minions.p
[DEBUG   ] get_iter_returns for jid 20210222222544338511 sent to {'dirac'} will timeout at 22:25:49.364275
[DEBUG   ] jid 20210222222544338511 return from dirac
[DEBUG   ] return event: {'dirac': {'ret': False, 'retcode': 9, 'jid': '20210222222544338511'}}
[DEBUG   ] LazyLoaded nested.output
dirac:
    False
[DEBUG   ] jid 20210222222544338511 return from dirac
[DEBUG   ] return event: {'dirac': {'ret': False, 'retcode': 9, 'jid': '20210222222544338511'}}
[DEBUG   ] LazyLoaded nested.output
dirac:
    False
[DEBUG   ] jid 20210222222544338511 return from dirac
[DEBUG   ] return event: {'dirac': {'ret': False, 'retcode': 9, 'jid': '20210222222544338511'}}
[DEBUG   ] LazyLoaded nested.output
dirac:
    False
[DEBUG   ] jid 20210222222544338511 return from dirac
[DEBUG   ] return event: {'dirac': {'ret': False, 'retcode': 9, 'jid': '20210222222544338511'}}
[DEBUG   ] LazyLoaded nested.output
dirac:
    False
[DEBUG   ] jid 20210222222544338511 return from dirac
[DEBUG   ] return event: {'dirac': {'ret': False, 'retcode': 9, 'jid': '20210222222544338511'}}
[DEBUG   ] LazyLoaded nested.output
dirac:
    False
[DEBUG   ] jid 20210222222544338511 found all minions {'dirac'}
ERROR: Minions returned with non-zero exit code




Idk why it is not accepting nor why it returns multiple outputs. in fact, multiple outputs happen even on the case of successful commands. For example, below is the output of cmd.run:

donnie@dirac /e/salt> sudo salt 'dirac' cmd.run 'uptime'                                                                      (base)
dirac:
     22:52:04 up 10:52,  2 users,  load average: 0.56, 0.23, 0.19
dirac:
     22:52:04 up 10:52,  2 users,  load average: 0.56, 0.23, 0.19
dirac:
     22:52:04 up 10:52,  2 users,  load average: 0.56, 0.23, 0.19
dirac:
     22:52:04 up 10:52,  2 users,  load average: 0.56, 0.23, 0.19
dirac:
     22:52:04 up 10:52,  2 users,  load average: 0.56, 0.23, 0.19


Any help please?


Dafydd Jones (techneg.it)

unread,
Feb 23, 2021, 3:32:03 PM2/23/21
to salt-...@googlegroups.com
I can't comment on the multiple returns - I've never seen that myself; but you will find debugging execution modules such as 'user.add' much easier on the actual minion itself using 'salt-call -l debug user.add donnie' for example.

Dafydd

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/beeb6cbd-b0b8-498b-9854-9460f44ad4e3n%40googlegroups.com.

Dmitry Golubenko

unread,
Feb 23, 2021, 9:32:00 PM2/23/21
to salt-...@googlegroups.com
В Пн, 22/02/2021 в 20:52 -0800, Donnie Kim пишет:
> Idk why it is not accepting nor why it returns multiple outputs. in
> fact, multiple outputs happen even on the case of successful
> commands. For example, below is the output of cmd.run:

check if you have multiple salt-minion processes running.


Donnie Kim

unread,
Feb 24, 2021, 12:42:57 PM2/24/21
to Salt-users
Hi,

Your recommendation did help! The reason it kept failing was that the user "donnie" already existed. So I ran with different user name and it worked. 
Yeah, I am just playing in 1 machine so it is both master and a child... hence my name already was in place.

on multiple returns issue, i noticed that i am somehow running multiple minions and masters? Here are the service status reports:

donnie@dirac ~ [SIGINT]> sudo systemctl status salt-minion.service                                                                                                                                                                                                               (base)
● salt-minion.service - The Salt Minion
   Loaded: loaded (/lib/systemd/system/salt-minion.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-02-22 11:59:26 CST; 1 day 3h ago
     Docs: man:salt-minion(1)
           file:///usr/share/doc/salt/html/contents.html
 Main PID: 1056 (salt-minion)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/salt-minion.service
           ├─1056 /usr/bin/python3 /usr/bin/salt-minion
           ├─1125 /usr/bin/python3 /usr/bin/salt-minion
           └─1133 /usr/bin/python3 /usr/bin/salt-minion

Feb 22 22:23:43 dirac useradd[5594]: failed adding user 'donnie', data deleted
Feb 22 22:23:43 dirac salt-minion[1056]: [ERROR   ] Command '['useradd', '-m', 'donnie']' failed with return code: 9
Feb 22 22:23:43 dirac salt-minion[1056]: [ERROR   ] stderr: useradd: user 'donnie' already exists
Feb 22 22:23:43 dirac salt-minion[1056]: [ERROR   ] retcode: 9
Feb 22 22:25:44 dirac useradd[6371]: failed adding user 'donnie', data deleted
Feb 22 22:25:44 dirac salt-minion[1056]: [ERROR   ] Command '['useradd', '-m', 'donnie']' failed with return code: 9
Feb 22 22:25:44 dirac salt-minion[1056]: [ERROR   ] stderr: useradd: user 'donnie' already exists
Feb 22 22:25:44 dirac salt-minion[1056]: [ERROR   ] retcode: 9
Feb 23 15:23:41 dirac useradd[12774]: new group: name=test, GID=1001
Feb 23 15:23:41 dirac useradd[12774]: new user: name=test, UID=1001, GID=1001, home=/home/test, shell=/bin/sh
donnie@dirac ~> sudo systemctl status salt-master.service                                                                                                                                                                                                                        (base)
● salt-master.service - The Salt Master Server
   Loaded: loaded (/lib/systemd/system/salt-master.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-02-22 11:59:26 CST; 1 day 3h ago
     Docs: man:salt-master(1)
           file:///usr/share/doc/salt/html/contents.html
 Main PID: 954 (salt-master)
    Tasks: 30 (limit: 4915)
   CGroup: /system.slice/salt-master.service
           ├─ 954 /usr/bin/python3 /usr/bin/salt-master
           ├─1015 /usr/bin/python3 /usr/bin/salt-master
           ├─1057 /usr/bin/python3 /usr/bin/salt-master
           ├─1058 /usr/bin/python3 /usr/bin/salt-master
           ├─1061 /usr/bin/python3 /usr/bin/salt-master
           ├─1062 /usr/bin/python3 /usr/bin/salt-master
           ├─1064 /usr/bin/python3 /usr/bin/salt-master
           ├─1067 /usr/bin/python3 /usr/bin/salt-master
           ├─1072 /usr/bin/python3 /usr/bin/salt-master
           ├─1076 /usr/bin/python3 /usr/bin/salt-master
           ├─1077 /usr/bin/python3 /usr/bin/salt-master
           └─1079 /usr/bin/python3 /usr/bin/salt-master

Feb 22 22:52:04 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 22 22:52:04 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:20 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:20 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:20 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:20 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:41 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:41 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:41 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack
Feb 23 15:23:41 dirac salt-master[954]: [ERROR   ] An extra return was detected from minion dirac, please verify the minion, this could be a replay attack


So most likely, somehow i am running multiple services...? idk how i got here, is there a way to kill them ?

Phipps, Thomas

unread,
Feb 24, 2021, 1:23:06 PM2/24/21
to salt-...@googlegroups.com
Donnie,

There should be three returned by systemctl, however, you most likely have more than three if you run `ps -ef |grep salt-minion`

if you stop the salt-minion with systemctl then just kill the rest with the kill Linux command. `kill <pid>` until the salt-minion process no longer shows up with `ps -ef | grep salt`

After that start salt again with salt-minion

Hard to tell why you have multiple salt minions running. did you try running them by hand with -d or something?



Donnie Kim

unread,
Feb 26, 2021, 11:41:15 AM2/26/21
to Salt-users
Hi,

I did stop the minion service, killed the multiple minion processes, and restarted. Now it is only returning 1 ! Thanks for your suggestion!

Yes, I did run them by hand with -d. I am just learning salt by following some random youtube tutorials and when i did with -d, somehow it failed... and i did multiple tries of running minion service with -d, and at one point it worked... and from there on i got weird behaviors of getting multiple returns.

it would be great if there is some sort of an official tutorial that highlights key components of salt and whatnot... but it's okay. I can read documentation and google enough to learn one by one.

Anyways, thank you all for the feedbacks. It was really helpful!

Cheers,
Donnie

Reply all
Reply to author
Forward
0 new messages