We're updating the issue view to help you get more done. 

Restoring a snapshot breaks `cfy_manager configure/

Description

When restoring a snapshot, we overwrite the values in `rest-security.conf`, but not in `/etc/cloudify/config.yaml`. So then, when we run a command like `cfy_manager configure/install`, old security values are taken from `config.yaml` in order to create a new `rest-security.conf`, which then doesn't correspond to the values in the DB.

The solution would potentially be to only overwrite `rest-security.conf` if the `--clean-db` flag was passed, or if the file doesn't exist at all. A potential pitfall is the case where the file exists but is incomplete (e.g. if we've added a field). This case might require merging the two dicts.

Steps to Reproduce

Environment:
OS (CLI), HA cluster, cloud provider
------------------------------------

Steps to reproduce:
------------------
1. Create snapshot on 1st manager.
2. Restore snapshot on 2nd manager.
3. Try to run `cfy_manager configure`

Expected result:
---------------
Configure command succeeds.

Actual result:
-------------
Configure command fails, because the `flask_security` value is overwritten during the command's run, but it doesn't correspond to the encrypted data in the DB.

Why Propose Close?

None

Status

Assignee

Pavel Brodsky

Reporter

Pavel Brodsky

Labels

None

Severity

Critical

Target Version

4.5.5

Premium Only

no

Found In Version

4.5

QA Owner

None

Bug Type

legacy bug

Customer Encountered

Yes

Customer Name

Metaswitch

Release Notes

yes

Priority

None

Epic Link

Sprint

None

Priority

Unprioritized