Pack install looking for actionchain type workflow after upgrade

I upgraded from 3.1 to 3.2 using this command.
sudo yum localinstall --enablerepo epel st2-3.2.0-4.x86_64.rpm

After the upgrade i am unable to install packs using
st2 pack install [pack]

The error i get is:

[xxx@stackstorm]/opt/stackstorm/packs/packs$ st2 pack install file:///opt/stackstorm/packs/packs
id: 5f2416158d3fd56d3406a4ba
action.ref: packs.install
parameters:
  packs:
  - file:///opt/stackstorm/packs/packs
  python3: false
status: failed
error: Additional properties are not allowed ('output', 'tasks', 'description', 'version', 'input' were unexpected)

Failed validating 'additionalProperties' in schema:
    {'additionalProperties': False,
     'description': 'A chain of sequentially executed actions.',
     'properties': {'chain': {'description': 'The chain.',
                             'items': [{'additionalProperties': False,
                                         'description': 'Node of an ActionChain.',
                                         'properties': {'name': {'description': 'The name of this node.',
                                                                 'required': True,
                                                                 'type': 'string'},
                                                        'notify': {'additionalProperties': False,
                                                                   'description': 'Notification settings for action.',
                                                                   'properties': {'on-complete': {'additionalProperties': False,
                                                                                                  'properties': {'channels': {'description': 'Channels to post notifications to.',
                                                                                                                              'type': 'array'},
                                                                                                                 'data': {'description': 'Data to be sent as part of notification',
                                                                                                                          'type': 'object'},
                                                                                                                 'message': {'description': 'Message to use for notification',
                                                                                                                             'type': 'string'},
                                                                                                                 'routes': {'description': 'Channels to post notifications to.',
                                                                                                                            'type': 'array'}},
                                                                                                  'type': 'object'},
                                                                                  'on-failure': {'additionalProperties': False,
                                                                                                 'properties': {'channels': {'description': 'Channels to post notifications to.',
                                                                                                                             'type': 'array'},
                                                                                                                'data': {'description': 'Data to be sent as part of notification',
                                                                                                                         'type': 'object'},
                                                                                                                'message': {'description': 'Message to use for notification',
                                                                                                                            'type': 'string'},
                                                                                                                'routes': {'description': 'Channels to post notifications to.',
                                                                                                                           'type': 'array'}},
                                                                                                 'type': 'object'},
                                                                                  'on-success': {'additionalProperties': False,
                                                                                                 'properties': {'channels': {'description': 'Channels to post notifications to.',
                                                                                                                             'type': 'array'},
                                                                                                                'data': {'description': 'Data to be sent as part of notification',
                                                                                                                         'type': 'object'},
                                                                                                                'message': {'description': 'Message to use for notification',
                                                                                                                            'type': 'string'},
                                                                                                                'routes': {'description': 'Channels to post notifications to.',
                                                                                                                           'type': 'array'}},
                                                                                                 'type': 'object'}},
                                                                   'type': 'object'},
                                                        'on-failure': {'default': '',
                                                                       'description': 'Name of the node to invoke on failure of action executed for this node.',
                                                                       'type': 'string'},
                                                        'on-success': {'default': '',
                                                                       'description': 'Name of the node to invoke on successful completion of action executed for this node.',
                                                                       'type': 'string'},
                                                        'parameters': {'default': {},
                                                                       'description': 'Parameter for the execution.',
                                                                       'type': 'object'},
                                                        'params': {'default': {},
                                                                   'description': 'Parameter for the execution (old name, here for backward compatibility reasons).',
                                                                   'type': 'object'},
                                                        'publish': {'description': 'The variables to publish from the result. Should be of the form name.foo. o1: {{node_name.foo}} will result in creation of a variable o1 which is now available for reference through remainder of the chain as a global variable.',
                                                                    'patternProperties': {'^\w+$': {}},
                                                                    'type': 'object'},
                                                        'ref': {'description': 'Ref of the action to be executed.',
                                                                'required': True,
                                                                'type': 'string'}},
                                         'title': 'Node',
                                         'type': 'object'}],
                              'required': True,
                              'type': 'array'},
                    'default': {'description': 'name of the action to be executed.',
                                'type': 'string'},
                    'vars': {'description': '',
                             'patternProperties': {'^\w+$': {}},
                             'type': 'object'}},
     'title': 'ActionChain',
     'type': 'object'}

On instance:
    {'description': 'A orquesta workflow to install packs.',
     'input': ['packs',
               'register',
               'env',
               'force',
               'python3',
               'skip_dependencies'],
     'output': [{'packs_list': '<% ctx().packs_list %>'},
                {'message': '<% ctx().message %>'},
                {'conflict_list': '<% ctx().conflict_list %>'}],
     'tasks': {'check_dependency_and_conflict_list': {'action': 'core.noop',
                                                      'next': [{'do': 'stop_installation_and_cleanup_because_conflict',
                                                                'when': '<% ctx().conflict_list %>'},
                                                               {'do': 'download_pack',
                                                                'when': '<% not ctx().conflict_list and ctx().dependency_list %>'},
                                                               {'do': 'install_pack_requirements',
                                                                'when': '<% not ctx().conflict_list and not ctx().dependency_list %>'}]},
               'download_pack': {'action': 'packs.download',
                                 'input': {'dependency_list': '<% ctx().dependency_list %>',
                                           'force': '<% ctx().force %>',
                                           'packs': '<% ctx().packs %>',
                                           'python3': '<% ctx().python3 %>'},
                                 'next': [{'do': 'make_a_prerun',
                                           'when': '<% succeeded() %>'}]},
               'echo_pack_conflicts': {'action': 'core.noop',
                                       'next': [{'do': 'fail',
                                                 'publish': [{'message': 'Unable to install packs due to conflicts. Review the conflict_list and check the versions of corresponding installed packs. You can also run the `st2 pack install` command with the `--skip-dependencies` flag to skip installing dependent packs.'}]}]},
               'get_pack_dependencies': {'action': 'packs.get_pack_dependencies',
                                         'input': {'nested': '<% ctx().nested%>',
                                                   'packs_status': '<% task(download_pack).result.result %>'},
                                         'next': [{'do': 'check_dependency_and_conflict_list',
                                                   'publish': [{'dependency_list': '<% result().result.dependency_list %>'},
                                                               {'conflict_list': '<% result().result.conflict_list %>'},
                                                               {'nested': '<% result().result.nested %>'}],
                                                   'when': '<% succeeded() %>'}]},
               'init_task': {'action': 'core.noop',
                             'next': [{'do': 'download_pack'}]},
               'install_pack_requirements': {'action': 'packs.setup_virtualenv',
                                             'input': {'env': '<% ctx().env %>',
                                                       'packs': '<% ctx().packs_list %>',
                                                       'python3': '<% ctx().python3 %>'},
                                             'next': [{'do': 'register_pack',
                                                       'when': '<% succeeded() %>'}]},
               'make_a_prerun': {'action': 'packs.virtualenv_prerun',
                                 'input': {'packs_list': '<% ctx().packs_list %>',
                                           'packs_status': '<% task(download_pack).result.result %>'},
                                 'next': [{'do': 'install_pack_requirements',
                                           'publish': [{'packs_list': '<% task(make_a_prerun).result.result %>'}],
                                           'when': '<% succeeded() and (ctx().skip_dependencies or ctx().nested = 0) %>'},
                                          {'do': 'get_pack_dependencies',
                                           'publish': [{'packs_list': '<% task(make_a_prerun).result.result %>'}],
                                           'when': '<% succeeded() and (ctx().nested > 0 and not ctx().skip_dependencies) %>'}]},
               'register_pack': {'action': 'packs.load',
                                 'input': {'packs': '<% ctx().packs_list %>',
                                           'register': '<% ctx().register %>'},
                                 'next': [{'publish': [{'message': 'Successfully installed packs'}]}]},
               'stop_installation_and_cleanup_because_conflict': {'action': 'packs.delete',
                                                                  'input': {'delete_env': False,
                                                                            'packs': '<% ctx().packs_list %>'},
                                                                  'next': [{'do': 'echo_pack_conflicts'}]}},
     'vars': [{'packs_list': None},
              {'dependency_list': None},
              {'conflict_list': None},
              {'nested': 10},
              {'message': ''}],
     'version': 1.0}
traceback:   File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/container/base.py", line 113, in _do_run
    runner.pre_run()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/action_chain_runner/action_chain_runner.py", line 282, in pre_run
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/action_chain_runner/action_chain_runner.py", line 282, in pre_run
    raise runner_exc.ActionRunnerPreRunError(message)

start_timestamp: Fri, 31 Jul 2020 13:01:09 UTC
end_timestamp: Fri, 31 Jul 2020 13:01:09 UTC
result: See error and traceback.

Now what seems to have happened is the workflow:
/opt/stackstorm/packs/packs/actions/workflows/install.yaml
has changed from an actionchain to an orquesta workflow.

For some reason after the upgrade it still wants the actionchain.

How do i fix this?

How to fix:

st2-register-content --register-all
1 Like

Yeah, the register content is a required step in the StackStorm Upgrade Procedure:
https://docs.stackstorm.com/install/upgrades.html#general-upgrade-procedure