Column "updatecount" of relation "lock" already exists at Npgsql.Internal.NpgsqlConnector in postgres when use IIS server

Hi all,

I’m encountering an issue when using the .NET Framework with IIS Server. Could everyone please help me? Thanks!

package i use.
package id=“Hangfire.Core” version=“1.8.0”
package id=“Hangfire.PostgreSql” version=“1.20.0”

log bug

tart installing Hangfire SQL objects… ERROR 2026-03-27 08:25:03,050 468ms PostgreSqlStorage ateAndExecuteVoid3 - Error while executing install/upgrade Npgsql.PostgresException (0x80004005): 42701: column “updatecount” of relation “lock” already exists at Npgsql.Internal.NpgsqlConnector.<g__ReadMessageLong|213_0>d.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Npgsql.NpgsqlDataReader.d__47.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.d__113.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Npgsql.NpgsqlCommand.d__113.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Npgsql.NpgsqlCommand.d__101.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at

I think it issue when IIS restart or start again

This post https://stackoverflow.com/questions/55237608/why-is-the-hangfire-startup-process-failing-with-this-error suggests that the specific error you are seeing may be caused by having existing tables (possibly with an older schema) in your Hangfire database, and that you can resolve the error by deleting the existing tables (that is, if you don’t already have data in those tables) and starting your IIS application again (which will create new versions of the tables).

Also, is it possible for you to upgrade to the latest (or newer) versions of the packages you are using? Newer versions of the packages may resolve the errors that you are encountering.

Hangfire.PostgreSql 1.20.0 is from Jul-2023, and the latest release is v1.21.1; there was an issue related to “schema version update in PostgreSqlObjectsInstaller on script failure” that was fixed in v1.20.5.

Hangfire 1.8.0 was released in Apr-2023, and the latest release is v1.8.23.