Issue Details (XML | Word | Printable)

Key: GLASSFISH-13894
Type: Bug Bug
Status: Reopened Reopened
Priority: Minor Minor
Assignee: Joe Di Pol
Reporter: lidiam
Votes: 0
Watchers: 3

If you were logged in you would be able to see more operations.

update-node-* lets you set a nodedir on in-use node if original node does not have one

Created: 08/Oct/10 04:23 PM   Updated: 15/Apr/14 11:31 PM
Component/s: admin
Affects Version/s: 3.1
Fix Version/s: future release

Time Tracking:
Not Specified

File Attachments: 1. JPEG File node-chnodedir.JPG (90 kB) 08/Oct/10 04:24 PM - lidiam
2. JPEG File nodedir-change.JPG (82 kB) 25/Feb/11 12:51 PM - lidiam
3. JPEG File nodedir-startup-error.JPG (94 kB) 25/Feb/11 12:51 PM - lidiam
4. Text File server.log (6 kB) 25/Feb/11 12:51 PM - lidiam
5. Text File server.log (11 kB) 08/Oct/10 04:25 PM - lidiam


Operating System: All
Platform: All

Issuezilla Id: 13,894
Tags: 3_1_1-scrubbed
Participants: Anissa Lam, Joe Di Pol and lidiam

 Description  « Hide


Create a node on localhost specifying a node directory, e.g. mynodes and the
same install directory as localhost node. Create standalone instance using new
node. At this point directory structure is created in filesystem for node and
instance. Go to Edit Node screen, for the newly created node and modify node
directory by deleting the entry. Attempt to start instance and the following
error is printed on screen:

An error has occurred
Could not start instance sanlan1 on node lancer (localhost). Command failed on
node lancer (localhost): CLASSPATH=
Commands: [start-local-instance, --node, lancer, --nodedir, , sanlan1] asadmin
extension directory: /export/home/j2eetest/v3.1/glassfish3/glassfish/lib/asadmin
Prepare Process program options Parsing program options Parse command options
params: {node: [lancer] nodedir: [] } operands: [sanlan1] Prevalidate...

Either user should be able to change node directory without further errors or
this choice should be disabled.

lidiam added a comment - 08/Oct/10 04:24 PM

Created an attachment (id=5107)

lidiam added a comment - 08/Oct/10 04:25 PM

Created an attachment (id=5108)

Anissa Lam added a comment - 08/Oct/10 05:49 PM

I think backend needs to fix this, ie to be able to handle changing of the
node-dir after the node is created.
User maybe using CLI set to modify that as well.

If this is going to cause problem, it should disallow it so user cannot use CLI
to change it, and notify GUI to make that field read-only after creation.
If user should be able to change node directory after creation, then the current
behavior is wrong.

Joe Di Pol added a comment - 11/Oct/10 09:24 AM

A couple of options:

1) Don't allow changing the nodedir once a node has been created. Or

2) Don't allow changing the nodedir if there are any instances using the node.

I'm leaning towards #2. update-node-* can check if any instances are using
the node and report an error if nodedir is being changed.

Joe Di Pol added a comment - 03/Nov/10 02:46 PM

The code has been changed so that if you try to change installdir or nodedir and
the node is referenced by one or more server instances then the update command
will fail with an error.

Author: jfdipol
Date: 2010-11-03 21:44:43+0000
New Revision: 42431





kenaiadmin made changes - 26/Nov/10 12:16 AM
Field Original Value New Value
issue.field.bugzillaimportkey 13894 45498
lidiam added a comment - 25/Feb/11 12:51 PM

I can still change node directory on an SSH node that has an instance underneath. Here are the steps to reproduce:

1. In Admin Console create an SSH node on localhost, filling in only node name and host.
2. Create a standalone instance under the new node with default settings.
3. Start the instance.
4. Stop the instance.
5. Go to Nodes page and type a bogus name for Node Directory field - the change is accepted. I tried it three times to make sure...
6. If you attempt to start the instance you will get the following error:

An error has occurred
Could not start instance in2 on node ln (localhost). Command failed on node ln (localhost): Command start-local-instance failed. Node directory /export/home/j2eetest/v3.1/glassfish3/glassfish/bogusDir does not exist or is not a directory To complete this operation run the following command locally on host localhost from the GlassFish install location /export/home/j2eetest/v3.1/glassfish3: asadmin start-local-instance --node ln --nodedir /export/home/j2eetest/v3.1/glassfish3/glassfish/bogusDir --sync normal in2

7. Go back to the node page and wipe out bogus node dir name - this time the change is not accepted with the expected error message of:

An error has occurred
Cannot update node ln. It is in use by a server instance and therefore attribute nodedir cannot be changed.

I'm not sure why this message does not show up the first time around...

lidiam made changes - 25/Feb/11 12:51 PM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
lidiam added a comment - 25/Feb/11 12:51 PM

Attaching screenshots and server.log.

lidiam made changes - 25/Feb/11 12:51 PM
Attachment nodedir-change.JPG [ 45099 ]
Attachment nodedir-startup-error.JPG [ 45100 ]
Attachment server.log [ 45101 ]
Joe Di Pol made changes - 22/Mar/11 11:05 AM
Fix Version/s 3.2 [ 10969 ]
Fix Version/s 3.1_ms07 [ 11016 ]
Joe Di Pol added a comment - 12/May/11 02:32 PM

The current code lets you update a node with new values if the attributes you are updating do not already have values, even if the node is in use by an instance. Here is the relevant comment from UpdateNodeCommand:

// If the current (config) value is null or "" then let it be changed.
// We need to do this for the offline config case where the user has
// created a config node with no values, created instances using those
// nodes, then updates the values later. This has the undersireable
// effect of letting you, for example, set a nodedir on a node
// that was created without one.
if (!StringUtils.ok(currentvalue)) { return true; }

In order to truly fix this we need to be able to tell the difference between the offline config use case (where instances exists in the config, but do not physically exist on a server yet) versus the case where the physical instances do exist.

In the former case update-node-* should allow all attributes to be changed.

In the later case update-node-* should be strict about what attributes can be changed.

This is related to bug GLASSFISH-15414.

To fix this we may need to add a "rendezvous" attribute to the server instance domain.xml element to indicate that the physical instance has been created.

Joe Di Pol made changes - 12/May/11 02:32 PM
Summary Node: cannot start instance after changing node directory update-node-* lets you set a nodedir on in-use node if original node does not have one
Joe Di Pol added a comment - 06/Jul/11 04:40 PM

Lowering priority since this is a lack of an error check and not a significant loss of functionality.

Joe Di Pol made changes - 06/Jul/11 04:40 PM
Priority Major [ 3 ] Minor [ 4 ]
Tags 3_1_1-scrubbed
Jill Sato made changes - 02/Dec/11 07:25 PM
Fix Version/s 4.0 [ 10970 ]
Fix Version/s 3.2 [ 10969 ]
Joe Di Pol made changes - 20/Mar/13 06:21 PM
Fix Version/s 4.0.1 [ 16061 ]
Fix Version/s 4.0 [ 10970 ]
Joe Di Pol made changes - 15/Apr/14 11:31 PM
Fix Version/s future release [ 11148 ]
Fix Version/s 4.0.1 [ 16061 ]