A Linux platform was reporting a package with architecture of "none". There is no "none" arch in RHQ_ARCHITECTURE so ContentManagerBean.mergeDiscoveredPackages was failing here: try { packageArchitecture = (Architecture) architectureQuery.getSingleResult(); } catch (Exception e) { throw new RuntimeException("Could not load architecture for architecture name [" + resourcePackage.getArchitectureName() + "] for package [" + resourcePackage.getName() + "]"); } for some reason, that runtime exception got swallowed somewhere else up the chain and this never got logged on server or agent. We need to a) probably just skip this package and not inventory it but inventory the rest of the package in the report and b) do not go silent here, we need to log this.
This is getting swallowed because: a) this is a async/guaranteed delivery API, so the agent side does a fire-n-forget b) the server-side throwns a undeclared exception (no logging done in server-side SLSB, just the exception is thrown) c) the only logging done when the exception is thrown is a DEBUG message in the comm layer I'll change this code to log a WARN and keep processing the rest of the report... no need to throw away the entire content report because of one bad arch type
here's the stack where the error occurs - you can follow this to see where the exception gets swallowed Daemon Thread [http-0.0.0.0-7080-5] (Suspended (breakpoint at line 218 in org.rhq.enterprise.server.content.ContentManagerBean)) org.rhq.enterprise.server.content.ContentManagerBean.mergeDiscoveredPackages(org.rhq.core.domain.content.transfer.ContentDiscoveryReport) line: 218 sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method] sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39 sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 112 org.jboss.ejb3.interceptor.InvocationContextImpl.proceed() line: 166 org.rhq.enterprise.server.common.TransactionInterruptInterceptor.addCheckedActionToTransactionManager(javax.interceptor.InvocationContext) line: 77 sun.reflect.GeneratedMethodAccessor109.invoke(java.lang.Object, java.lang.Object[]) line: not available sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.jboss.ejb3.interceptor.InvocationContextImpl.proceed() line: 118 org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(javax.interceptor.InvocationContext) line: 153 sun.reflect.GeneratedMethodAccessor108.invoke(java.lang.Object, java.lang.Object[]) line: not available sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.jboss.ejb3.interceptor.InvocationContextImpl.proceed() line: 118 org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 63 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 54 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.AllowedOperationsInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 47 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.tx.Ejb3TxPolicy(org.jboss.aspects.tx.TxPolicy).invokeInOurTx(org.jboss.aop.joinpoint.Invocation, javax.transaction.TransactionManager) line: 79 org.jboss.aspects.tx.TxInterceptor$Required.invoke(org.jboss.aop.joinpoint.Invocation) line: 191 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.aspects.tx.TxPropagationInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 95 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 62 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.security.Ejb3AuthenticationInterceptor(org.jboss.aspects.security.AuthenticationInterceptor).invoke(org.jboss.aop.joinpoint.Invocation) line: 77 org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 110 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.ENCPropagationInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 46 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(org.jboss.aop.joinpoint.Invocation) line: 106 org.jboss.ejb3.EJBContainerInvocation<A,T>(org.jboss.aop.joinpoint.MethodInvocation).invokeNext() line: 101 org.jboss.ejb3.stateless.StatelessContainer.localInvoke(java.lang.reflect.Method, java.lang.Object[], org.jboss.aspects.asynch.FutureHolder, org.jboss.ejb3.BeanContextLifecycleCallback<org.jboss.ejb3.stateless.StatelessBeanContext>) line: 240 org.jboss.ejb3.stateless.StatelessContainer.localInvoke(java.lang.reflect.Method, java.lang.Object[], org.jboss.aspects.asynch.FutureHolder) line: 210 org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 84 $Proxy332.mergeDiscoveredPackages(org.rhq.core.domain.content.transfer.ContentDiscoveryReport) line: not available org.rhq.enterprise.server.content.ContentServerServiceImpl.mergeDiscoveredPackages(org.rhq.core.domain.content.transfer.ContentDiscoveryReport) line: 59 sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method] sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39 sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(org.rhq.enterprise.communications.command.Command, java.io.InputStream, java.io.OutputStream) line: 184 sun.reflect.GeneratedMethodAccessor522.invoke(java.lang.Object, java.lang.Object[]) line: not available sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(org.jboss.mx.server.Invocation) line: 155 org.jboss.mx.server.Invocation.dispatch() line: 94 org.jboss.mx.server.Invocation.invoke() line: 86 org.jboss.mx.modelmbean.XMBean(org.jboss.mx.server.AbstractMBeanInvoker).invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 264 org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 659 javax.management.MBeanServerInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 288 $Proxy412.execute(org.rhq.enterprise.communications.command.Command, java.io.InputStream, java.io.OutputStream) line: not available org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(java.io.InputStream, org.jboss.remoting.InvocationRequest) line: 290 org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(org.jboss.remoting.InvocationRequest) line: 184 org.jboss.remoting.transport.servlet.ServletServerInvoker(org.jboss.remoting.ServerInvoker).invoke(org.jboss.remoting.InvocationRequest) line: 809 org.jboss.remoting.transport.servlet.ServletServerInvoker.processRequest(javax.servlet.http.HttpServletRequest, byte[], javax.servlet.http.HttpServletResponse) line: 232 sun.reflect.GeneratedMethodAccessor515.invoke(java.lang.Object, java.lang.Object[]) line: not available sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25 java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(org.jboss.mx.server.Invocation) line: 155 org.jboss.mx.server.Invocation.dispatch() line: 94 org.jboss.mx.server.Invocation.invoke() line: 86 org.jboss.mx.modelmbean.XMBean(org.jboss.mx.server.AbstractMBeanInvoker).invoke(java.lang.String, java.lang.Object[], java.lang.String[]) line: 264 org.jboss.mx.server.MBeanServerImpl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) line: 659 javax.management.MBeanServerInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) line: 288 $Proxy372.processRequest(javax.servlet.http.HttpServletRequest, byte[], javax.servlet.http.HttpServletResponse) line: not available org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 128 org.jboss.remoting.transport.servlet.web.ServerInvokerServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 157 org.jboss.remoting.transport.servlet.web.ServerInvokerServlet(javax.servlet.http.HttpServlet).service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 710 org.jboss.remoting.transport.servlet.web.ServerInvokerServlet(javax.servlet.http.HttpServlet).service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 803 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 290 org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206 org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 124 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235 org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 96 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235 org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206 org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 230 org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 175 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 182 org.jboss.web.tomcat.security.JaccContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 84 org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 127 org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 102 org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 157 org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 109 org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response) line: 262 org.apache.coyote.http11.Http11Processor.process(java.net.Socket) line: 844 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket) line: 583 org.apache.tomcat.util.net.JIoEndpoint$Worker.run() line: 446 java.lang.Thread.run() line: 619
we now log a WARN but continue processing the rest of the report
I actually have no idea how to test this. This was something greg hit on his machine - I never saw it. But I guess the repo steps would be: 1) rpm install a package whose architecture name in the metadata is "none". 2) enable platform content discovery on the platform you just rpm installed the package with "none" architecture 3) check the server log to see the WARN message but also notice that all the rest of the packages installed on the box are viewable
QA Verified. I'm going to go ahead and mark this as QA Verified -- packages which are returning "(none)" via the rpm query are few and far between, it seems -- gpg-pubkey* is all I found on RHEL and Fedora boxes. That they don't appear in the results seems to be an ok result for now. Other proposed changes (these below, or others) may be too invasive this late in the release. A possible solution down the road might be to dynamically generate all arch types that exist on a system, rather than store a static list of them in the db. Something like rpm -qa --queryformat "%{ARCH}\n"|sort|uniq ...would return a list of all arches that exist on any given system. Alternately, we could continually populate any "arch" table with this data as more arches are discovered. This would keep us from necessarily having to update the table with one-offs any time a new arch is discovered. I don't think handling this as a noarch (see sub-bug) is the correct thing to do -- noarch means something specific, i.e., a package that is arch-agnostic. I think if we were to file these rpms that return an arch as "(none)" from the rpm output as noarch, it might cause other issues down the road. Will comment on sub-bug or create a new one later.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2083