Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on restoring db with long exception from backup [CORE2245] #2672

Closed
firebird-issue-importer opened this issue Dec 17, 2008 · 14 comments
Closed

Comments

@firebird-issue-importer

Submitted by: Jonas Jasas (jon)

Assigned to: Claudio Valderrama C. (robocop)

Attachments:
TMP.FDB
tmp.gbk

Votes: 1

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

Commits: 4dad2d5 18d8ca9 297055a

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Commented by: Jonas Jasas (jon)

Database with one long exception

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Modified by: Jonas Jasas (jon)

Attachment: TMP.FDB [ 11250 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Commented by: Jonas Jasas (jon)

Backup of database with one exception.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Modified by: Jonas Jasas (jon)

Attachment: tmp.gbk [ 11251 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Modified by: Jonas Jasas (jon)

summary: Error on restoring db from backup => Error on restoring db with long exception from backup

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 17, 2008

Modified by: @dyemanov

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 29, 2009

Commented by: Claudio Valderrama C. (robocop)

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 30, 2009

Commented by: Jonas Jasas (jon)

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 12, 2009

Commented by: Claudio Valderrama C. (robocop)

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 12, 2009

Modified by: Claudio Valderrama C. (robocop)

assignee: Vlad Khorsun [ hvlad ] => Claudio Valderrama C. [ robocop ]

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10300 ]

Fix Version: 2.1.3 [ 10302 ]

Fix Version: 2.0.6 [ 10303 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 12, 2009

Modified by: Claudio Valderrama C. (robocop)

Version: 2.0.5 [ 10222 ]

Version: 2.0.4 [ 10211 ]

Version: 2.1.0 [ 10041 ]

Version: 2.0.3 [ 10200 ]

Version: 2.0.2 [ 10130 ]

Version: 2.0.1 [ 10090 ]

Version: 2.0.0 [ 10091 ]

Version: 2.1.2 [ 10270 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 12, 2009

Modified by: @dyemanov

Fix Version: 2.5 Beta 1 [ 10251 ]

Fix Version: 2.5 RC1 [ 10300 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment