[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15021143#comment-15021143
 ] 

Milamber commented on CLOUDSTACK-8845:
--------------------------------------


I have this bug on my test platform after an upgrade from 4.5.2 to 4.6.0.

After some analysis on your database, I think the issue come form the volume id 
3 and/or the snapshot id 1.
(same diagnotic on my database with another volume id/snapshot id)

When the list snapshot command run, the manager make 3 sql requests. Request 
[1] select the snapshots list, and for each snapshot, search all volume id for 
this snapshot with request [2], if 0 volume id found, else the request [3] is 
run to find the snapshot id from snapshot_store_ref table.

In your case, the requests [2] and [3] retrieve 0 result, so in the 
StorageSystemSnapshotStrategy.java:455 class with enter in a 
CloudRuntimeException and the list command failed.

I don't known (currently) how this bug is possible. In my test platform, I 
change the fields 'status' to 'Destroyed' and 'removed' to some date on 
snapshots table as a workaround.




[1] SELECT snapshots.id, snapshots.data_center_id, snapshots.account_id, 
snapshots.domain_id, snapshots.volume_id, 
snapshots.disk_offering_id, snapshots.name, snapshots.status, 
snapshots.snapshot_type, snapshots.type_description, 
snapshots.size, snapshots.created, snapshots.removed, 
snapshots.hypervisor_type, snapshots.version, snapshots.uuid, 
snapshots.min_iops, snapshots.max_iops 
FROM snapshots  
INNER JOIN account ON snapshots.account_id=account.id 
WHERE snapshots.account_id=2 AND snapshots.status != 'Destroyed' 
AND snapshots.snapshot_type != 2  AND snapshots.removed IS NULL  
AND  (account.type != 5 ) 
ORDER BY snapshots.created DESC  LIMIT 0, 500
GO

[2] SELECT volumes.id, volumes.name, volumes.pool_id, volumes.last_pool_id, 
volumes.account_id, 
volumes.domain_id, volumes.instance_id, volumes.device_id, volumes.size, 
volumes.min_iops, volumes.max_iops, 
volumes.folder, volumes.path, volumes.pod_id, volumes.created, 
volumes.attached, volumes.data_center_id, 
volumes.host_ip, volumes.disk_offering_id, volumes.template_id, 
volumes.first_snapshot_backup_uuid, 
volumes.volume_type, volumes.pool_type, volumes.removed, volumes.updated, 
volumes.update_count, 
volumes.recreatable, volumes.state, volumes.chain_info, volumes.uuid, 
volumes.format, 
volumes.provisioning_type, volumes.display_volume, volumes.iscsi_name, 
volumes.vm_snapshot_chain_size, 
volumes.iso_id, volumes.hv_ss_reserve 
FROM volumes 
WHERE volumes.id = 3
AND volumes.removed IS NULL 
GO

[3] SELECT snapshot_store_ref.id, snapshot_store_ref.store_id, 
snapshot_store_ref.store_role, snapshot_store_ref.snapshot_id,
 snapshot_store_ref.created, snapshot_store_ref.last_updated, 
snapshot_store_ref.size, 
snapshot_store_ref.physical_size, snapshot_store_ref.parent_snapshot_id, 
snapshot_store_ref.job_id,
 snapshot_store_ref.install_path, snapshot_store_ref.update_count, 
snapshot_store_ref.updated, snapshot_store_ref.state,
 snapshot_store_ref.ref_cnt, snapshot_store_ref.volume_id 
FROM snapshot_store_ref 
WHERE snapshot_store_ref.snapshot_id = 1
AND snapshot_store_ref.store_role = 'Primary'  
ORDER BY RAND() LIMIT 1
GO

> list snapshot without id is failing with Unable to determine the storage pool 
> of the snapshot
> ---------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8845
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8845
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: API
>    Affects Versions: 4.6.0
>            Reporter: prashant kumar mishra
>         Attachments: cloud.dmp, management-server.log
>
>
> steps
> --------
> Try to list snapshot using api/UI without passing id
> http://10.*.*.*:8080/client/api?command=listSnapshots&response=json&_=1442227513154
> {"listsnapshotsresponse":{"uuidList":[],"errorcode":530,"cserrorcode":4250,"errortext":"Unable
>  to determine the storage pool of the snapshot"}}
> logs
> -----
> 2015-09-14 10:23:10,579 DEBUG [c.c.a.ApiServlet] 
> (catalina-exec-4:ctx-600cffa2) ===START===  10.252.193.23 -- GET  
> command=listSnapshots&response=json&_=1442227513154
> 2015-09-14 10:23:10,635 ERROR [c.c.a.ApiServer] (catalina-exec-4:ctx-600cffa2 
> ctx-92e1cd5e) unhandled exception executing api command: 
> [Ljava.lang.String;@10e4744f
> com.cloud.utils.exception.CloudRuntimeException: Unable to determine the 
> storage pool of the snapshot
>       at 
> org.apache.cloudstack.storage.snapshot.StorageSystemSnapshotStrategy.canHandle(StorageSystemSnapshotStrategy.java:455)
>       at 
> org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:72)
>       at 
> org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl$3.canHandle(StorageStrategyFactoryImpl.java:69)
>       at 
> org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.bestMatch(StorageStrategyFactoryImpl.java:95)
>       at 
> org.apache.cloudstack.storage.helper.StorageStrategyFactoryImpl.getSnapshotStrategy(StorageStrategyFactoryImpl.java:69)
>       at 
> org.apache.cloudstack.storage.snapshot.SnapshotObject.isRevertable(SnapshotObject.java:133)
>       at 
> com.cloud.api.ApiResponseHelper.createSnapshotResponse(ApiResponseHelper.java:499)
>       at 
> org.apache.cloudstack.api.command.user.snapshot.ListSnapshotsCmd.execute(ListSnapshotsCmd.java:114)
>       at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:141)
>       at com.cloud.api.ApiServer.queueCommand(ApiServer.java:704)
>       at com.cloud.api.ApiServer.handleRequest(ApiServer.java:529)
>       at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:296)
>       at com.cloud.api.ApiServlet$1.run(ApiServlet.java:127)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
>       at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:124)
>       at com.cloud.api.ApiServlet.doGet(ApiServlet.java:86)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>       at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>       at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>       at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>       at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>       at 
> org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
>       at 
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:721)
>       at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2268)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>       at java.lang.Thread.run(Thread.java:722)
> 2015-09-14 10:23:10,638 DEBUG [c.c.a.ApiServlet] 
> (catalina-exec-4:ctx-600cffa2 ctx-92e1cd5e) ===END===  10.252.193.23 -- GET  
> command=listSnapshots&response=json&_=1442227513154
> 2015-09-14 10:23:18,098 INFO  [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (AsyncJobMgr-Heartbeat-1:ctx-b7a4637f) Begin cleanup expired async-jobs
> 2015-09-14 10:23:18,104 INFO  [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (AsyncJobMgr-Heartbeat-1:ctx-b7a4637f) End cleanup expired async-jobs
> 2015-09-14 10:23:18,472 DEBUG [c.c.a.m.AgentManagerImpl] 
> (AgentManager-Handler-1:null) SeqA 2-1758: Processing Seq 2-1758:  { Cmd , 
> MgmtId: -1, via: 2, Ver: v1, Flags: 11, 
> [{"com.cloud.agent.api.ConsoleProxyLoadReportCommand":{"_proxyVmId":2,"_loadInfo":"{\n
>   \"connections\": []\n}","wait":0}}] }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to