Corrupt Database Problems

KB Home   |   Corrupt Database Problems

Main.RestoringACorruptDatabase History

Hide minor edits - Show changes to output

November 21, 2018, at 06:14 AM by Aaron Pouliot - Added category - Databases
Changed line 73 from:
''Categories:'' [[!Backups]]
to:
''Categories:'' [[!Backups]], [[!Databases]]
August 04, 2017, at 01:21 AM by Brad Stone - Added additional note re use of -f option if they get error when restoring database
Added lines 59-60:

'''Note:'''  If during the restore process you receive an error stating that the database still exists, then run the import-db command with the -f option. @@db-tools.exe import-db '''-f''' ďC:\Program Files\PaperCut NG\server\data\backups\export-2009Ė05Ė10T00Ė20Ė03.zipĒ@@
Changed lines 24-25 from:
to:
-->@@Container X not found.@@
February 17, 2015, at 08:01 PM by Alan Morris - database spelling error
Changed lines 25-26 from:
If you encounter any of the above errors, it indicates the internal database has been corrupted, and you should restore the datbase as described below.
to:
If you encounter any of the above errors, it indicates the internal database has been corrupted, and you should restore the database as described below.
Changed lines 67-68 from:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time database export procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low space is detected, again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
to:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time database export procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low space is detected, again administrators are notified preempting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
October 01, 2013, at 06:49 AM by Kelby - Database Exports
Changed lines 29-32 from:
A: You will need at least one good backup file from the backup directory @@[app-path]\server\data\backups\@@. To restore the database follow these instructions:

!!!Option 1 - restore via your own backup software
to:
A: You will need at least one good database export file from the backup directory @@[app-path]\server\data\backups\@@. To restore the database follow these instructions:

!!!Option 1 - Restore via your own backup software
Changed lines 39-40 from:
!!!Option 2 - restore using one of PaperCut's point-in-time backups
to:
!!!Option 2 - Restore using one of PaperCut's point-in-time exports
Changed lines 53-54 from:
->'''7.'''  Then restore your backup into the database by doing the following (changing the backup file name as appropriate)
to:
->'''7.'''  Then restore your export into the database by doing the following (changing the export file name as appropriate)
Changed lines 67-68 from:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low space is detected, again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
to:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time database export procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low space is detected, again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
Changed lines 29-30 from:
A: You will need at least one good backup file from the backup directory @@[app-dir]\server\data\backups\@@. To restore the database follow these instructions:
to:
A: You will need at least one good backup file from the backup directory @@[app-path]\server\data\backups\@@. To restore the database follow these instructions:
Changed lines 35-38 from:
#Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.

#Restore all files and folders located at: @@[app-dir]\server\data\internal@@
to:
#Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-path]\server\bin\[platform]@@ if running on Linux or Mac.

#Restore all files and folders located at: @@[app-path]\server\data\internal@@
Changed lines 43-46 from:
->'''2.'''  Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.

->'''3.'''  As a backup, take a copy of the @@[app-dir]\server\data\internal\@@ directory.
to:
->'''2.'''  Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-path]\server\bin\[platform]@@ if running on Linux or Mac.

