Search code examples
firebirdfirebird2.5

Firebird 2.5 Error, I/O error during "ReadFile" operation for file


I hope you will be able to help me find a way to fix the issue I am getting with a Firebird database.

The error using flamerobin is:

enter image description here

I have tried to gfix with the database but it will not validate with the same errors coming up in powershell.

PS C:\Program Files\Firebird\Firebird_2_5\bin> .\gfix.exe -v C:\databases2\Issue\RFS.FDB -user sysdba -password masterkey
I/O error during "ReadFile" operation for file "C:\DATABASES2\ISSUE\RFS.FDB"
-Error while trying to read from file
-Reached the end of the file.
PS C:\Program Files\Firebird\Firebird_2_5\bin> .\gfix.exe -v -f C:\databases2\Issue\RFS.FDB -user sysdba -password masterkey
I/O error during "ReadFile" operation for file "C:\DATABASES2\ISSUE\RFS.FDB"
-Error while trying to read from file
-Reached the end of the file.
PS C:\Program Files\Firebird\Firebird_2_5\bin> .\gfix.exe -v -f -i C:\databases2\Issue\RFS.FDB -user sysdba -password masterkey
I/O error during "ReadFile" operation for file "C:\DATABASES2\ISSUE\RFS.FDB"
-Error while trying to read from file
-Reached the end of the file.
PS C:\Program Files\Firebird\Firebird_2_5\bin>

It is the same error on any other command -mend or gbak


Solution

  • The error probably means that your database is corrupted beyond recovery (or at least, not without specialist help). In essence it means that your database file is smaller than Firebird thinks it should be, and Firebird tries to read beyond the length of the file. This could indicate that the file was truncated (and any data that was beyond the truncation point is now lost), that the internal metadata of the database is corrupted, or something went wrong when Firebird tried to increase the size of the database file.

    It might be possible that this can be salvaged by rewriting some of the internal metadata. But as far as I know, this is beyond the functionality of gfix. I think you will need help from a company that offers recovery services, for example from IB-Aid's IB-Surgeon, see https://ib-aid.com/. I suggest that you post your question on the firebird-support mailing list to see if there are alternative solutions.