Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

Plugin Manager throws NPE if agent is down during sync

Details

  • Case Links:
    none
  • Regression:
    No

Description

If redeploying a plugin that was deployed while an agent was down. A NullPointerException is thrown and that plugin can no longer be manipulated.

Steps to reproduce:

1.) Stop an agent
2.) Deploy qmail-plugin.xml and wait for the agent sync to happen.
3.) Make an update to the plugin (anything even just touching the file) The following will appear in the server.log

2011-10-14 08:30:35,542 INFO [scheduler-6] [org.hyperic.hq.product.server.session.ProductPluginDeployer@430] Deploying plugin: /opt/vmare/vfabric/hyperic/server/hq-plugins/qmail-plugin.xml
2011-10-14 08:30:36,195 INFO [scheduler-6] [org.hyperic.hq.product.server.session.ProductManagerImpl@276] qmail plugin up to date (/opt/vmare/vfabric/hyperic/server/hq-plugins)
2011-10-14 08:30:36,911 ERROR [Global Plugin Sync (initiated by plugin deploy)1] [org.hyperic.hq.appdef.server.session.AgentManagerImpl@216] java.lang.NullPointerException
java.lang.NullPointerException
at org.hyperic.hq.appdef.server.session.AgentManagerImpl.updateStatusAndGetSyncInfo(AgentManagerImpl.java:1560)
at org.hyperic.hq.appdef.server.session.AgentManagerImpl.syncPluginToAgents(AgentManagerImpl.java:1519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at org.hyperic.hq.monitor.aop.aspects.PerformanceMonitor.monitorServiceMethod(PerformanceMonitor.java:84)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy59.syncPluginToAgents(Unknown Source)
at org.hyperic.hq.appdef.server.session.AgentManagerImpl$2$1.run(AgentManagerImpl.java:210)
at org.hyperic.hq.common.shared.TransactionRetry.runTransaction(TransactionRetry.java:54)
at org.hyperic.hq.appdef.server.session.AgentManagerImpl$2.processEvents(AgentManagerImpl.java:214)
at org.hyperic.hq.zevents.TimingListenerWrapper.processEvents(TimingListenerWrapper.java:42)
at org.hyperic.hq.zevents.BufferedListener$BufferedEventRunnable.run(BufferedListener.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

AgentManagerImpl:1560

if (status == null || !status.getMD5().equals(plugin.getMD5())) {

status.getMD5() returns null

EAM_AGENT_PLUGIN_STATUS shows:

| 10811 |           1 |    10100 | qmail-plugin.xml                 | qmail                 | qmail                 | NULL                             |             0 | SYNC_FAILURE     |     1318598875095 |

Plugin does not get deployed on active agents. When bring up stopped agent plugin doesn't get deployed. It makes it impossible to update a plugin.

Activity

Hide
Scott Feldstein added a comment -

This scenario wouldn't be common since it is unlikely that someone will update a plugin via the UI and immediately update it in the directory, so downgrading it to major. But it still needs to be fixed.

Show
Scott Feldstein added a comment - This scenario wouldn't be common since it is unlikely that someone will update a plugin via the UI and immediately update it in the directory, so downgrading it to major. But it still needs to be fixed.
Hide
Scott Feldstein added a comment -

the flow of the code was not taking into account that md5 could be null at this stage if two separate threads are working on one single plugin.

checked into master

Show
Scott Feldstein added a comment - the flow of the code was not taking into account that md5 could be null at this stage if two separate threads are working on one single plugin. checked into master

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    2 years, 24 weeks, 4 days ago