Bitbucket Server throws the error: "-1 rows were updated instead of the expected 1 row" when migrating to MS SQL Server

Still need help?

The Atlassian Community is here for you.

Ask the community

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:
  1. Navigate to Tools > Options > Query Execution > SQL Server > Advanced. Ensure that the SET NOCOUNT option is cleared.
  2. Now, go to the Server > Properties > Connections > Default Connections properties box and clear the no count option.

 

For reference:

Connecting Bitbucket Server to SQL Server

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.