Skip to content

service.running fails on OSX 10.11.6 #44130

Closed

Description

@edunham

Description of Issue/Question

Using Salt to start a service on a minion running OSX 10.11.6 returns the error

----------
          ID: buildbot-slave
    Function: service.running
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/local/Cellar/saltstack/2016.3.3/libexec/lib/python2.7/site-packages/salt/state.py", line 1733, in call
                  **cdata['kwargs'])
                File "/usr/local/Cellar/saltstack/2016.3.3/libexec/lib/python2.7/site-packages/salt/loader.py", line 1652, in wrapper
                  return f(*args, **kwargs)
                File "/usr/local/Cellar/saltstack/2016.3.3/libexec/lib/python2.7/site-packages/salt/states/service.py", line 343, in running
                  before_toggle_enable_status = __salt__['service.enabled'](name)
                File "/usr/local/Cellar/saltstack/2016.3.3/libexec/lib/python2.7/site-packages/salt/modules/launchctl.py", line 301, in enabled
                  '/var/db/launchd.db/com.apple.launchd/overrides.plist'
                File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 75, in readPlist
                  pathOrFile = open(pathOrFile)
              IOError: [Errno 2] No such file or directory: '/var/db/launchd.db/com.apple.launchd/overrides.plist'
     Started: 14:32:47.239178
    Duration: 5745.534 ms
     Changes:   
----------

Setup

The line on which we attempt to start the service is at https://github.com/servo/saltfs/blob/master/buildbot/slave/init.sls#L61, and the rest of our configs and setup are in that repo. Our initial mac setup song and dance is documented at https://github.com/servo/servo/wiki/SaltStack-Administration#osx

Steps to Reproduce Issue

Attempt to apply, to an OSX 10.11.6 minion, a state including service.running. Specific error is above.

Versions Report

On master:

salt --versions-report
Salt Version:
           Salt: 2016.3.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.2
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4
 
System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-48-generic
         system: Linux
        version: Ubuntu 14.04 trusty

On the minion in question, including stuff about the OSX version:

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.6 (15G1004)
      Kernel Version: Darwin 15.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: administrator’s Mac mini
      User Name: administrator (administrator)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 382 days 22:06

$ salt --versions-report

Salt Version:
           Salt: 2016.3.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.10 (default, Oct 23 2015, 19:19:21)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.4.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.1
            ZMQ: 4.1.5
 
System Versions:
           dist:   
        machine: x86_64
        release: 15.6.0
         system: Darwin
        version: 10.11.6 x86_64

Other comments

I see the path to the overrides.plist hardcoded in Salt at

'/var/db/launchd.db/com.apple.launchd/overrides.plist'
, however http://www.launchd.info/ says that "Starting with OSX 10.10 Yosemite the override database was moved to a different location. ". This leads me to suspect that my issue may be a result of incompatibility between Salt and my OSX version, so I'm filing it here to get find out whether Salt is working correctly on OSX 10.11.x for anyone else.

Activity

  1. added this to the Approved milestone on Oct 17, 2017
  2. added
    bug
    severity-medium
    P2
    MacOS
    on Oct 17, 2017
  3. weswhet commented on Apr 17, 2018

    @weswhet
    Contributor

    @edunham Any chance you can test and see if this is still an issue on salt 2018.3.0. I'm unable to reproduce. I believe this was originally due to a bad os version comparison as macOS 10.11.6 should be using the mac_service module not launchctl.py.

  4. jdm commented on Jul 31, 2018

    @jdm

    This does appear to be an issue in 2018.3.0.

  5. weswhet commented on Jul 31, 2018

    @weswhet
    Contributor

    @jdm on macOS 10.11?

  6. jdm commented on Jul 31, 2018

    @jdm

    Correct. I help maintain the infrastructure that was in use in the original issue report.

  7. weswhet commented on Jul 31, 2018

    @weswhet
    Contributor

    screen shot 2018-07-31 at 2 23 22 pm
    I'll test this shortly :)

  8. jdm commented on Jul 31, 2018

    @jdm

    Ack, I'm so sorry. I typoed when I meant to say that this does not appear to be an issue in 2018.3.

  9. weswhet commented on Jul 31, 2018

    @weswhet
    Contributor

    @Ch3LL @rallytime I guess the issue can be closed then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MacOSP2bugseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions