Project

General

Profile

Bug #67

Errors When Scan Results are Saved

Added by Luke Murphey about 14 years ago. Updated over 13 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Core Application
Target version:
-
Start date:
04/08/2010
Due date:
% Done:

0%


Description

A database error is thrown when some scan results are saved with fields containing excessive number of characters. Below is an example of the error:

[2008/19/07 19:40:43 CDT, Error] System: Database exception
{
    Task = Scanning rule 1 of 1 (Not Scanning)",
    StackTrace = "ERROR 22001: A truncation 
    error was encountered trying to shrink VARCHAR
    'Cross domain inline frame discovered to:
    http://www.islamicf&' to length 255.
            at
    org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) at         
    net.lukeMurphey.nsia.scanRules.HttpSignatureScanResult.saveToDatabase(HttpSignatureScanResult.java:858) at         
    net.lukeMurphey.nsia.scanRules.HttpSeekingScanResult.saveToDatabase(HttpSeekingScanResult.java:379) at 
    net.lukeMurphey.nsia.RuleScanWorker.run(RuleScanWorker.java:238) at java.lang.Thread.run(Unknown Source)
}

History

#1 Updated by Luke Murphey about 14 years ago

This is caused by varchar columns that do not have enough length. Long varchar have an unlimited length but cannot be used for comparisons. The only alternatives are:

  1. Set the length to the maximum allowable
  2. Truncate strings before saving

Note the maximum varchar lengths vary according to the database used:

#2 Updated by Luke Murphey about 14 years ago

The Varchar lengths were changed to be near the limit when the internal database is used. This is note the final solution since long fields lengths will still generate an error, but it dramatically reduces that chance that the issue occurs.

#3 Updated by Luke Murphey about 14 years ago

Need to determine if Text fields can be used instead of varchar fields. Note that the SQL creation scripts for MySQL now used Text by default but this has not been tested in the application yet.

#4 Updated by Luke Murphey over 13 years ago

  • Category set to Core Application

Also available in: Atom PDF