Subject Page is of wrong type (expected 5, found 0)
Author Martin Schwedhelm
Hi all,

I have multiple (8) databases where no connection is possible and gfix prints the above message.

Firebird version: 2.5.2
Operating system: Windows 2003 - Windows 2008 (VmWare)
Size: Varying, ~100MB to ~14GB single file
ODS: 11.1 / 11.2

It looks like the database file is truncated and when resized to the previous size
because all pages starting from a random page till the end of the file are filled with zeros.
In one case only the first 9MB of a 7GB database survived.

Before the corruption all systems involved were restarted (windows-update, etc.).
Could a unsave shut down of the database server explain the behaviour?

The odd thing is that in one case we replaced the database with a backup file.
The backup was checked with gfix / gbak and OK.
But after:
- Shut down server process
- Replace database
- Start server process

The database was again corrupted. This was reproducable one more time, but not later and not on another system.
That could mean hardware error (hard disk failure), but no events were recorded regarding that matter.
Also, even if the database in question has a page size of 16384 on a 4096 file system, the corruption starts
exactly at a page border which contradicts the hardware theory a little.

I don't know what else could be the source of the problem.

Any help will be appriciated.