[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15871944#comment-15871944 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez closed the pull request at: https://github.com/apache/cloudstack/pull/1735 > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15871943#comment-15871943 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on the issue: https://github.com/apache/cloudstack/pull/1735 Closing this PR as #1847 includes this changes in a simpler way > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817653#comment-15817653 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Trillian test result (tid-774) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 42807 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1735-t774-kvm-centos7.zip Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py Intermitten failure detected: /marvin/tests/smoke/test_volumes.py Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py Test completed. 45 look ok, 3 have error(s) Test | Result | Time (s) | Test File --- | --- | --- | --- test_04_rvpc_privategw_static_routes | `Failure` | 345.63 | test_privategw_acl.py test_01_create_volume | `Error` | 249.60 | test_volumes.py test_02_list_snapshots_with_removed_data_store | `Error` | 0.04 | test_snapshots.py test_01_vpc_site2site_vpn | Success | 165.13 | test_vpc_vpn.py test_01_vpc_remote_access_vpn | Success | 71.17 | test_vpc_vpn.py test_01_redundant_vpc_site2site_vpn | Success | 301.46 | test_vpc_vpn.py test_02_VPC_default_routes | Success | 445.31 | test_vpc_router_nics.py test_01_VPC_nics_after_destroy | Success | 831.58 | test_vpc_router_nics.py test_05_rvpc_multi_tiers | Success | 516.55 | test_vpc_redundant.py test_04_rvpc_network_garbage_collector_nics | Success | 1406.00 | test_vpc_redundant.py test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | Success | 548.52 | test_vpc_redundant.py test_02_redundant_VPC_default_routes | Success | 769.66 | test_vpc_redundant.py test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Success | 1284.91 | test_vpc_redundant.py test_09_delete_detached_volume | Success | 156.68 | test_volumes.py test_08_resize_volume | Success | 156.39 | test_volumes.py test_07_resize_fail | Success | 161.38 | test_volumes.py test_06_download_detached_volume | Success | 156.25 | test_volumes.py test_05_detach_volume | Success | 236.36 | test_volumes.py test_04_delete_attached_volume | Success | 151.22 | test_volumes.py test_03_download_attached_volume | Success | 156.32 | test_volumes.py test_02_attach_volume | Success | 214.74 | test_volumes.py test_deploy_vm_multiple | Success | 388.71 | test_vm_life_cycle.py test_deploy_vm | Success | 0.03 | test_vm_life_cycle.py test_advZoneVirtualRouter | Success | 0.02 | test_vm_life_cycle.py test_10_attachAndDetach_iso | Success | 46.70 | test_vm_life_cycle.py test_09_expunge_vm | Success | 125.23 | test_vm_life_cycle.py test_08_migrate_vm | Success | 66.21 | test_vm_life_cycle.py test_07_restore_vm | Success | 0.12 | test_vm_life_cycle.py test_06_destroy_vm | Success | 130.85 | test_vm_life_cycle.py test_03_reboot_vm | Success | 125.84 | test_vm_life_cycle.py test_02_start_vm | Success | 10.17 | test_vm_life_cycle.py test_01_stop_vm | Success | 125.82 | test_vm_life_cycle.py test_CreateTemplateWithDuplicateName | Success | 65.57 | test_templates.py test_08_list_system_templates | Success | 0.03 | test_templates.py test_07_list_public_templates | Success | 0.04 | test_templates.py test_05_template_permissions | Success | 0.06 | test_templates.py test_04_extract_template | Success | 5.17 | test_templates.py test_03_delete_template | Success | 5.11 | test_templates.py test_02_edit_template | Success | 90.18 | test_templates.py test_01_create_template | Success | 65.56 | test_templates.py test_10_destroy_cpvm | Success | 166.69 | test_ssvm.py test_09_destroy_ssvm | Success | 164.22 | test_ssvm.py test_08_reboot_cpvm | Success | 101.57 | test_ssvm.py test_07_reboot_ssvm | Success | 133.39 | test_ssvm.py test_06_stop_cpvm | Success | 136.78 | test_ssvm.py test_05_stop_ssvm | Success | 163.33 | test_ssvm.py test_04_cpvm_internals | Success | 1.25 | test_ssvm.py test_03_ssvm_internals | Success | 2.83 | test_ssvm.py test_02_list_cpvm_vm | Success | 0.12 | test_ssvm.py test_01_list_sec_storage_vm | Success | 0.13 | test_ssvm.py test_01_snapshot_root_disk | Success | 11.08 | test_snapshots.py test_04_change_offering_small | Success | 204.53 | test_service_offerings.py test_03_delete_service_offering | Success | 0.04 | test_service_offerings.py test_02_edit_service_offering | Success | 0.06 | test_service_offerings.py test_01_create_service_offering | Success | 0.11 | test_service_offerings.py
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817585#comment-15817585 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94661240 --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java --- @@ -115,8 +115,10 @@ public void execute() { List snapshotResponses = new ArrayList(); for (Snapshot snapshot : result.first()) { SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot); -snapshotResponse.setObjectName("snapshot"); -snapshotResponses.add(snapshotResponse); +if (snapshotResponse != null) { +snapshotResponse.setObjectName("snapshot"); --- End diff -- I've added a few comments. If we implement those comments, then null should not be a problem here (in other words, the code in this class could remain unchanged). > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817588#comment-15817588 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94660627 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -493,7 +494,9 @@ public SnapshotResponse createSnapshotResponse(Snapshot snapshot) { snapshotInfo = (SnapshotInfo)snapshot; } else { DataStoreRole dataStoreRole = getDataStoreRole(snapshot, _snapshotStoreDao, _dataStoreMgr); - --- End diff -- I would say the default should be DataStoreRole.Image for getDataStoreRole and so getDataStoreRole should probably never return null. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817586#comment-15817586 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94660806 --- Diff: engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/PrimaryDataStoreProviderManagerImpl.java --- @@ -56,7 +55,7 @@ public void config() { @Override public PrimaryDataStore getPrimaryDataStore(long dataStoreId) { -StoragePoolVO dataStoreVO = dataStoreDao.findById(dataStoreId); +StoragePoolVO dataStoreVO = dataStoreDao.findByIdIncludingRemoved(dataStoreId); --- End diff -- Is getPrimaryDataStore(long) called from many places? If so, it might be a bit risky to change this from findById to findByIdIncludingRemoved unless we are pretty sure all of the calling code is OK with that change. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817587#comment-15817587 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94659104 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); --- End diff -- Another possibility here is that we could simply still try to retrieve "dataStore" and then perform this check: DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); if (dataStore == null) { return DataStoreRole.Image; } If "dataStore" equals null, then it was removed, which should only be something that happened when unmanaged storage is being used (thus when the the snapshot resides on secondary storage). > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15817172#comment-15817172 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on the issue: https://github.com/apache/cloudstack/pull/1735 @serg38 I had some open questions on code which are not yet answered specifically related to use case of null case and comparison of non comparable properties. Also, For unmanaged storage there is nothing called snapshot copy on primary yet once the snapshot is created. So I am not understanding what are you referring to here. I had replied to your comment on dev mail but didn't get any response. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816793#comment-15816793 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user serg38 commented on the issue: https://github.com/apache/cloudstack/pull/1735 @mike-tutkowski The only comments in this PR are about deletion of PS with a snapshot copy. I am 100% agree with your statement. This PR excludes destroyed snapshot copies including ones on the PS from evaluation during the listSnaphsot call thus avoiding NPE if original PS is already deleted. Did you have other suggestions for this PR? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816097#comment-15816097 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816095#comment-15816095 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @mike-tutkowski sorry I don't have the bandwidth for a review, though I can facilitate with running tests. Maybe @anshul1886 and/or @serg38 can comment. Thanks. @blueorangutan test > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815770#comment-15815770 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on the issue: https://github.com/apache/cloudstack/pull/1735 @serg38 @anshul1886 @rhtyd Maybe someone could take a look at my comments before we check this in and see if they think any of those should be implemented here. Thanks > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815427#comment-15815427 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-453 > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815253#comment-15815253 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815248#comment-15815248 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @serg38 sure @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815052#comment-15815052 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user serg38 commented on the issue: https://github.com/apache/cloudstack/pull/1735 @mike-tutkowski @anshul1886 @rhtyd We had enough LGTM and successful test results for this PR. Are there any concern before merging it? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15799221#comment-15799221 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94657561 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); +if (snapshotStore.getState() != null && ! snapshotStore.getState().equals(ObjectInDataStoreStateMachine.State.Destroyed)) { --- End diff -- For managed storage, that is true. For unmanaged storage, one should be able to delete the primary storage from which a snapshot was created and the snapshot should be able to remain (since the snapshot, in this case, is on secondary storage). > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15797832#comment-15797832 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94555784 --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java --- @@ -517,10 +517,10 @@ public String getSecondaryStorageURL(SnapshotVO snapshot) { List ids = getIdsListFromCmd(cmd.getId(), cmd.getIds()); TernarydomainIdRecursiveListProject = new Ternary (cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); - Long domainId = domainIdRecursiveListProject.first(); - Boolean isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); +_accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); +Long domainId = domainIdRecursiveListProject.first(); +Boolean isRecursive = domainIdRecursiveListProject.second(); +ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); --- End diff -- These type of changes should not be done on unrelated file as it makes following changes difficult. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15797830#comment-15797830 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94555654 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); +if (snapshotStore.getState() != null && ! snapshotStore.getState().equals(ObjectInDataStoreStateMachine.State.Destroyed)) { --- End diff -- As pointed out by @mike-tutkowski store cannot be destroyed if there are snapshots. Also that enum is meant for snapshot (and entities like that) and not for snapshot store. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15797820#comment-15797820 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94554986 --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java --- @@ -115,8 +115,10 @@ public void execute() { List snapshotResponses = new ArrayList(); for (Snapshot snapshot : result.first()) { SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot); -snapshotResponse.setObjectName("snapshot"); -snapshotResponses.add(snapshotResponse); +if (snapshotResponse != null) { +snapshotResponse.setObjectName("snapshot"); --- End diff -- What is the use case for null case when that can happen? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15795173#comment-15795173 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94412144 --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java --- @@ -115,8 +115,10 @@ public void execute() { List snapshotResponses = new ArrayList(); for (Snapshot snapshot : result.first()) { SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot); -snapshotResponse.setObjectName("snapshot"); -snapshotResponses.add(snapshotResponse); +if (snapshotResponse != null) { +snapshotResponse.setObjectName("snapshot"); --- End diff -- This check is added as we introduced a case in `createSnapshotResponse` null is returned, and in that case we should skip the response > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15795146#comment-15795146 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94410299 --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java --- @@ -517,10 +517,10 @@ public String getSecondaryStorageURL(SnapshotVO snapshot) { List ids = getIdsListFromCmd(cmd.getId(), cmd.getIds()); TernarydomainIdRecursiveListProject = new Ternary (cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); - Long domainId = domainIdRecursiveListProject.first(); - Boolean isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); +_accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); +Long domainId = domainIdRecursiveListProject.first(); +Boolean isRecursive = domainIdRecursiveListProject.second(); +ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); --- End diff -- Hi @anshul1886, at the beggining of each line there's one space added, to be consistent with indentation > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15794258#comment-15794258 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94362243 --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java --- @@ -115,8 +115,10 @@ public void execute() { List snapshotResponses = new ArrayList(); for (Snapshot snapshot : result.first()) { SnapshotResponse snapshotResponse = _responseGenerator.createSnapshotResponse(snapshot); -snapshotResponse.setObjectName("snapshot"); -snapshotResponses.add(snapshotResponse); +if (snapshotResponse != null) { +snapshotResponse.setObjectName("snapshot"); --- End diff -- Is any issue observed here for which null check is added? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15794252#comment-15794252 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r94362119 --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java --- @@ -517,10 +517,10 @@ public String getSecondaryStorageURL(SnapshotVO snapshot) { List ids = getIdsListFromCmd(cmd.getId(), cmd.getIds()); TernarydomainIdRecursiveListProject = new Ternary (cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); - Long domainId = domainIdRecursiveListProject.first(); - Boolean isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); +_accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); +Long domainId = domainIdRecursiveListProject.first(); +Boolean isRecursive = domainIdRecursiveListProject.second(); +ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); --- End diff -- @nvazquez What is changed here? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15694052#comment-15694052 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Trillian test result (tid-426) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 36018 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1735-t426-kvm-centos7.zip Test completed. 34 look ok, 14 have error(s) Test | Result | Time (s) | Test File --- | --- | --- | --- test_02_VPC_default_routes | `Failure` | 797.53 | test_vpc_router_nics.py test_01_VPC_nics_after_destroy | `Failure` | 837.70 | test_vpc_router_nics.py test_05_rvpc_multi_tiers | `Failure` | 364.54 | test_vpc_redundant.py test_04_rvpc_network_garbage_collector_nics | `Failure` | 302.68 | test_vpc_redundant.py test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 308.34 | test_vpc_redundant.py test_02_redundant_VPC_default_routes | `Failure` | 860.08 | test_vpc_redundant.py test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 364.81 | test_vpc_redundant.py test_02_attach_volume | `Failure` | 668.53 | test_volumes.py test_01_create_volume | `Failure` | 684.11 | test_volumes.py test_10_attachAndDetach_iso | `Failure` | 683.95 | test_vm_life_cycle.py test_04_change_offering_small | `Failure` | 794.82 | test_service_offerings.py test_router_dns_guestipquery | `Failure` | 277.49 | test_router_dns.py test_router_dhcphosts | `Failure` | 188.63 | test_router_dhcphosts.py test_router_dhcp_opts | `Failure` | 21.43 | test_router_dhcphosts.py test_04_rvpc_privategw_static_routes | `Failure` | 1026.10 | test_privategw_acl.py test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 879.57 | test_privategw_acl.py test_02_vpc_privategw_static_routes | `Failure` | 975.48 | test_privategw_acl.py test_isolate_network_password_server | `Failure` | 188.89 | test_password_server.py test_reboot_router | `Failure` | 439.34 | test_network.py test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | `Failure` | 831.86 | test_network.py test_network_rules_acquired_public_ip_2_nat_rule | `Failure` | 679.68 | test_network.py test_network_rules_acquired_public_ip_1_static_nat_rule | `Failure` | 675.78 | test_network.py test_02_port_fwd_on_non_src_nat | `Failure` | 678.99 | test_network.py test_01_port_fwd_on_src_nat | `Failure` | 673.86 | test_network.py test_assign_and_removal_lb | `Failure` | 110.42 | test_loadbalance.py test_02_create_lb_rule_non_nat | `Failure` | 110.46 | test_loadbalance.py test_01_create_lb_rule_src_nat | `Failure` | 110.59 | test_loadbalance.py test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 301.21 | test_internal_lb.py test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Failure` | 230.32 | test_internal_lb.py test_01_vpc_site2site_vpn | `Error` | 300.79 | test_vpc_vpn.py test_01_redundant_vpc_site2site_vpn | `Error` | 386.60 | test_vpc_vpn.py test_05_rvpc_multi_tiers | `Error` | 425.47 | test_vpc_redundant.py test_02_list_snapshots_with_removed_data_store | `Error` | 6.27 | test_snapshots.py ContextSuite context=TestRouterDHCPHosts>:teardown | `Error` | 239.35 | test_router_dhcphosts.py test_04_rvpc_internallb_haproxy_stats_on_all_interfaces | `Error` | 316.07 | test_internal_lb.py test_03_vpc_internallb_haproxy_stats_on_all_interfaces | `Error` | 230.54 | test_internal_lb.py test_01_vpc_remote_access_vpn | Success | 76.23 | test_vpc_vpn.py test_09_delete_detached_volume | Success | 15.48 | test_volumes.py test_08_resize_volume | Success | 15.39 | test_volumes.py test_07_resize_fail | Success | 20.49 | test_volumes.py test_06_download_detached_volume | Success | 15.29 | test_volumes.py test_05_detach_volume | Success | 100.26 | test_volumes.py test_04_delete_attached_volume | Success | 10.21 | test_volumes.py test_03_download_attached_volume | Success | 15.29 | test_volumes.py test_deploy_vm_multiple | Success | 324.11 | test_vm_life_cycle.py test_deploy_vm | Success | 0.03 | test_vm_life_cycle.py test_advZoneVirtualRouter | Success | 0.02 | test_vm_life_cycle.py test_09_expunge_vm | Success | 185.30 | test_vm_life_cycle.py test_08_migrate_vm | Success | 41.06 | test_vm_life_cycle.py test_07_restore_vm | Success | 0.15 | test_vm_life_cycle.py test_06_destroy_vm | Success | 125.85 | test_vm_life_cycle.py test_03_reboot_vm | Success | 125.90 | test_vm_life_cycle.py test_02_start_vm | Success | 5.15 | test_vm_life_cycle.py test_01_stop_vm | Success | 125.89 | test_vm_life_cycle.py
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15693429#comment-15693429 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on the issue: https://github.com/apache/cloudstack/pull/1735 @jburwell @rhtyd sorry I've been off yesterday, do I push force to kick tests again? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15692710#comment-15692710 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15692709#comment-15692709 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @jburwell the Travis failure is ignorable caused by a oobm corner case (exception is ignorable). I'll work on a fix soon. @blueorangutan test > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15692669#comment-15692669 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-245 > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15692499#comment-15692499 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15692496#comment-15692496 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15690652#comment-15690652 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user jburwell commented on the issue: https://github.com/apache/cloudstack/pull/1735 @nvazquez could you please check into the Travis failures? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15689455#comment-15689455 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 LGTM. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15689454#comment-15689454 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15684663#comment-15684663 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on the issue: https://github.com/apache/cloudstack/pull/1735 @jburwell I added new Marvin test in `test_snapshots.py` > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15681282#comment-15681282 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-184 > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15680674#comment-15680674 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15680669#comment-15680669 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15676764#comment-15676764 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r88660264 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); +if (snapshotStore.getState() != null && ! snapshotStore.getState().equals(ObjectInDataStoreStateMachine.State.Destroyed)) { +DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); -MapmapCapabilities = dataStore.getDriver().getCapabilities(); +Map mapCapabilities = dataStore.getDriver().getCapabilities(); -if (mapCapabilities != null) { -String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString()); -Boolean supportsStorageSystemSnapshots = new Boolean(value); +if (mapCapabilities != null) { +String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString()); +Boolean supportsStorageSystemSnapshots = new Boolean(value); --- End diff -- Done, thanks! > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15665336#comment-15665336 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r87915067 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); +if (snapshotStore.getState() != null && ! snapshotStore.getState().equals(ObjectInDataStoreStateMachine.State.Destroyed)) { +DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); -MapmapCapabilities = dataStore.getDriver().getCapabilities(); +Map mapCapabilities = dataStore.getDriver().getCapabilities(); -if (mapCapabilities != null) { -String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString()); -Boolean supportsStorageSystemSnapshots = new Boolean(value); +if (mapCapabilities != null) { +String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString()); +Boolean supportsStorageSystemSnapshots = new Boolean(value); --- End diff -- `new Boolean` skips the constant pool -- putting unnecessary pressure on the heap and creating a potential memory leak. Please use `Boolean.valueOf` to part the value to avoid this issue. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15648267#comment-15648267 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on the issue: https://github.com/apache/cloudstack/pull/1735 @jburwell sure, will work on it > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15648121#comment-15648121 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user jburwell commented on the issue: https://github.com/apache/cloudstack/pull/1735 @nvazquez could you please add a Marvin test to verify this fix? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15647740#comment-15647740 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user nvazquez commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1735#discussion_r87001105 --- Diff: server/src/com/cloud/api/ApiResponseHelper.java --- @@ -526,16 +529,18 @@ public static DataStoreRole getDataStoreRole(Snapshot snapshot, SnapshotDataStor } long storagePoolId = snapshotStore.getDataStoreId(); -DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary); +if (! snapshotStore.getState().equals(ObjectInDataStoreStateMachine.State.Destroyed)){ --- End diff -- Done, thanks @rhtyd > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15647730#comment-15647730 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user serg38 commented on the issue: https://github.com/apache/cloudstack/pull/1735 @ustcweizhou Not necessary. The issue affects removal of primary storage DS where there are snapshot copies. After that the snapshot could remain on secondary storage. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15647090#comment-15647090 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15647042#comment-15647042 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user ustcweizhou commented on the issue: https://github.com/apache/cloudstack/pull/1735 if the data store is deleted, the snapshot should be removed as well, right? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15646323#comment-15646323 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user serg38 commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd @jburwell The tests didn't kick in last time. Can we fire matrix again? > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15635813#comment-15635813 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user abhinandanprateek commented on the issue: https://github.com/apache/cloudstack/pull/1735 LGTM on code review. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15625985#comment-15625985 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 @blueorangutan test > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15625981#comment-15625981 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-131 > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15625851#comment-15625851 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user blueorangutan commented on the issue: https://github.com/apache/cloudstack/pull/1735 @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15625849#comment-15625849 ] ASF GitHub Bot commented on CLOUDSTACK-9570: Github user rhtyd commented on the issue: https://github.com/apache/cloudstack/pull/1735 LGTM. I'll fire some regression tests. @blueorangutan package > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CLOUDSTACK-9570) Bug in listSnapshots for snapshots with deleted data stores
[ https://issues.apache.org/jira/browse/CLOUDSTACK-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15609284#comment-15609284 ] ASF GitHub Bot commented on CLOUDSTACK-9570: GitHub user nvazquez opened a pull request: https://github.com/apache/cloudstack/pull/1735 CLOUDSTACK-9570: Bug in listSnapshots for snapshots with deleted data stores ## Actual behaviour If there is snapshot on a data store that is removed, `listSnapshots` still tries to enumerate it and gives error (in this example data store 2 has been removed): `client/api?command=listSnapshots=true=true` ```xml 530 4250 Unable to locate datastore with id 2 ``` ## Reproduce error This steps can be followed to reproduce issue: * Take a snapshot of a volume (this creates a references for primary storage and secondary storage in snapshot_store_ref table * Simulate retiring primary data storage where snapshot is cached (in this example X is a fake data store and Y is snapshot id): ``` UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" WHERE `id`='Y'; ``` * List snapshots: `client/api?command=listSnapshots=true=true` You can merge this pull request into a Git repository by running: $ git pull https://github.com/nvazquez/cloudstack list-snapshots-issue Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1735.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1735 commit dd7d85a71d5e9f889974c5ed4d5d14a5e70354a3 Author: nvazquezDate: 2016-10-06T18:28:20Z CLOUDSTACK-9570: Bug in listSnapshots for snapshots with deleted data stores > Bug in listSnapshots for snapshots with deleted data stores > --- > > Key: CLOUDSTACK-9570 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9570 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: API >Reporter: Nicolas Vazquez >Assignee: Nicolas Vazquez > > h3. Actual behaviour > If there is snapshot on a data store that is removed, {{listSnapshots}} still > tries to enumerate it and gives error (in this example data store 2 has been > removed): > {code:xml|title=/client/api?command=listSnapshots=true=true|borderStyle=solid} > >530 >4250 >Unable to locate datastore with id 2 > > {code} > h3. Reproduce error > This steps can be followed to reproduce issue: > * Take a snapshot of a volume (this creates a references for primary storage > and secondary storage in snapshot_store_ref table > * Simulate retiring primary data storage where snapshot is cached (in this > example X is a fake data store and Y is snapshot id): > {{UPDATE `cloud`.`snapshot_store_ref` SET `store_id`='X', `state`="Destroyed" > WHERE `id`='Y';}} > * List snapshots > {{/client/api?command=listSnapshots=true=true}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)