Sun Java System Application Server Plugin is very useful if you want to manage GlassFish Application Server in the enterprise system. But when something goes wrong, how do you debug the plugin? In this entry I will tell you how to troubleshoot Application Server Plugin execution in N1SPS.
There are two types of execution in the plugin: preflight and deployment. The preflight simulates the plan execution. Although preflight always happens before
a deployment, you can run a plan that is only a preflight. The preflight captures failures like if the host is prepared and if required variables are set and if it's valid. The deployment executes the component's install, uninstall and control procedures.
Let's take a look at a preflight failure. The preflight failures are easy to spot (see figure below). From the message, it says that "appName cannot be null". appName is a variable name and is required.
Click on the "Error Log" tab. Error Log provides a list of hosts and steps that failed during the
preflight and deployment phases of the plan. For each host, you have the option
to view more information by clicking "Step Failed". In the figure below, the "Context" column tells you that it failed in "preflight".
The "Run Results" tab provides you details in stepwise execution.
From the "Run Results", you can easily spot that the failure is in Preflight. The failure started in "lock host". Click on the "lock host" link and "Step Status" is displayed.
Next, click on "View" in "Sub Steps Status". A popup window is displayed with the Sub Steps Execution Summary.
From the Sub Steps Execution Summary, you can view the exact component execution. The failure started in the control procedure called "validate". This control checks for the variable appName and if it's null, raise an error.
Now, let's take a look at a deployment failure. In this example, I'm trying to start a standalone instance and I get a plan execution failure with the message: "Error: unable to start instance."
The "Error Log" tab tells you that the failure came from Plan execution which is deployment. The "Step Failed" link doesn't give too much information about where the failure is propagated. So let's take a look at the "Run Results" tab to get a detailed step wise summary.
In the "Run Results" tab, you can see that the failure is in Deployment execution. The failure is in control procedure called "start".
In the "Step Name" column, click on the link of the "control server: 'start'":
To get more details, click on the link, "View" under Sub Steps Status column. A popup window is displayed with the detailed component execution.
Looking at this table can be overwhelming since you may not know the exact step where the failure started. Since Sun Java System Application Server Plugin uses the CLI tool, "asadmin" to execute the command, you want to look for the "native procedure sh". But there are few native procedures. The key is to look for the highest nested level where the native procedure failed. In this case, the highest nested level is "7" (the 11th steps). Click on the "Failed" link in the Status column. A popup window with two boxes: stderr and stdout is displayed:
The stdout box displays the exact output message from "asadmin" and stderr box displays the standard error message. From the stdout box, you can see that the standalone instance is not able to start because the Node Agent is not running.
Troubleshooting failures in Sun Java System Application Server Plugin is not difficult. You just have to know where to look for the failures. Once you get the hang of where to look for the failures, it's a straight forward process.
For additional resources, please refer to Application Server N1SPS Plugin - Blogs and Resources.