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)]
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1165
mass move off the qa triage list. These are tasks for dev.
Moved to ONQA for further examination. Heiko will provide repro steps.
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.
Created attachment 440886 [details] server log