Database Upgrade Error
Last updated June 13, 2024
âHelp! We attempted to upgrade our PaperCut NG/MF server, but in the process we saw an error page in the browser that said âDatabase upgrade errorâ. What does this mean and how can we fix it?â
You may have stumbled across this error page while upgrading your PaperCut server. It means that during the upgrade process, the installer encountered an error when attempting to upgrade the database. This error page is intimidating, but contains useful clues to understand why the upgrade failed. This article mentions the errors and their corresponding resolutions that we know of.
A previous upgrade process from schema X did not complete successfully
Error snippet: util.ApplicationException: A previous database upgrade process from schema 39 did not complete successfully. The details of the previous upgrade are logged to âserver/logs/server.logâ.
This message tells us that the PaperCut server canât be upgraded because the previous upgrade failed for any number of reasons. This behavior was introduced in PaperCut NG/MF 16.1 to prevent damage to the database that could be caused by re-running upgrade scripts on a partly upgraded database.
Here are two ways to recover from this situationâŠ
- Restore the database from the most recent backup, following these steps to Downgrade PaperCut
- Check the most recent server.log file to attempt to uncover the root cause of the upgrade failure. If the problem (such as insufficient permissions) has been addressed, then follow the steps below reset the âdb-upgrade-in-progressâ flag and continue with the upgrade.
Steps:
On the PaperCut NG/MF Server, stop the Primary PaperCut Application server service.
Now, open an Administrator level command prompt or terminal window.
In the terminal window, navigate to the PaperCut db-tools.exe executable. On a 64-bit Windows server running PaperCut MF, the command for this is âCD C:\Program Files\PaperCut MF\server\bin\winâ.
Run the command
db-tools.exe set-config -y system.db-upgrade-in-progress N
.Start the PaperCut NG/MF Application Server Service.
Navigate to the web interface of the PaperCut server to observe the database upgrade and watch out for any new errors.
Cannot find the object âtbl_userâ because it does not exist or you do not have the permissions.
Error snippet: 2021â05â21 10:37:03,722 ERROR liquibase:62 - C:/Program PaperCut MF/server/lib/sql/changelogs/db.changelog-master.yaml: changelogs/db.changelog-pc-003-release-18.2.yaml::pc-003-add-user-sync-source-columns::papercut-core: Change Set changelogs/db.changelog-pc-003-release-18.2.yaml::pc-003-add-user-sync-source-columns::papercut-core failed. Error: Cannot find the object âtbl_userâ because it does not exist or you do not have permissions. [Failed SQL: ALTER TABLE [dbo].[tbl_user] ADD [primary_user_source_type] [varchar](30)] [WrapperSimpleAppMain]
In this example, the upgrade failed with the message âLiquibase operation failedâ followed by âCannot find the object âtbl_userâ because it does not exist or you do not have the permissions.â This has been seen to happen with Microsoft SQL databases when the service account does not have database owner (DBO) permissions.
Steps:
- On the PaperCut NG/MF server, confirm what user account is used to connect to the database by checking the connection details in the server.properties file. On a 64-bit PaperCut NG/MF server running on Windows this file can be found in C:\Program Files\PaperCut MF\server\server.properties.
- Open this file using a plain-text editor like Notepad or Textedit as an Administrator.
- Look for the line starting with âdatabase.username=â under the relevant database type to see the name of the user account.
- Confirm that this user account has db_owner permissions on the PaperCut database.
The transaction log for database âPapercutâ is full due to âACTIVE_TRANSACTIONâ.
Error snippet: Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelogs/db.changelog-pc-010-change-column-type-to-nvarchar-for-sql-server.yaml::pc-010-change-document_name-column-type::papercut-core: Reason: liquibase.exception.DatabaseException: The transaction log for database âPapercutâ is full due to âACTIVE_TRANSACTIONâ.
This error happens when the transaction log on the database is full. One solution weâve heard from customers is to edit the options on the database to allow âsimpleâ growth mode for the upgrade period.
Still have questions?
Let us know! We love chatting about whatâs going on under the hood. Feel free to leave a comment below or visit our Support Portal for further assistance.
Categories: Troubleshooting Articles , Databases , Upgrading or Downgrading
Keywords: TODO , TODO
Comments