FAQ
Any options about this?

Basic description

When you run command targeting all minions, no return from a minion is not
treated like a failure, although you can get some info in verbose output:

*salt -v '*' state.highstate*
Executing job with jid 20141221170308505737
-------------------------------------------

minion_id:
     Minion did not return. [No response]


Checking return code (error code) of executed `salt` command cannot
possibly provide information on whether command has actually successfully
completed on every minion as it was asked - return code is 0 (success):

*echo $?*



This was tested using Helium release (2014.7.0).

Orchestrate issues

This become a next level problem when behaviour is apparently the same for
orchestration runner.
Let's use example similar to the one from documentation (
http://salt.readthedocs.org/en/latest/topics/tutorials/states_pt5.html) -
see section "3.3.6.1.2. Triggering a Highstate".
Create file `/srv/salt/ret_code_with_orchestrate.sls` making sure it
targets dead minion:

webserver_setup:
   salt.state:
     - tgt: '*'
     - highstate: True

Executing orchestrate runner will yield success while you system state is
not set up as you expected it to be:

salt-run state.orchestrate ret_code_with_orchestrate

minion_id:
----------
           ID: webserver_setup
     Function: salt.state
       Result: True
      Comment: States ran successfully.
      Started: 17:31:20.726253
     Duration: 71.263 ms
      Changes:

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


Again, error code is 0 (success):

*echo $?*



Note that I deliberately ignored a notice in the output because this cannot
be seriously used in automation to detect timeouts (and what this means
anyway):

No minions matched the target. No command was sent, no jid was assigned.


Any other orchestrate state which depends on the state above will be run
even though the prerequisite has not actually been enforced.

There is even an issue related to the problem:
https://github.com/saltstack/salt/issues/13216

How to reproduce timeouts easily?

In order to reproduce non-returning minion, you will simply need to shut
down one of the minions listed by `*salt-key*` under `Accepted Keys:`.
The easiest way is to:

- Install both master and minion on a single host. Start them both.

- Accept minion key by master using `*salt-key -A*`.

- Shut down minion and run any command targeting this minion (i.e. `*salt
'*' state.highstate*`).



--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Florian Ermisch at Dec 21, 2014 at 10:16 am
    No options but opinions ;)

    The "always 0 exitcode" of `salt` no mater what failure occured is rather annoying. You can't use something like a `until salt '*' state.sls foo.bar; do :; done` for more complex states, that need some fine tuning until they work on the first run.

    The orchestrator is pretty useless (the "No minions matched the target" thing causes some states not to be run no mater what I put into `tgt:`) so after 2 hours of fiddling with the orchestrate-runner I wrote a shell script calling all the states instead… of course I would need to parse the output of each run for any failed states to cancel the script as soon as something goes wrong but it was still more reliable :/

    Regards, Florian

    Am 21. Dezember 2014 10:47:52 MEZ, schrieb uvsmtid@gmail.com:
    Any options about this?

    Basic description

    When you run command targeting all minions, no return from a minion is
    not
    treated like a failure, although you can get some info in verbose
    output:

    *salt -v '*' state.highstate*
    Executing job with jid 20141221170308505737
    -------------------------------------------

    minion_id:
    Minion did not return. [No response]


    Checking return code (error code) of executed `salt` command cannot
    possibly provide information on whether command has actually
    successfully
    completed on every minion as it was asked - return code is 0 (success):

    *echo $?*



    This was tested using Helium release (2014.7.0).

    Orchestrate issues

    This become a next level problem when behaviour is apparently the same
    for
    orchestration runner.
    Let's use example similar to the one from documentation (
    http://salt.readthedocs.org/en/latest/topics/tutorials/states_pt5.html)
    -
    see section "3.3.6.1.2. Triggering a Highstate".
    Create file `/srv/salt/ret_code_with_orchestrate.sls` making sure it
    targets dead minion:

    webserver_setup:
    salt.state:
    - tgt: '*'
    - highstate: True

    Executing orchestrate runner will yield success while you system state
    is
    not set up as you expected it to be:

    salt-run state.orchestrate ret_code_with_orchestrate

    minion_id:
    ----------
    ID: webserver_setup
    Function: salt.state
    Result: True
    Comment: States ran successfully.
    Started: 17:31:20.726253
    Duration: 71.263 ms
    Changes:

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


    Again, error code is 0 (success):

    *echo $?*



    Note that I deliberately ignored a notice in the output because this
    cannot
    be seriously used in automation to detect timeouts (and what this means

    anyway):

    No minions matched the target. No command was sent, no jid was
    assigned.


    Any other orchestrate state which depends on the state above will be
    run
    even though the prerequisite has not actually been enforced.

    There is even an issue related to the problem:
    https://github.com/saltstack/salt/issues/13216

    How to reproduce timeouts easily?

    In order to reproduce non-returning minion, you will simply need to
    shut
    down one of the minions listed by `*salt-key*` under `Accepted Keys:`.
    The easiest way is to:

    - Install both master and minion on a single host. Start them both.

    - Accept minion key by master using `*salt-key -A*`.

    - Shut down minion and run any command targeting this minion (i.e.
    `*salt
    '*' state.highstate*`).



    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedDec 21, '14 at 9:47a
activeDec 21, '14 at 10:16a
posts2
users2

2 users in discussion

Florian Ermisch: 1 post Uvsmtid: 1 post

People

Translate

site design / logo © 2022 Grokbase