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

Alena Prokharchyk commented on CLOUDSTACK-7218:
-----------------------------------------------

Its a regression bug caused by Secondary ip address feature. 

commit aedb8c478e88ad393246b9fa08a7fdac53e8e2d9
Author: Jayapal Uradi <[email protected]>
Date:   Mon Mar 4 11:02:09 2013 +0530

    CLOUDSTACK-24: mipn feature for isolated and vpc networks
    
     
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Multiple+IP+address+per+NIC
     https://issues.apache.org/jira/browse/CLOUDSTACK-24


Before the fix, we didn't allow static nat to be enabled per 1 vm and multiple 
public ips. So during the vm expunge, we always expected one static nat per vm 
to be cleaned up.
After the fix, we allow more than one static nat ips per vm, as long as they 
are assigned to the different secondary ip addresses of the same vm. But during 
the vm clenaup, we still expect only one ip per vm to be static nat enabled, 
and disable the static nat just for one public ip, leaving the other one 
assigned to the vm although the vm is already gone. Hence the NPE.


For QA steps to reproduce:

1) Create network.
2) Deploy the vm. Create a secondary ip address for vm. So the vm has 2 ips 
now: vIp1 and vIp2
3) Associate 2 public ip addresses to the network: IP1 and IP2
4) Enable 2 static nats: one for vIp1/IP1, another for vIp2/IP2
5) Delete the network.

You will hit the NPE. Because during the vm expunge static nat will get 
disabled just for one of the public ip addresses. And the second one will still 
have the vmId assigned; and NPE will happen when we try to access the vm that 
no longer exists.


> [Automation] NPE observed while deleting account in automation run
> ------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-7218
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7218
>             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: KVM (RHEL 6.3)
>            Reporter: Rayees Namathponnan
>            Assignee: Alena Prokharchyk
>            Priority: Critical
>             Fix For: 4.5.0
>
>
> This issue is observed in automation log, NPE thrown while deleting account
> 2014-07-31 02:20:56,102 DEBUG [c.c.n.r.RulesManagerImpl] 
> (API-Job-Executor-2:ctx-523291d6 job-5302 ctx-28b51397) There are no static 
> nat
>  rules to apply for ip id=28
> 2014-07-31 02:20:56,105 WARN  [c.c.u.AccountManagerImpl] 
> (API-Job-Executor-2:ctx-523291d6 job-5302 ctx-28b51397) Failed to cleanup 
> accou
> nt 
> Acct[b1cf2381-ab36-4ebc-90ff-f08acaf5e02d-test-account-TestVmNetworkOperations-test_add_static_nat_rule_1_ISOLATED-YI0OCS]
>  due to
> java.lang.NullPointerException
>         at 
> com.cloud.network.rules.RulesManagerImpl.createStaticNatForIp(RulesManagerImpl.java:1391)
>         at 
> com.cloud.network.rules.RulesManagerImpl.applyStaticNatForIp(RulesManagerImpl.java:1321)
>         at 
> com.cloud.network.rules.RulesManagerImpl.revokeAllPFAndStaticNatRulesForIp(RulesManagerImpl.java:1104)
>         at sun.reflect.GeneratedMethodAccessor524.invoke(Unknown Source)
>         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 
> 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.$Proxy105.revokeAllPFAndStaticNatRulesForIp(Unknown 
> Source)
>         at 
> com.cloud.network.IpAddressManagerImpl.cleanupIpResources(IpAddressManagerImpl.java:540)
>         at 
> com.cloud.network.IpAddressManagerImpl.applyIpAssociations(IpAddressManagerImpl.java:936)
>         at 
> org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.cleanupNetworkResources(NetworkOrchestrator.java:2650)
>         at 
> org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.destroyNetwork(NetworkOrchestrator.java:2196)
>         at 
> com.cloud.user.AccountManagerImpl.cleanupAccount(AccountManagerImpl.java:793)
>         at 
> com.cloud.user.AccountManagerImpl.deleteAccount(AccountManagerImpl.java:667)
>         at 
> com.cloud.user.AccountManagerImpl.deleteUserAccount(AccountManagerImpl.java:1441)
>         at sun.reflect.GeneratedMethodAccessor542.invoke(Unknown Source)
>         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 
> org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106)
>         at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
>         at 
> com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
>         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.$Proxy102.deleteUserAccount(Unknown Source)
>         at 
> org.apache.cloudstack.region.RegionManagerImpl.deleteUserAccount(RegionManagerImpl.java:187)
>         at 
> org.apache.cloudstack.region.RegionServiceImpl.deleteUserAccount(RegionServiceImpl.java:121)
>         at 
> org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd.execute(DeleteAccountCmd.java:104)
>         at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:141)
>         at 
> com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
>         at 
> org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:503)
>         at 
> org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
>         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 
> org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
>         at 
> org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:460)



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

Reply via email to