Subject Fixing corrupt data (plain text)
Author Scott Buckham
Sorry - accidentally sent in Html last time (I think that is problematic)...

We have a client that was hit by power surges within the last month. We
backed up and restored to a new hard drive after a few attempts without any
extra switches (to my knowledge). The client continued to run for a few days
until it seemed to be having problems reading our license files from the
database (includes blobs). Deleting and reinstalling the licenses seem to
give the application life again for a few days only before the same problem
occurred.

The following exception seems to occur periodically or when I attempt to do
a backup on the running database:

at org.firebirdsql.gds.GDSException: I/O error during "CreateFile (open)"
operation for file "server"
Error while trying to open file
null
at
org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1698)
at
org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1651)
at
org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:290)
at
org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:252)
at
org.firebirdsql.jca.FBManagedConnectionFactory.createDbHandle(FBManagedConne
ctionFactory.java:543)
at
org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:109)
at
org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBMan
agedConnectionFactory.java:374)
at
org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStand
AloneConnectionManager.java:61)
at
org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:104)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:275)
at java.sql.DriverManager.getConnection(Unknown Source)

Eventually this problem was occurring so frequently that trading could not
continue. We attempted to install another new hardware to eliminate this as
a cause but the problem remains.

gfix -v -full gives me 1 record level error, which gfix -mend -full cannot
fix.

Doing a gbak -b -v -ignore -t -limbo would not restore 1st go but would on
subsequent attempts - this surprised me. I have reproduced this on several
occasions.
If I added the -i switch I did not seem to have any problems.

The exception I get from the
.
gbak: cannot commit index RDB$PRIMARY53
gbak: ERROR: internal gds software consistency check (wrong record length
(183))

gbak: ERROR: internal gds software consistency check (can't continue after
bugcheck)
gbak: Exiting before completion due to errors
gbak: ERROR: internal gds software consistency check (can't continue after
bugcheck)
gbak: ERROR: internal gds software consistency check (can't continue after
bugcheck)

At this stage we are creating the database structure from scratch and then
pumping the data back into the Main Server from a few files that were run
over 3 days of issues. Is this a satisfactory plan of attack? Can I be
confident that the database structure is all that is corrupt and that I can
insert the data into it without corrupting the file again?


Firebird version: 1.5.2
Operating System: Windows XP Professional Jaybird driver: 1.0.1

Best regards,

Scott Buckham
Software Engineer
AFJ Software Pty Ltd