[jira] [Resolved] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-05-06 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard resolved CLOUDSTACK-6472.
---

Resolution: Fixed

 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The listUsageRecords API command, pulls down the list of usage records in the 
 cloud_usage database and augments records with information pulled from the 
 cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-05-03 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988617#comment-13988617
 ] 

Pierre-Yves Ritschard commented on CLOUDSTACK-6472:
---

This can now be closed

 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The listUsageRecords API command, pulls down the list of usage records in the 
 cloud_usage database and augments records with information pulled from the 
 cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977939#comment-13977939
 ] 

Pierre-Yves Ritschard commented on CLOUDSTACK-6472:
---

Ce patch is up on review board: https://reviews.apache.org/r/20557/

 GenerateUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Comment Edited] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977939#comment-13977939
 ] 

Pierre-Yves Ritschard edited comment on CLOUDSTACK-6472 at 4/23/14 7:35 AM:


The patch is up on review board: https://reviews.apache.org/r/20557/


was (Author: pyritschard):
Ce patch is up on review board: https://reviews.apache.org/r/20557/

 GenerateUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977942#comment-13977942
 ] 

Pierre-Yves Ritschard commented on CLOUDSTACK-6472:
---

To reproduce:

1. Wait for cloud-usage to generate records for a running vm.
2. Delete the VM and wait for it to be in 'Expunged' state, it will have a 
non-null 'removed' field in the vm_instance table
3. Issue the GenerateUsageRecords API command, it will fail and log a stack 
trace to the management-server log



 GenerateUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Comment Edited] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977942#comment-13977942
 ] 

Pierre-Yves Ritschard edited comment on CLOUDSTACK-6472 at 4/23/14 7:45 AM:


To reproduce:

1. Wait for cloud-usage to generate records for a running vm.
2. Delete the VM and wait for it to be in 'Expunged' state, it will have a 
non-null 'removed' field in the vm_instance table
3. Issue the listUsageRecords API command, it will fail and log a stack trace 
to the management-server log




was (Author: pyritschard):
To reproduce:

1. Wait for cloud-usage to generate records for a running vm.
2. Delete the VM and wait for it to be in 'Expunged' state, it will have a 
non-null 'removed' field in the vm_instance table
3. Issue the GenerateUsageRecords API command, it will fail and log a stack 
trace to the management-server log



 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard updated CLOUDSTACK-6472:
--

Summary: listUsageRecords generates NPEs for expunging instances  (was: 
GenerateUsageRecords generates NPEs for expunging instances)

 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13977948#comment-13977948
 ] 

Pierre-Yves Ritschard commented on CLOUDSTACK-6472:
---

Here is the relevant stacktrace:

2014-04-22 00:18:07,417 ERROR [cloud.api.ApiServer] 
(catalina-exec-2:ctx-60c87510 ctx-22de212f ctx-a88a3dd7) unhandled exception 
executing api command: listUsageRecords
java.lang.NullPointerException
at 
com.cloud.api.ApiResponseHelper.createUsageResponse(ApiResponseHelper.java:3308)
at 
org.apache.cloudstack.api.command.admin.usage.GetUsageRecordsCmd.execute(GetUsageRecordsCmd.java:119)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161)
at com.cloud.api.ApiServer.queueCommand(ApiServer.java:531)
at com.cloud.api.ApiServer.handleRequest(ApiServer.java:374)
at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:323)
at com.cloud.api.ApiServlet.access$000(ApiServlet.java:53)
at com.cloud.api.ApiServlet$1.run(ApiServlet.java:115)
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:112)
at com.cloud.api.ApiServlet.doGet(ApiServlet.java:74)
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:615)
at 
org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at 
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889)
at 
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:744)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2282)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

 GenerateUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard updated CLOUDSTACK-6472:
--

Description: 
The listUsageRecords API command, pulls down the list of usage records in the 
cloud_usage database and augments records with information pulled from the 
cloud database.

When dealing with instance records, only instances which are do not have a 
value for the removed field are considered. Unfortunately, since the output of 
_entityMgr.findById is not checked this means that Null Pointer Exceptions are 
generated when trying to access the output for expunged VMs.

The attached patch fixes the issue and applies a similar fix for other similar 
cases.

  was:
The GenerateUsageRecords API command, pulls down the list of usage records in 
the cloud_usage database and augments records with information pulled from the 
cloud database.

When dealing with instance records, only instances which are do not have a 
value for the removed field are considered. Unfortunately, since the output of 
_entityMgr.findById is not checked this means that Null Pointer Exceptions are 
generated when trying to access the output for expunged VMs.

The attached patch fixes the issue and applies a similar fix for other similar 
cases.


 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The listUsageRecords API command, pulls down the list of usage records in the 
 cloud_usage database and augments records with information pulled from the 
 cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard updated CLOUDSTACK-6472:
--

Attachment: (was: 0001-handle-removed-entities.patch)

 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard

 The listUsageRecords API command, pulls down the list of usage records in the 
 cloud_usage database and augments records with information pulled from the 
 cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CLOUDSTACK-6472) listUsageRecords generates NPEs for expunging instances

2014-04-23 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard updated CLOUDSTACK-6472:
--

Attachment: 0001-handle-removed-entities.patch

patch without whitespace glitches

 listUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The listUsageRecords API command, pulls down the list of usage records in the 
 cloud_usage database and augments records with information pulled from the 
 cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-22 Thread Pierre-Yves Ritschard (JIRA)
Pierre-Yves Ritschard created CLOUDSTACK-6472:
-

 Summary: GenerateUsageRecords generates NPEs for expunging 
instances
 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public (Anyone can view this level - this is the default.)
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard


The GenerateUsageRecords API command, pulls down the list of usage records in 
the cloud_usage database and augments records with information pulled from the 
cloud database.

When dealing with instance records, only instances which are do not have a 
value for the removed field are considered. Unfortunately, since the output of 
_entityMgr.findById is not checked this means that Null Pointer Exceptions are 
generated when trying to access the output for expunged VMs.

The attached patch fixes the issue and applies a similar fix for other similar 
cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (CLOUDSTACK-6472) GenerateUsageRecords generates NPEs for expunging instances

2014-04-22 Thread Pierre-Yves Ritschard (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre-Yves Ritschard updated CLOUDSTACK-6472:
--

Attachment: 0001-handle-removed-entities.patch

Patch for CLOUDSTACK-6472

 GenerateUsageRecords generates NPEs for expunging instances
 ---

 Key: CLOUDSTACK-6472
 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6472
 Project: CloudStack
  Issue Type: Bug
  Security Level: Public(Anyone can view this level - this is the 
 default.) 
  Components: Management Server, Usage
Affects Versions: 4.3.0
 Environment: linux
Reporter: Pierre-Yves Ritschard
 Attachments: 0001-handle-removed-entities.patch


 The GenerateUsageRecords API command, pulls down the list of usage records in 
 the cloud_usage database and augments records with information pulled from 
 the cloud database.
 When dealing with instance records, only instances which are do not have a 
 value for the removed field are considered. Unfortunately, since the output 
 of _entityMgr.findById is not checked this means that Null Pointer Exceptions 
 are generated when trying to access the output for expunged VMs.
 The attached patch fixes the issue and applies a similar fix for other 
 similar cases.



--
This message was sent by Atlassian JIRA
(v6.2#6252)