Issue Details (XML | Word | Printable)

Key: CORE-2245
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Claudio Valderrama C.
Reporter: Jonas Jasas
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Error on restoring db with long exception from backup

Created: 17/Dec/08 05:16 AM   Updated: 23/Feb/11 09:43 AM
Component/s: GBAK
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.0.4, 2.1.1, 2.0.5, 2.1.2
Fix Version/s: 2.5 Beta 1, 2.1.3, 2.0.6

Time Tracking:
Not Specified

File Attachments: 1. File TMP.FDB (2.41 MB)
2. File tmp.gbk (2 kB)

Environment:
Windows XP SP2
FB 2.1.1

Planning Status: Unspecified


 Description  « Hide
Hello,

When I try to restore db from backup getting these errors. DB contains just one long exception. I will try to attach database.
Backup switches: -L -Z -V -T -NOD
Restore swithes: -Z -V -NOD

gbak:gbak version WI-V2.1.1.17910 Firebird 2.1
gbak:opened file tmp.gbk
gbak:transportable backup -- data in XDR format
gbak: backup file is compressed
gbak: Version(s) for database "c:\db\tmp1.gdb"
        Firebird/x86/Windows NT (access method), version "WI-V2.1.1.17910 Firebird 2.1"
        Firebird/x86/Windows NT (remote server), version "WI-V2.1.1.17910 Firebird 2.1/XNet (JON)/P11"
        Firebird/x86/Windows NT (remote interface), version "WI-V2.1.1.17910 Firebird 2.1/XNet (JON)/P11"
        on disk structure version 11.1
gbak:created database c:\db\tmp1.gdb, page_size 16384 bytes
gbak:started transaction
gbak:restoring exception NEW_EXCEPTION
gbak:do not recognize exception attribute 116 -- continuing
gbak:do not recognize exception attribute 110 -- continuing
gbak:do not recognize exception attribute 116 -- continuing
gbak:do not recognize exception attribute 110 -- continuing
gbak:do not recognize exception attribute 116 -- continuing
gbak:do not recognize exception attribute 110 -- continuing
gbak:do not recognize exception attribute 116 -- continuing
gbak: ERROR:do not recognize record type 0
gbak:Exiting before completion due to errors


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jonas Jasas added a comment - 17/Dec/08 05:17 AM
Database with one long exception

Jonas Jasas added a comment - 17/Dec/08 05:18 AM
Backup of database with one exception.

Claudio Valderrama C. added a comment - 29/Jan/09 07:00 AM
Please try this
gbak -rep tmp.gbk tmpnew.fdb -user sysdba -pass <your_pw> -skip 255
and confirm that your db is restored, but that the exception's text is truncated. If you have a real db with many metadata and data, try the same, but DO NOT OVERWRITE the original db. I want to confirm the trick works in a real life db.
As I said, undocumented switch allows to resync but your exception's text is truncated (the rest is lost). We are in the way to provide a workaround and a fix, depending on the version.

Jonas Jasas added a comment - 30/Jan/09 05:30 AM
This hack seams to be working. I compared restored and original db, only difference was that some of exceptions truncated. Looking forward for fix.
Thank You for your effort!

c:\DB>"c:\Program Files\Firebird\Firebird_2_1\bin\gbak" -rep fbbug.gbk fbbug.fdb -user sysdba -pass masterkey -skip 255
gbak:skipped 255 bytes after reading a bad attribute 114
gbak:skipped 255 bytes after reading a bad attribute 105
gbak:skipped 255 bytes after reading a bad attribute 111
gbak:skipped 255 bytes after reading a bad attribute 108
gbak:skipped 255 bytes after reading a bad attribute 108
gbak:skipped 255 bytes after reading a bad attribute 111
gbak:skipped 255 bytes after reading a bad attribute 110
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 80
gbak:skipped 255 bytes after reading a bad attribute 62
gbak:skipped 255 bytes after reading a bad attribute 114
gbak:skipped 255 bytes after reading a bad attribute 105
gbak:skipped 255 bytes after reading a bad attribute 240
gbak:skipped 255 bytes after reading a bad attribute 111
gbak:skipped 255 bytes after reading a bad attribute 78
gbak:skipped 255 bytes after reading a bad attribute 107
gbak:skipped 255 bytes after reading a bad attribute 97
gbak:skipped 255 bytes after reading a bad attribute 117
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 97
gbak:skipped 255 bytes after reading a bad attribute 97
gbak:skipped 255 bytes after reading a bad attribute 109
gbak:skipped 255 bytes after reading a bad attribute 121
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 116
gbak:skipped 255 bytes after reading a bad attribute 68
gbak:skipped 255 bytes after reading a bad attribute 117
gbak:skipped 255 bytes after reading a bad attribute 109
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 115
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 105
gbak:skipped 255 bytes after reading a bad attribute 112
gbak:skipped 255 bytes after reading a bad attribute 240
gbak:skipped 255 bytes after reading a bad attribute 116
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 98
gbak:skipped 255 bytes after reading a bad attribute 111
gbak:skipped 255 bytes after reading a bad attribute 240
gbak:skipped 255 bytes after reading a bad attribute 116
gbak:skipped 255 bytes after reading a bad attribute 109
gbak:skipped 255 bytes after reading a bad attribute 121
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 97
gbak:skipped 255 bytes after reading a bad attribute 77
gbak:skipped 255 bytes after reading a bad attribute 114
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 100
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 105
gbak:skipped 255 bytes after reading a bad attribute 116
gbak:skipped 255 bytes after reading a bad attribute 32
gbak:skipped 255 bytes after reading a bad attribute 78
gbak:skipped 255 bytes after reading a bad attribute 97
gbak:skipped 255 bytes after reading a bad attribute 109
gbak:skipped 255 bytes after reading a bad attribute 121
gbak:skipped 255 bytes after reading a bad attribute 77
gbak:skipped 255 bytes after reading a bad attribute 105
gbak:skipped 255 bytes after reading a bad attribute 111
gbak:skipped 255 bytes after reading a bad attribute 32

Claudio Valderrama C. added a comment - 12/Feb/09 09:12 AM
The resolution is far from ideal:
- For FB2.0 and FB2.1, we can't change the backup format number because it uses integral values (no minor version available). We can't increment the FB2.0 backup number because it would clash with FB2.1's backup number. We could increment the FB2.1 backup number because FB2.5 isn't released yet and we can adjust the value for v2.5, but any of those changes will make people with FB2.0/2.1 with two incompatible versions of gbak and the older one will refuse to read backups created by the previous release of the same major version (for instance, the current v2.0 gbak won't read a changed v2.0gbak's backup).
- Therefore, instead of raising the backup format (needed when new tokens are introduced in a backup, among other causes), a routine to recover long exceptions was implemented in v2.0 and v2.1. It may fail in some tricky cases, but generally it has a good likelihood to succeed. Hence, the backups remain unchanged but the restore phase tries to locate the full exception message.
- For FB2.5, a new token (or tag) was introduced to deal specially with long exceptions messages. Therefore, here no hack is needed, but the recovery logic was implemented anyway because gbak v2.5 will need to read backups created by v2.0 and v2.1.
- I'm sorry we can't offer the best solution for past versions, but fiddling with the backup version in FB versions already released would do more harm than benefit.
- Thanks to Alex to review and fix my backporting to v20 and v2.1 that I couldn't check myself due to lack of needed compiler.