Bug 1147002 - Server log exception when saving a resource error
Summary: Server log exception when saving a resource error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin Container
Version: JON 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER04
: JON 3.3.0
Assignee: Thomas Segismont
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Depends On: 1147001
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-26 14:23 UTC by Thomas Segismont
Modified: 2014-12-11 14:02 UTC (History)
4 users (show)

Fixed In Version:
Clone Of: 1147001
Environment:
Last Closed: 2014-12-11 14:02:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thomas Segismont 2014-09-26 14:23:03 UTC
+++ This bug was initially created as a clone of Bug #1147001 +++

Description of problem:
An exception is logged on the server:
HHH000437: Attempting to save one or more entities that have a non-nullable association with an unsaved transient entity.

It appears as soon as the agent is restarted, during resource activation.

How reproducible:
Not 100% sure how to reproduce

Steps to Reproduce:
1.Setup RHQ server and agent environment on a machine with Postgres server running
2.In discovery queue, ignore Postgres resource
3.Wait for agent inventory to stabilize (couple of minutes)
4.Restart the agent

Actual results:
A Postgres plugin error is logged on the agent indicating that the credentials are invalid
The Hibernate HHH000437 issue message is logged on the server when the error is reported to the server.

Expected results:
A Postgres plugin error is logged on the agent indicating that the credentials are invalid.
No exception logged on the server

--- Additional comment from Thomas Segismont on 2014-09-26 16:22:35 CEST ---

Fixed in master

commit 61dc694215ad0058fd1e94e39af69337899c19bb
Author: Thomas Segismont <tsegismo>
Date:   Fri Sep 26 16:20:44 2014 +0200
    
    Do not send resource error until the resource is synced with server

Comment 1 Thomas Segismont 2014-09-26 14:24:17 UTC
Fixed in master (see Comment 0)

Comment 2 Libor Zoubek 2014-09-26 15:37:17 UTC
branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/f4d09f5c2
time:    2014-09-26 16:51:13 +0200
commit:  f4d09f5c229d6d69ad556e4ae7fcba03a24ee513
author:  Thomas Segismont - tsegismo
message: Bug 1077744 - statement timeout during drift purge job
         Changed the query WHERE clause: don't use NOT IN because NOT
         IN(NULL) will always return false. See
         http://stackoverflow.com/questions/17150208/sql-query-with-not-in-returning-no-rows

         In other words, if any row in RHQ_DRIFT as a NULL value in
         OLD_DRIFT_FILE or NEW_DRIFT_FILE columns, we'll never purge
         anything.

         Besides, the NOT EXISTS variant has a better execution plan.

         Use PurgeTemplate to delete rows in batches and select the keys
         of the rows to delete without locking the drift files table.

         Also, some code cleanup.

         (cherry picked from commit
         3251090d63f58f0da3d604f30cc8f819533e0fcc) Signed-off-by: Libor
         Zoubek <lzoubek>

Comment 3 Libor Zoubek 2014-09-26 15:42:43 UTC
please ignore my previous comment, different BZ, this one is right

branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/4b8f55066
time:    2014-09-26 17:36:50 +0200
commit:  4b8f550661e5b66b84fb731936af560cc934686f
author:  Thomas Segismont - tsegismo
message: Bug 1147001 - Server log exception when saving a resource error
         Do not send resource error until the resource is synced with
         server
         (cherry picked from commit
         61dc694215ad0058fd1e94e39af69337899c19bb) Signed-off-by: Libor
         Zoubek <lzoubek>

Comment 4 Simeon Pinder 2014-10-01 21:33:22 UTC
Moving to ON_QA as available for test with build:
https://brewweb.devel.redhat.com/buildinfo?buildID=388959

Comment 6 Sunil Kondkar 2014-10-16 12:42:22 UTC
Verified on JON 3.3 ER04 

Followed the steps and verified that the agent and server log does not display any errors.


Note You need to log in before you can comment on or make changes to this bug.