Skip to content

The orchestrate runner falsely reports "States ran successfully." (likely due to missing reply or timeout from minion). #13216

Closed

Description

@uvsmtid

The following steps was reproduced on Fedora 20 but can be similarly done on any other OS.

Setup

Create a simple state file which installs any uninstalled package (here: bind):

# path: /srv/salt/deleteme.sls
install_dns_server:
    pkg.installed:
        - name: bind

Use this state in orchestration:

# path: /srv/salt/deleteme_orchestration.sls
install_dns_server_with_orchestration:
    salt.state:
        - tgt: 'minion_id'
        - sls: deleteme

Now make sure that yum somehow fails to install any package. For example, you may set wrong DNS in /etc/resolv.conf or add a non-existing proxy to /etc/yum.conf like here:

# Proxy settings
proxy=http://whatever:8000/
proxy_username=whatever
proxy_password=whatever

Try running yum install bind manually to confirm it fails.

Problem

Run orchestrate runner:

salt-run -l debug state.orchestrate deleteme_orchestration > results.yaml

The debug output does not produce any [ERROR ].
Check results:

# results.yaml
control:
----------
          ID: install_dns_server_with_orchestration
    Function: salt.state
      Result: True
     Comment: States ran successfully.
     Changes:

Summary
------------
Succeeded: 1
Failed:    0
------------
Total:     1

This is clearly _false_ because:

rpm -qi bind
package bind is not installed

Moreover, running the initial state using salt-call fails perfectly:

salt-call -l debug state.sls deleteme > results.yaml
...
[INFO    ] Executing command 'repoquery --queryformat="%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-%{REPOID}" --all --pkgnarrow=installed' in directory '/root'
[ERROR   ] The following packages failed to install/update: bind.
...

Check results:

# results.yaml
local:
----------
          ID: install_dns_server
    Function: pkg.installed
        Name: bind
      Result: False
     Comment: The following packages failed to install/update: bind.
     Changes:

Summary
------------
Succeeded: 0
Failed:    1
------------
Total:     1

Versions

Both master and minion are deployed on the same Fedora 20 x86_64 host.

 salt --versions-report
           Salt: 2014.1.4
         Python: 2.7.5 (default, Feb 19 2014, 13:47:28)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 13.0.2
            ZMQ: 3.2.4

Activity

  1. changed the title [-]The orchestrate runner says "States ran successfully." while states clearly failed.[/-] [+]The orchestrate runner falsely reports "States ran successfully." while the states clearly failed.[/+] on Jun 4, 2014
  2. basepi commented on Jun 4, 2014

    @basepi
    Contributor

    Would you mind testing this on the develop version? The orchestrate runner (and the associated saltmod states) have had many improvements in the develop version, and not all have been backported.

  3. added this to the Approved milestone on Jun 4, 2014
  4. uvsmtid commented on Jun 6, 2014

    @uvsmtid
    ContributorAuthor

    I tested it on the same host where it fails using develop branch and it works. And here is the catch: it actually works on another host with exactly the same --versions-report. Two hosts: same OS, same Salt, same states. One repeatedly fails, another repeatedly succeeds using default RPM. No prove, but it may be related to how Salt handles some special cases (or yum does not return failure under certain conditions).

    Is there a link to some sort of the timeline for any new Salt release?
    I would like to re-test it where it fails after update to new package.

  5. basepi commented on Jun 6, 2014

    @basepi
    Contributor

    Very strange.

    The next feature release should go into "release candidate" mode in the next couple of weeks.

  6. dstokes commented on Jul 28, 2014

    @dstokes

    seeing the same issue with regard to minions not returning. if a minion or minions fail to respond, the state is marked as successfull

  7. basepi commented on Aug 1, 2014

    @basepi
    Contributor

    @dstokes I think this is fixed in the develop branch, as well as the 2014.7 branch. Any chance you can test one of those places to verify?

  8. dstokes commented on Aug 1, 2014

    @dstokes

    @basepi i was seeing the error on 2014.7 if memory servers, but let me see if i can verify..

  9. basepi commented on Aug 1, 2014

    @basepi
    Contributor

    I will say, it's confusing right now because 2014.1.7 is the currently-released version of salt, and 2014.7.0 is the upcoming feature release. Too many 7s. =)

  10. dstokes commented on Aug 26, 2014

    @dstokes

    i'm seeing this issue in 2014.7.0rc1 as well. the issue is easily reproducible by using targets in your states that don't match any minions. not sure if "success" is the intended functionality there, but it also seems to happen when minions fail to respond in the timeout.

  11. basepi commented on Aug 26, 2014

    @basepi
    Contributor

    Thanks for the update. We definitely need to get that fixed.

  12. 24 remaining items

  13. removed this from the milestone on Jun 18, 2015
  14. modified the milestone: Approved on Jun 19, 2015
  15. jjc001 commented on Nov 13, 2015

    @jjc001

    I am getting the same problem with the orchestrate runner when timeouts occur with long running formulas and with minions not responding with version Beryllium 2015.8.1. Any ideas when it will be fixed?

  16. basepi commented on Nov 13, 2015

    @basepi
    Contributor

    No update yet, unfortunately.

  17. added
    P3
    and removed
    P1
    on Jun 8, 2016
  18. rhertzog commented on Oct 13, 2016

    @rhertzog
    Contributor

    I believe that I have a similar issue where an orchestration state is marked completed before having received the answers of all minions. I perform a long-running task on 3 minions and want to wait that they completed on all three before running another task on another minion. The long-running task takes respectively, 2h, 2h and 7 hours. But after 4.5 hours, the state ends and is marked as completed. And the second task is started while the 7 hour one is not yet over. And the 7h task is completing successfully as all the files it is generating are created in the end. It just looks like that the master hit some timeout waiting for the result of the minion's job...

    I looked hard in the documentation but I could not find any timeout to configure here. Maybe there's something else explaining why the master lost track of the minion's job but I don't know what. I'm happy to make some tries if it can help. I could not find anything relevant in the log file. The last time the master makes a request about the long-running job it looks like exactly all the former requests:

    2016-10-09 05:17:50,357 [salt.client      ][DEBUG   ][16504] Checking whether jid 20161009010205590200 is still running
    [...]
    2016-10-09 05:17:50,376 [salt.master      ][DEBUG   ][14721] Published command details {'tgt_type': 'pillar', 'jid': '20161009051750373760', 'tgt': 'roles:iso-builder:True', 'ret': '', 'user': 'root', 'arg': ['20161009010205590200'], 'fun': 'saltutil.find_job'}
    [...]
    2016-10-09 05:17:50,944 [salt.utils.event ][DEBUG   ][14721] Sending event - data = {'fun_args': ['20161009010205590200'], 'jid': '20161009051750373760', 'return': {'tgt_type': 'pillar', 'jid': '20161009010205590200', 'tgt': 'roles:iso-builder:True', 'pid': 11692, 'ret': '', 'user': 'root', 'arg': ['/srv/kali-iso-builder/bin/build-all-images weekly --version 2016-W41'], 'fun': 'cmd.run'}, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-09T05:17:50.943458', 'fun': 'saltutil.find_job', 'id': 'B'}
    [...]
    2016-10-09 05:17:52,046 [salt.utils.event ][DEBUG   ][14723] Sending event - data = {'fun_args': ['20161009010205590200'], 'jid': '20161009051750373760', 'return': {}, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-09T05:17:52.046112', 'fun': 'saltutil.find_job', 'id': 'A'}
    [...]
    2016-10-09 05:17:52,068 [salt.utils.event ][DEBUG   ][14716] Sending event - data = {'fun_args': ['20161009010205590200'], 'jid': '20161009051750373760', 'return': {}, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-09T05:17:52.067771', 'fun': 'saltutil.find_job', 'id': 'C'}
    

    Here minion B is the one with the 7h task not yet completed while minion A and C have already completed.

  19. stale commented on Oct 19, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

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

    CoreP3bugseverity-mediumstale

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions