sometimes when running /usr/bin/python /usr/bin/mistral-db-manage --config-file=/etc/mistral/mistral.conf populate more than once the command fail because column and table already there.
for example:
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: Traceback (most recent call last):
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/bin/mistral-db-manage", line 10, in <module>
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: sys.exit(main())
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/db/sqlalchemy/migration/cli.py", line 129, in main
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: CONF.command.func(config, CONF.command.name)
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/db/sqlalchemy/migration/cli.py", line 71, in do_populate
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: workflows.sync_db()
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/services/workflows.py", line 32, in sync_db
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: register_standard_workflows()
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/services/workflows.py", line 28, in register_standard_workflows
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: create_workflows(workflow_definition, scope='public')
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/services/workflows.py", line 42, in create_workflows
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: db_wfs.append(_create_workflow(wf_spec, definition, scope))
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/services/workflows.py", line 77, in _create_workflow
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: _get_workflow_values(wf_spec, definition, scope)
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/db/v2/api.py", line 120, in create_workflow_definition
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: return IMPL.create_workflow_definition(values)
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/db/sqlalchemy/base.py", line 91, in _within_session
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: result = func(*args, **kw)
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: File "/usr/lib/python2.7/site-packages/mistral/db/v2/sqlalchemy/api.py", line 247, in create_workflow_definition
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: "Duplicate entry for WorkflowDefinition: %s" % e.columns
Notice: /Stage[main]/Mistral::Services/Exec[mistral-dbsync]/returns: mistral.exceptions.DBDuplicateEntry: Duplicate entry for WorkflowDefinition: ['name']
I've just checked, it is really a bug.
So, need to mark all preloaded workflows as 'system' or 'read-only' (like we've done with actions), delete them and load again.