Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1131494 - CLI command to remove storage node gives transaction error
CLI command to remove storage node gives transaction error
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: CLI (Show other bugs)
JON 3.2.2
All All
unspecified Severity high
: ER03
: JON 3.3.0
Assigned To: Jay Shaughnessy
Armine Hovsepyan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-19 08:20 EDT by dsteigne
Modified: 2015-09-02 20:03 EDT (History)
6 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-11 08:59:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description dsteigne 2014-08-19 08:20:00 EDT
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 14:19:09 EDT
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 16:31:44 EDT
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 09:24:56 EDT
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 09:26:00 EDT
Created attachment 936141 [details]
Full stack trace from server.log - JON 330 ER02
Comment 6 Jay Shaughnessy 2014-09-11 16:59:55 EDT
master commit dcd5159681c770e62619ec3490d87fe72dc38dd0
Author: Jay Shaughnessy <jshaughn@redhat.com>
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@redhat.com>
Date:   Thu Sep 11 16:54:01 2014 -0400

    (cherry picked from commit dcd5159681c770e62619ec3490d87fe72dc38dd0)
    Signed-off-by: Jay Shaughnessy <jshaughn@redhat.com>
Comment 8 Simeon Pinder 2014-09-16 22:49:39 EDT
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 09:32:58 EDT
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.