Issues running minion as another user -> State.apply running as PID

160 views
Skip to first unread message

James Young

unread,
Aug 19, 2016, 4:26:26 PM8/19/16
to Salt-users
Issue: Whenever I try to execute states on a minion with the user and sudo_user configuration items set, I get the following error message:

The function "state.apply" is running as PID 19652 and was started at 2016, Aug 19 15:12:53.484247 with jid 20160819151253484247

The State: This issues seems to happen with any salt state I apply, the one here is very simply one that installs wget: 
wget:

    pkg
.installed

Configuration:

The configuration is default other than the following two lines: 

user: svcSaltMinion

 
sudo_user: root

The svcSaltMinion has a sudoers entry to allow a no-password execution of sudo commands:  
 svcSaltMinion   ALL = (ALL)     NOPASSWD:ALL

Debugging Output: 

 The following is the output of salt-minion -l debug:

[INFO    ] User sudo_<USER> Executing command state.apply with jid 20160819152129612779
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20160819152129612779', 'tgt': '<TARGET GLOB>', 'ret': '', 'user': 'sudo_<USER>', 'arg': ['packages/wget'], 'fun': 'state.apply'}
[INFO    ] Starting a new job with PID 20020
[DEBUG   ] LazyLoaded state.apply
[DEBUG   ] LazyLoaded sudo.get
[INFO    ] Executing command ['sudo', '-u', 'root', 'salt-call', '--out', 'json', '--metadata', '-c', '/etc/salt', '--', 'state.apply', 'packages/wget', '__pub_user=sudo_<USER>', '\'__pub_arg=[\'"\'"\'packages/wget\'"\'"\']\'', '__pub_fun=state.apply', '__pub_jid=20160819152129612779', "'__pub_tgt=<TARGET GLOB>'", '__pub_tgt_type=glob', '__pub_ret='] in directory '/home/svcSaltMinion'
[DEBUG   ] Running ['sudo', '-u', 'root', 'salt-call', '--out', 'json', '--metadata', '-c', '/etc/salt', '--', 'state.apply', 'packages/wget', '__pub_user=sudo_<USER>', '\'__pub_arg=[\'"\'"\'packages/wget\'"\'"\']\'', '__pub_fun=state.apply', '__pub_jid=20160819152129612779', "'__pub_tgt=<TARGET GLOB>'", '__pub_tgt_type=glob', '__pub_ret='] in VT
[DEBUG   ] Child Forked! PID: 20021  STDOUT_FD: 19  STDERR_FD: 21
[DEBUG   ] Terminal Command: /bin/sh -c sudo -u root salt-call --out json --metadata -c /etc/salt -- state.apply packages/wget __pub_user=sudo_<USER> '__pub_arg=['"'"'packages/wget'"'"']' __pub_fun=state.apply __pub_jid=20160819152129612779 '__pub_tgt=<TARGET GLOB>' __pub_tgt_type=glob __pub_ret=
{
   
"local": {
       
"fun_args": [
           
"packages/wget",
           
"__pub_user=sudo_<USER>",
           
"__pub_arg=['packages/wget']",
           
"__pub_fun=state.apply",
           
"__pub_jid=20160819152129612779",
           
"__pub_tgt=<TARGET GLOB>",
           
"__pub_tgt_type=glob",
           
"__pub_ret="
       
],
       
"jid": "20160819152125943511",
       
"return": [
           
"The function \"state.apply\" is running as PID 20020 and was started at 2016, Aug 19 15:21:29.612779 with jid 20160819152129612779"
       
],
       
"retcode": 1,
       
"fun": "state.apply",
       
"id": "<HOSTNAME>",
       
"out": "highstate"
   
}
}
[DEBUG   ] {
   
"local": {
       
"fun_args": [
           
"packages/wget",
           
"__pub_user=sudo_<USER>",
           
"__pub_arg=['packages/wget']",
           
"__pub_fun=state.apply",
           
"__pub_jid=20160819152129612779",
           
"__pub_tgt=<TARGET GLOB>",
           
"__pub_tgt_type=glob",
           
"__pub_ret="
       
],
       
"jid": "20160819152125943511",
       
"return": [
           
"The function \"state.apply\" is running as PID 20020 and was started at 2016, Aug 19 15:21:29.612779 with jid 20160819152129612779"
       
],
       
"retcode": 1,
       
"fun": "state.apply",
       
"id": "<HOSTNAME>",
       
"out": "highstate"
   
}
}
[DEBUG   ] stdout: {
   
"local": {
       
"fun_args": [
           
"packages/wget",
           
"__pub_user=sudo_<USER>",
           
"__pub_arg=['packages/wget']",
           
"__pub_fun=state.apply",
           
"__pub_jid=20160819152129612779",
           
"__pub_tgt=<TARGET GLOB>",
           
"__pub_tgt_type=glob",
           
"__pub_ret="
       
],
       
"jid": "20160819152125943511",
       
"return": [
           
"The function \"state.apply\" is running as PID 20020 and was started at 2016, Aug 19 15:21:29.612779 with jid 20160819152129612779"
       
],
       
"retcode": 1,
       
"fun": "state.apply",
       
"id": "<HOSTNAME>",
       
"out": "highstate"
   
}
}


[DEBUG   ] Minion return retry timer set to 7 seconds (randomized)
[INFO    ] Returning information for job: 20160819152129612779



The following is the return of the command on the master: 

 - The function "state.apply" is running as PID 20020 and was started at 2016, Aug 19 15:21:29.612779 with jid 20160819152129612779



Version Output:

Salt Version:
           
Salt: 2016.3.2


Dependency Versions:
           cffi
: Not Installed
       cherrypy
: Not Installed
       dateutil
: Not Installed
          gitdb
: Not Installed
      gitpython
: Not Installed
          ioflo
: Not Installed
         
Jinja2: 2.7.2
        libgit2
: Not Installed
        libnacl
: Not Installed
       M2Crypto
: Not Installed
           
Mako: Not Installed
   msgpack
-pure: Not Installed
 msgpack
-python: 0.4.7
   mysql
-python: Not Installed
      pycparser
: Not Installed
       pycrypto
: 2.6.1
         pygit2
: Not Installed
         
Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python
-gnupg: Not Installed
         
PyYAML: 3.11
         
PyZMQ: 14.7.0
           RAET
: Not Installed
          smmap
: Not Installed
        timelib
: Not Installed
       
Tornado: 4.2.1
            ZMQ
: 4.0.5


System Versions:
           dist
: centos 7.2.1511 Core
        machine
: x86_64
        release
: 3.10.0-327.el7.x86_64
         system
: Linux
        version
: CentOS Linux 7.2.1511 Core




What could be causing this? 

James Young

unread,
Aug 22, 2016, 1:59:18 PM8/22/16
to Salt-users
Additionally, this error goes away when I switch the minion to run under the root user.

James Young

unread,
Aug 25, 2016, 9:25:08 AM8/25/16
to Salt-users
I'm still having issues with this and have found some others who are as well - does anyone know if this is a known issues in salt today?


On Friday, August 19, 2016 at 3:26:26 PM UTC-5, James Young wrote:

dwal...@saltstack.com

unread,
Jun 29, 2017, 1:38:28 PM6/29/17
to Salt-users
Reply all
Reply to author
Forward
0 new messages