salt icon indicating copy to clipboard operation
salt copied to clipboard

Orchestration doesn't break after failed state

Open ilyinon opened this issue 10 years ago • 2 comments

Hello,

I updated to salt.noarch-2015.8.3-1.el6 from salt-2015.5.2-3.el6.noarch RHEL6.6 I have a many states which run over orchestration ( state.orchestrate ) There are relation between states, for example ( for really there are much more )

  1. install thirdparty
  2. install databases
  3. install application
  4. post installation procedure

In version 2015.8.3 orchestration changed it behavior and doesn't stop running after catched errors. For example in step 2 databases failed to install, and it tried to install application, but it is senselessly because application can't run and install without databases.

In version 2015.5.2 orchestration stops running in this case. I tried set parameter failhard: true , but it didn't affect to this case.

Could you please help me with this issues? What can I do wrong ? or orchestration changed it behavior to skip errors?

for example:

salt-run --hard-crash state.sls orchestration.test

dev4node3-app1_master:

      ID: one1
Function: salt.state
  Result: True
 Comment: States ran successfully. Updating dev4node3-app1.
 Started: 08:25:10.655073
Duration: 543.21 ms
 Changes:
          dev4node3-app1:
          ----------
                    ID: echo_status
              Function: cmd.run
                  Name: echo 'I'm running
                Result: True
               Comment: Command "echo 'I'm running" run
               Started: 08:25:11.013129
              Duration: 5.437 ms
               Changes:
                        ----------
                        pid:
                            3467
                        retcode:
                            0
                        stderr:
                        stdout:
                            Im running
          ----------
                    ID: echo_fail
              Function: cmd.run
                  Name: /bin/false
                Result: False
               Comment: Command "/bin/false" run
               Started: 08:25:11.030849
              Duration: 5.791 ms
               Changes:
                        ----------
                        pid:
                            3484
                        retcode:
                            1
                        stderr:
                        stdout:

          Summary for dev4node3-app1
          ------------
          Succeeded: 1 (changed=2)
          Failed:    1
          ------------
          Total states run:     2
          Total run time:  11.228 ms

      ID: one2
Function: salt.state
  Result: True
 Comment: States ran successfully. Updating dev4node3-app2.
 Started: 08:25:11.198603
Duration: 1143.096 ms
 Changes:
          dev4node3-app2:
          ----------
                    ID: echo_status
              Function: cmd.run
                  Name: echo 'I'm running
                Result: True
               Comment: Command "echo 'I'm running" run
               Started: 08:25:12.174055
              Duration: 5.23 ms
               Changes:
                        ----------
                        pid:
                            4363
                        retcode:
                            0
                        stderr:
                        stdout:
                            Im running
          ----------
                    ID: echo_fail
              Function: cmd.run
                  Name: /bin/false
                Result: False
               Comment: Command "/bin/false" run
               Started: 08:25:12.191574
              Duration: 5.584 ms
               Changes:
                        ----------
                        pid:
                            4364
                        retcode:
                            1
                        stderr:
                        stdout:

          Summary for dev4node3-app2
          ------------
          Succeeded: 1 (changed=2)
          Failed:    1
          ------------
          Total states run:     2
          Total run time:  10.814 ms

      ID: one3
Function: salt.state
  Result: True
 Comment: States ran successfully. Updating dev4node3-app1.
 Started: 08:25:12.342038
Duration: 598.564 ms
 Changes:
          dev4node3-app1:
          ----------
                    ID: echo_status
              Function: cmd.run
                  Name: echo 'I'm running
                Result: True
               Comment: Command "echo 'I'm running" run
               Started: 08:25:12.755397
              Duration: 9.784 ms
               Changes:
                        ----------
                        pid:
                            3736
                        retcode:
                            0
                        stderr:
                        stdout:
                            Im running
          ----------
                    ID: echo_fail
              Function: cmd.run
                  Name: /bin/false
                Result: False
               Comment: Command "/bin/false" run
               Started: 08:25:12.781198
              Duration: 6.721 ms
               Changes:
                        ----------
                        pid:
                            3739
                        retcode:
                            1
                        stderr:
                        stdout:

          Summary for dev4node3-app1
          ------------
          Succeeded: 1 (changed=2)
          Failed:    1
          ------------
          Total states run:     2
          Total run time:  16.505 ms

Summary for dev4node3-app1_master

Succeeded: 3 (changed=3)

Failed: 0

Total states run: 3 Total run time: 2.285 s

one1: salt.state: - tgt: 'roles:first_role' - tgt_type: grain - sls: - test

one2: salt.state: - tgt: 'roles:second_role' - tgt_type: grain - sls: - test - require: - salt: one1

one3: salt.state: - tgt: 'roles:third_role' - tgt_type: grain - sls: test - require: - salt: one1 - salt: one2

It should be stopped after first failed one1 salt.state ?

salt --versions-report Salt Version: Salt: 2015.8.3

Dependency Versions: Jinja2: 2.2.1 M2Crypto: 0.20.2 Mako: Not Installed PyYAML: 3.10 PyZMQ: 14.5.0 Python: 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) RAET: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5 cffi: Not Installed cherrypy: Not Installed dateutil: 1.4.1 gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed libnacl: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed python-gnupg: Not Installed smmap: Not Installed timelib: Not Installed

System Versions: dist: redhat 6.6 Santiago machine: x86_64 release: 2.6.32-504.3.3.el6.x86_64 system: Red Hat Enterprise Linux Server 6.6 Santiago

ilyinon avatar Jan 26 '16 14:01 ilyinon

Looks like this is a dublicate of #30367, right?

rmatulat avatar Jan 26 '16 18:01 rmatulat

@ilyinon, thanks for the report. This is a duplicate of #30367.

jfindlay avatar Jan 26 '16 21:01 jfindlay