You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Sangeetha Hariharan (JIRA)" <ji...@apache.org> on 2014/09/10 01:44:28 UTC
[jira] [Created] (CLOUDSTACK-7523) java.lang.NullPointerException
when listing accounts.
Sangeetha Hariharan created CLOUDSTACK-7523:
-----------------------------------------------
Summary: java.lang.NullPointerException when listing accounts.
Key: CLOUDSTACK-7523
URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7523
Project: CloudStack
Issue Type: Bug
Security Level: Public (Anyone can view this level - this is the default.)
Components: Management Server
Affects Versions: 4.5.0
Environment: Build from master
Reporter: Sangeetha Hariharan
Assignee: frank zhang
Priority: Critical
Fix For: 4.5.0
Deploy a fresh Management server.
After this try to list Accounts , by going to Accounts tab in UI.
There is no entries returned and the UI keeps spinning.
listAccounts() fail with return code - 530 .
2014-09-09 12:38:59,932 INFO [a.c.c.a.ApiServer] (catalina-exec-18:ctx-0c561c21 ctx-dcbc1d59) (userId=2 accountId=2 sessionId=600DA8E1BD8DC8B8DF75DD5B5FC9E7E9) 10.215.3.17 -- GET command=listAccounts&response=json&sessionkey=2%2Bf%2BWC0FhPn6j%2BiLp3mj2POhdsY%3D&listAll=true&page=1&pagesize=20&_=1410305103203 530 null
Following exception seen in management server logs:
2014-09-09 08:39:22,417 DEBUG [c.c.a.ApiServlet] (catalina-exec-7:ctx-d2a3ffdc) ===START=== 10.216.50.29 -- GET command=listAccounts&response=json&sessionkey=XkWSjL0e3Xe3ckgR5jW2CsSYOeA%3D&listAll=true&page=1&pagesize=20&_=1410290672605
2014-09-09 08:39:22,832 ERROR [c.c.a.ApiServer] (catalina-exec-7:ctx-d2a3ffdc ctx-9db713ee) unhandled exception executing api command: [Ljava.lang.String;@1a1bdce4
java.lang.NullPointerException
at com.cloud.api.query.dao.AccountJoinDaoImpl.setResourceLimits(AccountJoinDaoImpl.java:144)
at com.cloud.api.query.dao.AccountJoinDaoImpl.newAccountResponse(AccountJoinDaoImpl.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.cloud.utils.db.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:34)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy111.newAccountResponse(Unknown Source)
at com.cloud.api.ApiDBUtils.newAccountResponse(ApiDBUtils.java:1788)
at com.cloud.api.query.ViewResponseHelper.createAccountResponse(ViewResponseHelper.java:353)
at com.cloud.api.query.QueryManagerImpl.searchForAccounts(QueryManagerImpl.java:1835)
at org.apache.cloudstack.api.command.user.account.ListAccountsCmd.execute(ListAccountsCmd.java:93)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:141)
at com.cloud.api.ApiServer.queueCommand(ApiServer.java:694)
at com.cloud.api.ApiServer.handleRequest(ApiServer.java:517)
at com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:273)
at com.cloud.api.ApiServlet$1.run(ApiServlet.java:117)
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:114)
at com.cloud.api.ApiServlet.doGet(ApiServlet.java:76)
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:2274)
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)
2014-09-09 08:39:22,835 DEBUG [c.c.a.ApiServlet] (catalina-exec-7:ctx-d2a3ffdc ctx-9db713ee) ===END=== 10.216.50.29 -- GET command=listAccounts&response=json&sessionkey=XkWSjL0e3Xe3ckgR5jW2CsSYOeA%3D&listAll=true&page=1&pagesize=20&_=1410290672605
The reason seems to the be absence of any entries being populated for user "baremetal-system-account" in resource_count table.
mysql> select * from account;
+----+--------------------------+--------------------------------------+------+-----------+---------+---------+----------------+----------------+-----------------+---------+
| id | account_name | uuid | type | domain_id | state | removed | cleanup_needed | network_domain | default_zone_id | default |
+----+--------------------------+--------------------------------------+------+-----------+---------+---------+----------------+----------------+-----------------+---------+
| 1 | system | 5a07cf4e-383f-11e4-94e5-4adf980f9414 | 1 | 1 | enabled | NULL | 0 | NULL | NULL | 1 |
| 2 | admin | 5a084bc2-383f-11e4-94e5-4adf980f9414 | 1 | 1 | enabled | NULL | 0 | NULL | NULL | 1 |
| 3 | baremetal-system-account | 21d9bb57-68bf-4ae0-84a9-94e788520e81 | 0 | 1 | enabled | NULL | 0 | NULL | NULL | 0 |
+----+--------------------------+--------------------------------------+------+-----------+---------+---------+----------------+----------------+-----------------+---------+
3 rows in set (0.01 sec)
mysql> select * from resource_count;
+----+------------+-----------+-------------------+-------+
| id | account_id | domain_id | type | count |
+----+------------+-----------+-------------------+-------+
| 1 | NULL | 1 | cpu | 0 |
| 2 | NULL | 1 | memory | 0 |
| 3 | NULL | 1 | primary_storage | 0 |
| 4 | NULL | 1 | secondary_storage | 0 |
| 9 | NULL | 1 | user_vm | 0 |
| 10 | NULL | 1 | public_ip | 0 |
| 11 | NULL | 1 | volume | 0 |
| 12 | NULL | 1 | snapshot | 0 |
| 13 | NULL | 1 | template | 0 |
| 14 | NULL | 1 | project | 0 |
| 15 | NULL | 1 | network | 0 |
| 16 | NULL | 1 | vpc | 0 |
| 17 | 1 | NULL | user_vm | 0 |
| 18 | 1 | NULL | public_ip | 0 |
| 19 | 1 | NULL | volume | 0 |
| 20 | 1 | NULL | snapshot | 0 |
| 21 | 1 | NULL | template | 0 |
| 22 | 1 | NULL | project | 0 |
| 23 | 1 | NULL | network | 0 |
| 24 | 1 | NULL | vpc | 0 |
| 25 | 1 | NULL | cpu | 0 |
| 26 | 1 | NULL | memory | 0 |
| 27 | 1 | NULL | primary_storage | 0 |
| 28 | 1 | NULL | secondary_storage | 0 |
| 29 | 2 | NULL | user_vm | 0 |
| 30 | 2 | NULL | public_ip | 0 |
| 31 | 2 | NULL | volume | 0 |
| 32 | 2 | NULL | snapshot | 0 |
| 33 | 2 | NULL | template | 0 |
| 34 | 2 | NULL | project | 0 |
| 35 | 2 | NULL | network | 0 |
| 36 | 2 | NULL | vpc | 0 |
| 37 | 2 | NULL | cpu | 0 |
| 38 | 2 | NULL | memory | 0 |
| 39 | 2 | NULL | primary_storage | 0 |
| 40 | 2 | NULL | secondary_storage | 0 |
+----+------------+-----------+-------------------+-------+
36 rows in set (0.00 sec)
Once the management server is restart again , this time listing account succeed . This is because we see the resource_count entries being populated for "baremetal-system-account" this time.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)