Hi Sebastian,
Some issues with upgrading when using SQL Server, the functions are not dropped before being created, so when starting up it will fail. I have tried to turn migration off and that does not work either.
I have…
- Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.
I’m submitting a…
- Regression (a behavior that stopped working in a new release)
- Bug report
- Performance issue
- Documentation issue or request
Current behavior
When upgrading the helm chart and using a newer version of Squidex, the startup / migration scripts are trying to create the SQL functions again and are unable to do so because they already exist.
Expected behavior
Script should drop the functions before applying migrations so that the latest functions can be applied.
Minimal reproduction of the problem
install Squidex 7.21.0 then try to upgrade to 7.23.0
Environment
- Self hosted with docker
- Self hosted with IIS
- Self hosted with other version
- Cloud version
Version: [VERSION]
Browser:
- Chrome (desktop)
- Chrome (Android)
- Chrome (iOS)
- Firefox
- Safari (desktop)
- Safari (iOS)
- IE
- Edge
Others:
logs - this is a snippet to get Squidex to start i need to drop all functions… as the logs just move onto the next function if i just delete this one…
{
"logLevel": "Error",
"message": "Hosting failed to start",
"eventId": {
"id": 11,
"name": "HostedServiceStartupFaulted"
},
"timestamp": "2026-05-12T09:19:42Z",
"app": {
"name": "Squidex",
"version": "7.23.0.0",
"sessionId": "7235b751-700a-4f79-b7e4-9dc819b6d151"
},
"category": "Microsoft.Extensions.Hosting.Internal.Host",
"exception": {
"type": "Microsoft.Data.SqlClient.SqlException",
"message": "There is already an object named \u0027json_exists\u0027 in the database.",
"stackTrace": " at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action\u00601 wrapCloseInAction)\n at Microsoft.Data.SqlClient.Connection.SqlConnectionInternal.OnError(SqlException exception, Boolean breakConnection, Action\u00601 wrapCloseInAction)\n at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)\n at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean\u0026 dataReady)\n at Microsoft.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, Boolean isInternal, String endMethod)\n at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)\n at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)\n at Microsoft.Data.SqlClient.SqlCommand.\u003C\u003Ec.\u003CInternalExecuteNonQueryAsync\u003Eb__251_1(IAsyncResult asyncResult)\n at System.Threading.Tasks.TaskFactory\u00601.FromAsyncCoreLogic(IAsyncResult iar, Func\u00602 endFunction, Action\u00601 endAction, Task\u00601 promise, Boolean requiresSynchronization)\n--- End of stack trace from previous location ---\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable\u00601 parameters, CancellationToken cancellationToken)\n at Squidex.Providers.SqlServer.JsonFunction.InitializeAsync(DbContext dbContext, CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Providers/SqlServer/JsonFunction.cs:line 66\n at Squidex.Infrastructure.Queries.SqlDialectInitializer\u00601.InitializeAsync(CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Infrastructure/Queries/SqlDialectInitializer.cs:line 24\n at Squidex.Infrastructure.Queries.SqlDialectInitializer\u00601.InitializeAsync(CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Infrastructure/Queries/SqlDialectInitializer.cs:line 24\n at Squidex.Hosting.InitializerHost.StartAsync(CancellationToken cancellationToken)\n at Microsoft.Extensions.Hosting.Internal.Host.\u003CStartAsync\u003Eb__14_1(IHostedService service, CancellationToken token)\n at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable\u00601 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List\u00601 exceptions, Func\u00603 operation)"
}
}
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'json_exists' in the database.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.Connection.SqlConnectionInternal.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, Boolean isInternal, String endMethod)
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at Microsoft.Data.SqlClient.SqlCommand.<>c.<InternalExecuteNonQueryAsync>b__251_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
at Squidex.Providers.SqlServer.JsonFunction.InitializeAsync(DbContext dbContext, CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Providers/SqlServer/JsonFunction.cs:line 66
at Squidex.Infrastructure.Queries.SqlDialectInitializer`1.InitializeAsync(CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Infrastructure/Queries/SqlDialectInitializer.cs:line 24
at Squidex.Infrastructure.Queries.SqlDialectInitializer`1.InitializeAsync(CancellationToken ct) in /source/src/Squidex.Data.EntityFramework/Infrastructure/Queries/SqlDialectInitializer.cs:line 24
at Squidex.Hosting.InitializerHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Squidex.Program.Main(String[] args) in /source/src/Squidex/Program.cs:line 17
ClientConnectionId:1d9d3369-a2f1-466f-ac9a-4414768a86e9
Error Number:2714,State:3,Class:16
ClientConnectionId before routing:d2b364c4-5f91-4ddd-bff4-c4ddec8901df
Routing Destination:10d0d0d11.tr17795.uksouth1-a.worker.database.windows.net,1433