->'''3.'''  As a backup, take a copy of the @@[app-path]\server\data\internal\@@ directory.
Changed lines 49-50 from:
->'''5.'''  Change to the @@[app-dir]\server\bin\[platform]\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
to:
->'''5.'''  Change to the @@[app-path]\server\bin\[platform]\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
Changed lines 31-32 from:
!!!Option 1 - restore via our own backup software
to:
!!!Option 1 - restore via your own backup software
December 05, 2011, at 05:29 AM by ian - Added elevated command prompt note to step 4.
Changed lines 47-48 from:
->'''4.'''  Open a command prompt (cmd.exe).
to:
->'''4.'''  Open a command prompt (cmd.exe). Please note that in some versions of Windows (notably Vista and 7) you will need to ensure this is an elevated command prompt with local administrator privileges. If you receive any errors or warnings relating to permissions or access denied, please close your command prompt and restart it as an elevated command prompt.
Changed lines 65-68 from:
A: Important data stored in PaperCut (configuration, print logs, user data, etc.) is stored in a relational database (RDMS).  All databases support by PaperCut including the default internal database ([[http://db.apache.org/derby/|Apache Derby]]) is ACID compliant.  One of the issues with databases is that data corruption is usually only detected when the data affected is actually fetched/read.

To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low spaces is detected again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
to:
A: Important data stored in PaperCut (configuration, print logs, user data, etc.) is stored in a relational database (RDMS).  All databases supported by PaperCut including the default internal database ([[http://db.apache.org/derby/|Apache Derby]]) are ACID compliant.  One of the issues with databases is that data corruption is usually only detected when the data affected is actually fetched/read.

To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low space is detected, again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
Added lines 59-62:
Q: My database was corrupt and I've restored from backup. How can I prevent this from occurring again?

A: First of all, it may be "just one of those things".  Stuff-happens with computers from time to time.  e.g. random disk/memory issues.  However any form of file corruption should trigger a few system administration tasks.  The problem may indicate a system degradation and it would be good to catch this early (e.g. progressive disk failure).  Take some time now to do some system checks such as a file system check and memory check.

March 30, 2011, at 01:11 AM by peter - Updated invalid checksum error message
Changed lines 23-24 from:
-->@@java.sql.[=SQLException=]: Invalid checksum@@
to:
-->@@Invalid checksum on Page Page(X,Container(0, Y))@@
March 30, 2011, at 12:17 AM by peter - Added new log message indicating a corrupt database
Added lines 23-24:
-->@@java.sql.[=SQLException=]: Invalid checksum@@
March 29, 2011, at 11:39 PM by peter - Fixed spello
Changed lines 61-62 from:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low spaces is detected again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very affective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
to:
To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low spaces is detected again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very effective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.
Added lines 57-62:
Q: What systems does PaperCut have in place to detect corruption?

A: Important data stored in PaperCut (configuration, print logs, user data, etc.) is stored in a relational database (RDMS).  All databases support by PaperCut including the default internal database ([[http://db.apache.org/derby/|Apache Derby]]) is ACID compliant.  One of the issues with databases is that data corruption is usually only detected when the data affected is actually fetched/read.

To ensure data integrity issues are detected early PaperCut uses a number of methods of proactive data monitoring.  The main mechanism is a scheduled overnight weekly "data walk".  PaperCutís point-in-time backup procedure reads all data in the RDMS and tests the referential integrity during this process.  Any issues are immediately flagged and if configured, the system will email the administrator.  PaperCut also actively monitors other system states relating to integrity such as operating system hard disk space.  If low spaces is detected again administrators are notified pre-empting the issue. This process has been in production use in PaperCut since 2006 and has proven very affective at early detection of data integrity issues.  We have over 30,000 sites running PaperCut and very few data loss events have been reported.  Any events that have occurred usually relate to hardware failure or human error outside the domain of software control.

February 01, 2011, at 09:59 AM by 203.214.38.202 -
Added lines 13-14:
-->@@Failed to start database 'derby', see the next exception for details.@@
Added lines 21-22:
-->@@Page Page(X,Container(0, Y)) is at version V, the log file contains change version W, either there are log records of this page missing, or this page did not get written out to disk properly.@@
Added lines 7-20:
Q: What are the symptoms of a corrupt PaperCut database?

A: There are a number of different symptoms of a database corruption.  The symptoms displayed on a particular site will depend on the type of corruption occurring.  Some examples include:
* Being unable to start the PaperCut Application Server.  Check the server logs (e.g. server.log) for detailed information.
* PaperCut is showing one of the following errors on screen or in the logs:

-->@@The conglomerate (X, Y) requested does not exist.@@

-->@@Recovery failed unexpected problem log record is Not first but transaction is not in transaction table : X@@

-->@@Container Container(X, Y) cannot be opened; it either has been dropped or does not exist.@@

If you encounter any of the above errors, it indicates the internal database has been corrupted, and you should restore the datbase as described below.

Changed lines 5-6 from:
A: A full disk or any sort of disk corruption such as those cause by power outages or unexpected system shutdown/failures can corrupt the PaperCut database.
to:
A: A full disk or any sort of disk corruption such as those caused by power outages or unexpected system shutdown/failures can corrupt the PaperCut database.
Changed line 43 from:
[- keywords: corrupt, database, restore -]
to:
[- keywords: corrupt, database, restore, derby error, database connection error -]
Added line 14:
Added line 16:
Changed lines 21-31 from:
* Logon to the PaperCut server.
* Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.
* As a backup, take a copy of the
@@[app-dir]\server\data\internal\@@ directory.
* Open a command prompt (cmd
.exe).
* Change to the @@[app-dir]\server\bin\[platform]\@@ directory.  e.g.   @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
* Run the following command to re
-initialize the database:

       
@@db-tools.exe init-db -f@@

*
Then restore your backup into the database by doing the following (changing the backup file name as appropriate)
to:
->'''1.''' Logon to the PaperCut server.

->'''2.'''  Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.

->'''3
.'''  As a backup, take a copy of the @@[app-dir]\server\data\internal\@@ directory.

->'''4
.'''  Open a command prompt (cmd.exe).

->'''5.'''  Change to the @@[app-dir]\server\bin\[platform]\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@

->'''6.'''  Run the following command to re-initialize the database: @@db-tools.exe init-db -f@@

->'''7.'''
Then restore your backup into the database by doing the following (changing the backup file name as appropriate)
Changed lines 37-38 from:
* Once completed, restart the application server service.
to:
->'''8.''' Once completed, restart the application server service.
Added lines 11-18:
!!!Option 1 - restore via our own backup software

If you have an off disk backup, simply:
#Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.
#Restore all files and folders located at: @@[app-dir]\server\data\internal@@

!!!Option 2 - restore using one of PaperCut's point-in-time backups

Changed line 12 from:
* Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services).
to:
* Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services), or run the stop-server script in @@[app-dir]\server\bin\[platform]@@ if running on Linux or Mac.
Changed line 15 from:
* Change to the @@[app-dir]\server\bin\win\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
to:
* Change to the @@[app-dir]\server\bin\[platform]\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
Changed lines 1-2 from:
(:title Restoring a Corrupt Database:)
to:
(:title Corrupt Database Problems:)

Q: Why can PaperCut's database become corrupted?

A: A full disk or any sort of disk corruption such as those cause by power outages or unexpected system shutdown/failures can corrupt the PaperCut database.

Changed lines 9-10 from:
A: To restore the database follow these instructions:
to:
A: You will need at least one good backup file from the backup directory @@[app-dir]\server\data\backups\@@. To restore the database follow these instructions:
Changed line 13 from:
* As a backup, take a copy of the @@"C:\Program Files\PaperCut NG\server\data\internal\*"@@ directory.
to:
* As a backup, take a copy of the @@[app-dir]\server\data\internal\@@ directory.
Changed line 15 from:
* Change to the @@"C:\Program Files\PaperCut NG\server\bin\win\"@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
to:
* Change to the @@[app-dir]\server\bin\win\@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
Added lines 1-26:
(:title Restoring a Corrupt Database:)

Q: How do I restore a PaperCut database if the database is corrupted?

A: To restore the database follow these instructions:

* Logon to the PaperCut server.
* Stop the PaperCut Application Server service (Control Panel->Admin Tools->Services).
* As a backup, take a copy of the @@"C:\Program Files\PaperCut NG\server\data\internal\*"@@ directory.
* Open a command prompt (cmd.exe).
* Change to the @@"C:\Program Files\PaperCut NG\server\bin\win\"@@ directory.  e.g.  @@cd "C:\Program Files\PaperCut NG\server\bin\win\"@@
* Run the following command to re-initialize the database:

        @@db-tools.exe init-db -f@@

* Then restore your backup into the database by doing the following (changing the backup file name as appropriate)

        @@db-tools.exe import-db "C:\Program Files\PaperCut NG\server\data\backups\export-2009-05-10T00-20-03.zip"@@

* Once completed, restart the application server service.

----
''Categories:'' [[!Backups]]
----

[- keywords: corrupt, database, restore -]

Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.

Article last modified on November 21, 2018, at 06:14 AM
Printable View   |   Article History   |   Edit Article