Squidex Upgrade from 6.x to 7.x

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ X] Documentation issue or request

We are trying to upgrade Squidex from 6.x to 7.x version. We want to understand if we can keep below settings in place for this upgrade.

1- We want to keep optimizeForSelfHosting as false so it does’t go through a migration. We also don’t want to have 4 copies for same data. Is it ok to have belog settings with 7.x version?

“contents”: {
“optimizeForSelfHosting”: false,
“useTransactions”: true
},

2- We also don’t want to change serialization from current value (Document). Can you please confirm if this is fine?

“store”: {
“mongoDb”: {
“valueRepresentation”: “Document”
}

3- Do we need to update the Squidex Client Library version when we do this upgrade?

4- We have 2 instances of Squidex running in Production behind one ELB. We will be setting WorkerNode=true to one machine only. Do we need to have DB in ReadOnly mode when we do this upgrade?

5- We will be upgrading one instance at a time. What can we expect when we are upgrading 2n’d server as on that case we won’t have a worker Node. Can we run without Worker Node for few hours without any errors?

6- When we did similar upgrade (Pre-Production) we saw Rules stopped working for some time as well as we faced multiple timeout errors (HTTP Status: 408). We are not seeing those errors now (still doing more testing to confirm this). I am not sure but feels like Squidex became unstable for few hours and then things came back to normal.

1 Like
  1. Yes, it is fine.
  2. Sure, all the default settings are meant to ensure compatibility.
  3. No, there is no API change.
  4. You do not have to enable readonly mode, but if you make one node the worker, the load is not distributed equally.
  5. Yes, but some things will just not update, for example rules, history, full text.
  6. Okay, but it is not very concrete.
2 Likes

@Sebastian - During this upgrade does the Migration collection needs monitoring ?
The IsLocked property on Migration collection will be set to true ? If so, should we wait for it to be marked as false before allowing Live traffic ?

No, there is no database update and no migration running.

Thanks for quick reply @Sebastian

Some errors from our logs for point 6:
1- Squidex.ClientLibrary.Utils.SquidexClientBase.EnsureResponseIsValidAsync(HttpResponseMessage response)
at Squidex.ClientLibrary.Utils.SquidexClientBase.RequestJsonAsync[T](HttpMethod method, String path, HttpContent content, QueryContext context, CancellationToken ct)
at XpertHR.XPS.SquidexMgmt.SquidexGateway.PatchContentAsync[TEntity,TData](String id, TData data, CancellationToken cancellationToken)

2- Squidex API failed with internal error. No further details in logs.

3- Failed to repair snapshot for domain object of type Squidex.Domain.Apps.Entities.DomainObject with ID 2c7dasdqwewqe*********

We are again seeing so many errors (error 1 and 2). Looks like we are not stable now with latest version of Squidex.

I am not sure how to help here. In my experience from Squidex Cloud 7.0 is more stable and faster than 6.x

@Sebastian After looking more we found below…
1- We are able to update newly created records without any issues (created after upgrade)
2- We are not able to update any record which was created with 6.x version of Squidex from Squidex UI as well as by using API.
3- All OLD records are failing with timeout (after waiting for 1 min) errors.

May be we have some wrong setting which needs to be updated. Can you please double check? I am sending all settings which we are overriding from default values here.

{
  "mode": {
  "isReadonly": false
},
  "urls": {
  "enforceHttps": true
},
  "rules": {
  "executionTimeoutInSeconds": 120
},
  "ui": {
  "onlyAdminsCanCreateApps": true,
  "hideNews": true,
  "google": {
    "analyticsId": ""
  }
},
  "apps": {
  "deletePermanent": false
},
  "contents": {
  "optimizeForSelfHosting": false,
  "useTransactions": true
},
  "logging": {
  "level": "Warning",
  "human": false,
  "storeRetentationInDays": 7,
  "storeEnabled": false
},
  "clustering": {
  "worker": true
},
  "store": {
  "mongoDb": {
    "valueRepresentation": "Document"
  }
},
  "twitter": {
  "clientId": "",
  "clientSecret": ""
},
  "plugins": [
  "Squidex.Extensions.dll"
],
  "identity": {
  "adminApps": [
    "xps-policymanager"
  ]
}
}

I have not changed a single setting when I made the upgrade myself.

Hello, just wanted to ask a couple of things related to this. I think we had a few similar errors when migrating from 6 to 7 but they were seemingly transient and I put them down to Orleans somehow trying to process things as we were performing the update. As we’re in Docker perhaps we didn’t stop things properly.

Anyway am I right in saying the Migration collection should show Version: 25? The code says that’s the current version although there is reference further down to 26: https://github.com/Squidex/squidex/blob/master/backend/src/Migrations/MigrationPath.cs#L73

Also would you have expected the Orleans_OrleansReminderV2 collection to have been automatically cleaned up during upgrade or should we be manually removing it?

@pankajv82 @Sudharsan we were lucky in that we could just completely delete our App and start again if we needed to, but if you are not in the same position perhaps it is worth trying a rebuild using the configuration: https://docs.squidex.io/01-getting-started/installation/troubleshooting-and-support#my-mongo-database-is-corrupt

I have used this in the past (not production) when changing the valueRepresentation setting, you definitely do need to keep an eye on that Migration collection to no longer be locked when doing this.

Thanks for your support @slalFe

Yes, this should be version 25. But it is not a big problem.

I never delete collections, because I want to give the opportunity to roll back.

This setting should just change the documents over time.

1 Like

Hi @Sebastian,
After making setting transactions=false, squidex is much more stable. We are seeing below error getting logged few times. Can you please let us know when it can happen?

 An error occurred while deserializing the Data property of class Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentEntity: Unable to translate bytes [BD] at index 1136 from specified code page to Unicode.
at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.DeserializeMemberValue(BsonDeserializationContext context, BsonMemberMap memberMap)
   at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.DeserializeClass(BsonDeserializationContext context)
   at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
   at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context)
   at MongoDB.Driver.Core.Operations.CursorBatchDeserializationHelper.DeserializeBatch[TDocument](RawBsonArray batch, IBsonSerializer`1 documentSerializer, MessageEncoderSettings messageEncoderSettings)
   at MongoDB.Driver.Core.Operations.FindOperation`1.CreateFirstCursorBatch(BsonDocument cursorDocument)
   at MongoDB.Driver.Core.Operations.FindOperation`1.CreateCursor(IChannelSourceHandle channelSource, IChannelHandle channel, BsonDocument commandResult)
   at MongoDB.Driver.Core.Operations.FindOperation`1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.FindOperation`1.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)
   at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken)
   at Squidex.Infrastructure.MongoDb.MongoExtensions.ToListRandomAsync[T](IFindFluent`2 find, IMongoCollection`1 collection, Int64 take, CancellationToken ct) in C:\src\src\Squidex.Infrastructure.MongoDb\MongoDb\MongoExtensions.cs:line 237
   at Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations.Extensions.QueryContentsAsync(IMongoCollection`1 collection, FilterDefinition`1 filter, ClrQuery query, CancellationToken ct) in C:\src\src\Squidex.Domain.Apps.Entities.MongoDb\Contents\Operations\Extensions.cs:line 114
   at Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations.QueryByQuery.QueryAsync(ISchemaEntity schema, Q q, CancellationToken ct) in C:\src\src\Squidex.Domain.Apps.Entities.MongoDb\Contents\Operations\QueryByQuery.cs:line 126
   at Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentCollection.QueryAsync(IAppEntity app, ISchemaEntity schema, Q q, CancellationToken ct) in C:\src\src\Squidex.Domain.Apps.Entities.MongoDb\Contents\MongoContentCollection.cs:line 205
   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentQueryService.QueryCoreAsync(Context context, Q q, ISchemaEntity schema, CancellationToken ct) in C:\src\src\Squidex.Domain.Apps.Entities\Contents\Queries\ContentQueryService.cs:line 246
   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentQueryService.QueryAsync(Context context, String schemaIdOrName, Q q, CancellationToken ct) in C:\src\src\Squidex.Domain.Apps.Entities\Contents\Queries\ContentQueryService.cs:line 114
   at Squidex.Areas.Api.Controllers.Contents.ContentsController.GetContents(String app, String schema, String ids, String q) in C:\src\src\Squidex\Areas\Api\Controllers\Contents\ContentsController.cs:line 63
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

I have no idea, never seen this before. I will need to dig into that.

EDIT: I only found this so far: https://jira.mongodb.org/browse/CSHARP-996

Thanks @Sebastian We will continue to monitor if this errors happens again.