Bug 534361 (RHQ-1165)

Summary: Investigate agent subsystem start order and dependencies
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2CC: cwelton, jshaughn
Target Milestone: ---Keywords: FutureFeature, Task
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1165
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-02 20:30:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server log none

Description Heiko W. Rupp 2008-11-21 16:26:00 UTC
When an agent connects with an outdated inventory (e.g. a resource got deleted while the agent was offline),
the server will spit messages like the one below.
From the serve pov this is correct, but still annoying and also irritating to the user.

We should perhaps when starting the agent first sync the inventory. THen for all no-longer existing resource purge any data that might be lying around for them (measurements, ops results, ...) and only then start the components and all those threads that do useful things.

17:18:29,257 INFO  [DiscoveryServerServiceImpl] Error processing availability report from [snert]: java.lang.RuntimeException:javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.transaction.RollbackException:[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch-Eintrag 20 insert into RHQ_AVAILABILITY (START_TIME, END_TIME, AVAILABILITY_TYPE, RESOURCE_ID, ID) values (1227284304018, NULL, 1, 500058, 502095) wurde abgebrochen.  Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.[SQLException=Batch-Eintrag 20 insert into RHQ_AVAILABILITY (START_TIME, END_TIME, AVAILABILITY_TYPE, RESOURCE_ID, ID) values (1227284304018, NULL, 1, 500058, 502095) wurde abgebrochen.  Rufen Sie 'getNextException' auf, um die Ursache zu erfahren. -> ERROR: insert or update on table "rhq_availability" violates foreign key constraint "rhq_availability_resource_id_fkey"
  Detail: Key (resource_id)=(500058) is not present in table "rhq_resource".(error-code=0,sql-state=23503)]

Comment 1 Red Hat Bugzilla 2009-11-10 20:27:08 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1165


Comment 2 wes hayutin 2010-02-16 15:44:45 UTC
mass move off the qa triage list.  These are tasks for dev.

Comment 3 Corey Welton 2010-08-18 15:06:08 UTC
Moved to ONQA for further examination.  Heiko will provide repro steps.

Comment 4 Sunil Kondkar 2010-08-25 11:01:00 UTC
Tested on jon-2.4.0.GA

Stopped the agent and uninventoried resource 'postgres'. Again started the agent and observed the server logs. The exception is not occurred in server log

However, again stopped the agent, uninventoried resource 'JBossAS Server' (jboss-eap-5.0). Again started the agent and observed the server logs. Below exception is observed in server log.

2010-08-25 15:37:53,189 INFO  [org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl] Error processing availability report from [sunillaptop]: javax.ejb.EJBException:java.lang.NullPointerException -> java.lang.NullPointerException:null

Please find attached the server log.

Comment 5 Sunil Kondkar 2010-08-25 11:02:22 UTC
Created attachment 440886 [details]
server log