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

3.4.2 -> 4.2 snapshot restore fails

Description

3.4.2 snapshot restore fails on 4.2dev1 manager (image tested from rackspace 4.2.dev1 image) with the following message:

2017-10-14 06:27:33,640 [_main_] ERROR: Task cloudify_system_workflows.snapshot.restore[40cfbecd-23ca-4a56-aaab-1a2460f0b156] raised:

Traceback (most recent call last):

File "/tmp/pip-build-Uj15Pj/cloudify-plugins-common/cloudify/dispatch.py", line 513, in _remote_workflow_child_thread

File "/tmp/pip-build-Uj15Pj/cloudify-plugins-common/cloudify/dispatch.py", line 544, in _execute_workflow_function

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshot.py", line 63, in restore

restore_snapshot.restore()

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/snapshot_restore.py", line 112, in restore

self._restore_db(postgres, schema_revision, stage_revision)

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/snapshot_restore.py", line 308, in _restore_db

ctx.tenant_name,

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/es_snapshot.py", line 39, in restore_db_from_pre_4_version

result = utils.run(command)

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/utils.py", line 251, in run

raise RuntimeError(msg)

RuntimeError: Failed running command: /opt/manager/env/bin/python /opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/estopg.py /tmp/tmpSFy4Pk-snapshot-data/es_data default_tenant (Traceback (most recent call last):

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/estopg.py", line 362, in <module>

es_to_pg = EsToPg(args.es_dump_path, args.tenant_name)

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/estopg.py", line 36, in _init_

self._storage_manager = self._get_storage_manager(tenant_name)

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/estopg.py", line 53, in _get_storage_manager

self._set_tenant_in_app(tenant, app, storage_manager, admin)

File "/opt/mgmtworker/env/lib/python2.7/site-packages/cloudify_system_workflows/snapshots/estopg.py", line 62, in _set_tenant_in_app

storage_manager.put(tenant)

File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/storage/storage_manager.py", line 478, in put

self.update(instance, log=False)

File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/storage/storage_manager.py", line 510, in update

self._safe_commit()

File "/opt/manager/env/lib/python2.7/site-packages/manager_rest/storage/storage_manager.py", line 50, in _safe_commit

'SQL Storage error: {0}'.format(str(e))

manager_rest.manager_exceptions.SQLStorageException: SQL Storage error: New instance <UserTenantAssoc at 0x4eeced0> with identity key (<class 'manager_rest.storage.management_models.UserTenantAssoc'>, (0, 0)) conflicts with persistent instance <UserTenantAssoc at 0x4eecf90>

).

Status

Assignee

Javier Collado Cabeza

Reporter

AnnaS

Labels

None

Severity

None

Bug Type

None

Target Version

None

Severity

None

Fix versions

Affects versions

4.2