Bug 1131494 - CLI command to remove storage node gives transaction error
Summary: CLI command to remove storage node gives transaction error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI
Version: JON 3.2.2
Hardware: All
OS: All
unspecified
high
Target Milestone: ER03
: JON 3.3.0
Assignee: Jay Shaughnessy
QA Contact: Armine Hovsepyan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-19 12:20 UTC by dsteigne
Modified: 2018-12-06 17:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The rhq-cli command was supposed to remove a storage node with an operation mode of INSTALLED but failed with a transaction error. The storage node was not removed. Transaction management has been rectified to accommodate storage node changes. The rhq-cli command executes without error and removes the INSTALLED storage node.
Clone Of:
Environment:
Last Closed: 2014-12-11 13:59:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full Stack trace from server.log (85.50 KB, text/plain)
2014-08-19 12:20 UTC, dsteigne
no flags Details
Full stack trace from server.log - JON 330 ER02 (79.59 KB, text/plain)
2014-09-10 13:26 UTC, Jan Bednarik
no flags Details

Description dsteigne 2014-08-19 12:20:00 UTC
Created attachment 928340 [details]
Full Stack trace from server.log

Description of problem:
The rhq-cli command to remove a storage node with operation mode of INSTALLED fails with a transaction error:

[jbossadm@kdmjon11 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -s kdmjon11 -t 7080 -c 'var snCrit = new StorageNodeCriteria(); snCrit.addFilterOperationMode(StorageNode$OperationMode.INSTALLED); var storageNodes = StorageNodeManager.findStorageNodesByCriteria(snCrit); for (var i = 0; i < storageNodes.size(); i++ ) { var storageNode = storageNodes.get(i); if (storageNode.getResource() == null) StorageNodeManager.undeployStorageNode(storageNode); }'
Remote server version is: 3.2.0.GA (dfe3e4b:cf4474c)
Login successful
javax.ejb.EJBException: [Warning] javax.persistence.TransactionRequiredException: JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)
var snCrit = new StorageNodeCriteria(); snCrit.addFilterOperationMode(StorageNode$OperationMode.INSTALLED); var storageNodes = StorageNodeManager.findStorageNodesByCriteria(snCrit); for (var i = 0; i < storageNodes.size(); i++ ) { var storageNode = storageNodes.get(i); if (storageNode.getResource() == null) StorageNodeManager.undeployStorageNode(storageNode); }

Version-Release number of selected component (if applicable):
3.2.2

How reproducible:
Everytime

Steps to Reproduce:
1. For the test add a storage node into the Database with an Operation Node of INSTALLED.  
Insert into rhq_storage_node(id, address, cql_port, operation_mode, ctime, mtime, maintenance_pending)values(9999,'test.com',9142,'INSTALLED',1389037180718,1389037180718,'FALSE')

2. Run the rhq-cli command to see that the node is there:
./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost -t 7080 -c 'var snCrit = new StorageNodeCriteria(); snCrit.addFilterOperationMode(StorageNode$OperationMode.INSTALLED); var storageNodes = StorageNodeManager.findStorageNodesByCriteria(snCrit); for (var i = 0; i < storageNodes.size(); i++ ) { var storageNode = storageNodes.get(i); if (storageNode.getResource() == null) storageNode; }'

3. Now run the rhq-cli command to remove it:
./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost -t 7080 -c 'var snCrit = new StorageNodeCriteria(); snCrit.addFilterOperationMode(StorageNode$OperationMode.INSTALLED); var storageNodes = StorageNodeManager.findStorageNodesByCriteria(snCrit); for (var i = 0; i < storageNodes.size(); i++ ) { var storageNode = storageNodes.get(i); if (storageNode.getResource() == null) StorageNodeManager.undeployStorageNode(storageNode); }'


Actual results:
Error:
./rhq-cli.sh -u rhqadmin -p rhqadmin -s localhost -t 7080 -c 'var snCrit = new StorageNodeCriteria(); snCrit.addFilterOperationMode(StorageNode$OperationMode.INSTALLED); var storageNodes = StorageNodeManager.findStorageNodesByCriteria(snCrit); for (var i = 0; i < storageNodes.size(); i++ ) { var storageNode = storageNodes.get(i); if (storageNode.getResource() == null) StorageNodeManager.undeployStorageNode(storageNode); }'


Expected results:
Command completes successfully and removes the INSTALLED storage node.


Additional info:
Full stack trace from server.log attached TransactionStackTrace.txt

Comment 2 Jay Shaughnessy 2014-08-29 18:19:09 UTC
Setting MODIFIED so it will get flipped to ON_QA for ER02 build.  Prior Tx mgmt changes for storage should have handled this (otherwise I apologize in advance).

Comment 3 Simeon Pinder 2014-09-03 20:31:44 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=381194

Comment 4 Jan Bednarik 2014-09-10 13:24:56 UTC
Moving to ASSIGNED.

I followed the steps from Description and the issue is still visible with the same exception being logged in server.log (see attached file).

Version:3.3.0.ER02
Build Number:4fbb183:7da54e2

Comment 5 Jan Bednarik 2014-09-10 13:26:00 UTC
Created attachment 936141 [details]
Full stack trace from server.log - JON 330 ER02

Comment 6 Jay Shaughnessy 2014-09-11 20:59:55 UTC
master commit dcd5159681c770e62619ec3490d87fe72dc38dd0
Author: Jay Shaughnessy <jshaughn>
Date:   Thu Sep 11 16:54:01 2014 -0400

    Needed to establish a new transactional context.



release/jon3.3.x commit e0394d093495201e67ca9a8b8c452ebb14115b01
Author: Jay Shaughnessy <jshaughn>
Date:   Thu Sep 11 16:54:01 2014 -0400

    (cherry picked from commit dcd5159681c770e62619ec3490d87fe72dc38dd0)
    Signed-off-by: Jay Shaughnessy <jshaughn>

Comment 8 Simeon Pinder 2014-09-17 02:49:39 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=385149

Comment 9 Jan Bednarik 2014-09-18 13:32:58 UTC
Moving to VERIFIED.

Version:3.3.0.ER03
Build Number:4aefe39:44e33a4


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