| Summary: | No error message when importing the wrong log file type | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Hendra Suwanda <suwanda> | ||||||||
| Component: | TPTP.monitoring | Assignee: | Cindy Jin <jx_china> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P1 | CC: | jacalcat, nmehrega, smith | ||||||||
| Version: | unspecified | Keywords: | plan | ||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 177650 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Hendra Suwanda
This problem has been reported in the past but GLA has no support for validating that a log file to be imported is of the correct type. However, if no records are parsed we can change GLA to issue a warning message that the log file may be empty or of the wrong type. We'll try to do this in iteration 3 but it has low priority. Deferred to 4.3 as it is not a stop ship issue for 4.2 and not a regression. *** Bug 159528 has been marked as a duplicate of this bug. *** Just my 2 cents... I don't think this should be treated as a low priority item. If we're running into this problem, I'm sure other users are experiencing it as well. It's almost impossible for a first time user to figure what they've done wrong when they come across this problem. Cannot be contained in 4.3 - deferring to 4.4. Increasing priority so it is addressed early in 4.4. Added sizing. Assigning to Cindy and targetting i2 Created attachment 60669 [details]
patch file
propsed fix. At BasicContext stop method,check if the sesonr component's itemProcessed counter is bigger than 0, but the outputter component's itemProcessed counter is 0. An error message is logged, " IWAT0812I Zero log record is parsed, it maybe a wrong type of log."
Dave, Please review the propsed fix. Thanks I have committed the new message to CVS but I changed the wording slightly to the following to be more descriptive to the GLA user: INVALID_LOG_TYPE_INFO_ = IWAT0812I No log records were parsed. Ensure the log you are parsing is of the expected type. I did not commit the rest of the patch because it doesn't cover all of the cases. It doesn't cover the static parser case where the sensor returns no CommonBaseEvent objects. It also doesn't take into consideration the case of filtering where no records match the filter. We don't want to return this error message if the filter blade is present. I think the fix should check the if the Parser component returns any objects instead of the Outputter in the case of a rules-based adapter. Thinking about this problem further from a Log Import user perspective the message shown to the user should refer to importing a log and not parsing a log but GLA does not know it is being called during a log import operation. Therefore, I think the Log Import service needs to catch this new GLA message and issue its own log import specific message instead. A separate defect will be opened against the log import service for that change. Deferring to iteration 3. There is a Log View defect open for this same problem. It can be used to add an appropriate message in the Log Import UI when the GLA returns IWAT0812I. The static parser case will be handled by the static parser classes themselves. The static parser classes will check whether any records were parsed from the log file. The Apache access and error log static parsers already do this. I checked in a fix to org.eclipse.hyades.logging.parsers.JavaLoggingXMLLogParser to add this check and throw an exception with the existing message HyadesGABufferedPeriodicReader_No_Records_Read_ERROR_. The fix for rules parsers will have to ensure it only applies to rules adapters. It should also not apply to the case where sensor or extractor filtering is used and as mentioned earlier should handle the case where a filter blade is used. Created attachment 65274 [details]
patch file
Created attachment 65276 [details]
patch file for JavaLoggingXMLLogParser
Committed fix to TPTP head CVS. Made some small changes to org.eclipse.hyades.logging.adapter patch that is attached. The following files were changed: BasicContext.java - in addition to the patch, also added a check for extractor filtering CBEFormatter.java - changed the items processed counter to only count valid CBE's that are cresated Adapter.java - updated some of the javadoc LocalLogImportCBEFormatter.java - changed counter printed in trace statement. Two comments from usability point of view: 1. The error message is intended for the programmer (not for the end-user). It says something about "parsing error" (not very useful to the end-user). I have to go through "Details >>" to notice that indeed the log file type may be incorrect. Please make sure that the error message is intended for the end-user, not the implementor. 2. Although there was an error in the import process and no record was imported, the log entry is created in the navigator view. I suggest that either a "red x" error icon be displayed as a decorator for that entry, or do not create the entry in the first place (since 0 record was imported). Reopening this bugzilla. Closing this because it is being used for the GLA changes which have been made. The UI changes will be tracked with defect 177650 Closing |