Bitbucket Server throws the error: "-1 rows were updated instead of the expected 1 row" when migrating to MS SQL Server
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When migrating to Microsoft SQL Server, the following appears in the atlassian-bitbucket.log
"POST /admin/db/edit HTTP/1.1" liquibase Could not release lock
liquibase.exception.LockException: liquibase.exception.LockException: Did not update change log lock correctly.
-1 rows were updated instead of the expected 1 row using executor liquibase.executor.jvm.JdbcExecutor there are 1 rows in the table
...
Caused by: liquibase.exception.LockException: Did not update change log lock correctly.
-1 rows were updated instead of the expected 1 row using executor liquibase.executor.jvm.JdbcExecutor there are 1 rows in the table
Cause
NOCOUNT
is set ON
Resolution
Ensure that the SET NOCOUNT option is turned off. You can do that in SQL Server Management Studio as follows:- Navigate to Tools > Options > Query Execution > SQL Server > Advanced. Ensure that the SET NOCOUNT option is cleared.
- Now, go to the Server > Properties > Connections > Default Connections properties box and clear the no count option.
For reference:
Last modified on Nov 2, 2018
Powered by Confluence and Scroll Viewport.