If 2 tenants use the same key path on the filesystem, when the snapshot is restored, cloudify-manager/workflows/cloudify_system_workflows/snapshots/fix_snapshot_ssh_db.py will scan the database for deployments and replace all occurrences of the path (where they appear as agent keys or fabric env keys) with the new secret.
Unfortunately this means only the 1st tenant will be in a sensible state after the restore: the 2nd will refer to a non-existent secret.
This has similar symptoms to but it is not really related at all.
Fixed as a side effect of switching to flask_utils (& the storage manager) rather than directly accessing the DB