[SOLVED] Backup - Failed with internal error

Hi!

I have…

  • [X] 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)
  • [X ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Error when I try to restore a backup:
2021-03-16T13:42:42Z: Started. The restore process has the following steps:

2021-03-16T13:42:42Z: * Download backup

2021-03-16T13:42:42Z: * Restore events and attachments.

2021-03-16T13:42:42Z: * Restore all objects like app, schemas and contents

2021-03-16T13:42:42Z: * Complete the restore operation for all objects

2021-03-16T13:42:42Z: Downloading Backup

2021-03-16T13:42:44Z: Downloaded Backup

2021-03-16T13:42:44Z: Creating Users

2021-03-16T13:42:58Z: Reading 906 events and 39 attachments completed.

2021-03-16T13:42:58Z: Restored Apps

2021-03-16T13:42:58Z: Restored Assets

2021-03-16T13:42:59Z: Restored Contents

2021-03-16T13:42:59Z: Restored Rules

2021-03-16T13:42:59Z: Restored Schemas

2021-03-16T13:42:59Z: Completed Apps

2021-03-16T13:42:59Z: Completed Assets

2021-03-16T13:42:59Z: Completed Contents

2021-03-16T13:42:59Z: Completed Rules

2021-03-16T13:42:59Z: Completed Schemas

2021-03-16T13:42:59Z: Failed with internal error

In container log , I found this message:

{
“logLevel”: “Error”,
“action”: “GrainInvoked”,
“status”: “Failed”,
“grain”: “Squidex.Domain.Apps.Entities.Apps.DomainObject.AppDomainObjectGrain”,
“grainMethod”: “System.Threading.Tasks.Task\u00601[Squidex.Infrastructure.Orleans.J\u00601[System.Object]] Squidex.Infrastructure.Commands.IDomainObjectGrain.ExecuteAsync(Squidex.Infrastructure.Orleans.J\u00601[Squidex.Infrastructure.Commands.CommandRequest])”,
“timestamp”: “2021-03-16T13:58:50Z”,
“app”: {
“name”: “Squidex”,
“version”: “5.6.0.0”,
“sessionId”: “86c096ac-c344-4c68-9071-454be16536a6”
},
“exception”: {
“type”: “Squidex.Infrastructure.DomainObjectNotFoundException”,
“message”: “Entity (aa91ce00-bba4-416f-90e3-2b99dd4e1d31) does not exist.”,
“stackTrace”: " at Squidex.Infrastructure.Commands.DomainObjectBase\u00601.InvokeAsync[TCommand](TCommand command, Func\u00602 handler, Boolean isUpdate) in /src/src/Squidex.Infrastructure/Commands/DomainObjectBase.cs:line 156\n at Squidex.Infrastructure.Commands.DomainObjectGrain\u00602.ExecuteAsync(J\u00601 request) in /src/src/Squidex.Infrastructure/Commands/DomainObjectGrain.cs:line 47\n at Squidex.Domain.Apps.Entities.Apps.DomainObject.OrleansCodeGenAppGrainMethodInvoker.Invoke(IAddressable grain, InvokeMethodRequest request) in /src/src/Squidex.Domain.Apps.Entities/obj/Release/net5.0/Squidex.Domain.Apps.Entities.orleans.g.cs:line 35\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.StateFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/StateFilter.cs:line 51\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.LocalCacheFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs:line 39\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.ExceptionWrapperFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/ExceptionWrapperFilter.cs:line 35\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.LoggingFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs:line 46"
}
}

{
“logLevel”: “Error”,
“action”: “restore”,
“status”: “failed”,
“operationId”: “498601b4-5ad0-49c8-bc21-ecd9c4d6e2a3”,
“url”: “https://www.sennit.com.br/bkp/backup-notificacoes-2021-03-02_11-13-26.zip”,
“profiler”: {
“MongoContentRepository/WriteAsync”: {
“elapsedMsTotal”: 825,
“elapsedMsAvg”: 91,
“count”: 9
},

  },

“timestamp”: “2021-03-16T13:42:59Z”,
“app”: {
“name”: “Squidex”,
“version”: “5.6.0.0”,
“sessionId”: “ddb45db4-dde7-429f-aca2-0e8abdd7eefe”
},
“exception”: {
“type”: “Squidex.Infrastructure.DomainObjectNotFoundException”,
“message”: “Entity (b6fea3fa-eca0-42b1-9856-1f1b40cae55d) does not exist.”,
“stackTrace”: " at Squidex.Infrastructure.Commands.DomainObjectBase\u00601.InvokeAsync[TCommand](TCommand command, Func\u00602 handler, Boolean isUpdate) in /src/src/Squidex.Infrastructure/Commands/DomainObjectBase.cs:line 156\n at Squidex.Infrastructure.Commands.DomainObjectGrain\u00602.ExecuteAsync(J\u00601 request) in /src/src/Squidex.Infrastructure/Commands/DomainObjectGrain.cs:line 47\n at Squidex.Domain.Apps.Entities.Apps.DomainObject.OrleansCodeGenAppGrainMethodInvoker.Invoke(IAddressable grain, InvokeMethodRequest request) in /src/src/Squidex.Domain.Apps.Entities/obj/Release/net5.0/Squidex.Domain.Apps.Entities.orleans.g.cs:line 35\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.StateFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/StateFilter.cs:line 51\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.LocalCacheFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs:line 39\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.ExceptionWrapperFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/ExceptionWrapperFilter.cs:line 35\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Squidex.Infrastructure.Orleans.LoggingFilter.Invoke(IIncomingGrainCallContext context) in /src/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs:line 46\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at OrleansDashboard.Metrics.GrainProfilerFilter.Invoke(IIncomingGrainCallContext context)\n at Orleans.Runtime.GrainMethodInvoker.Invoke()\n at Orleans.Runtime.InsideRuntimeClient.Invoke(IAddressable target, IInvokable invokable, Message message)\n at Orleans.Internal.OrleansTaskExtentions.\u003CToTypedTask\u003Eg__ConvertAsync|4_0[T](Task\u00601 asyncTask)\n at Squidex.Infrastructure.Commands.GrainCommandMiddleware\u00602.ExecuteCommandAsync(TCommand typedCommand) in /src/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs:line 45\n at Squidex.Infrastructure.Commands.GrainCommandMiddleware\u00602.ExecuteCommandAsync(CommandContext context) in /src/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs:line 35\n at Squidex.Domain.Apps.Entities.Apps.DomainObject.AppCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppCommandMiddleware.cs:line 48\n at Squidex.Domain.Apps.Entities.Schemas.Indexes.SchemasIndex.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs:line 154\n at Squidex.Domain.Apps.Entities.Rules.Indexes.RulesIndex.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Rules/Indexes/RulesIndex.cs:line 60\n at Squidex.Domain.Apps.Entities.Apps.Indexes.AppsIndex.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs:line 222\n at Squidex.Domain.Apps.Entities.Apps.Invitation.InviteUserCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs:line 58\n at Squidex.Infrastructure.Commands.CustomCommandMiddlewareRunner.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs:line 32\n at Squidex.Web.CommandMiddlewares.ETagCommandMiddleware.HandleAsync(CommandContext context, NextDelegate next) in /src/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs:line 36\n at Squidex.Infrastructure.Commands.InMemoryCommandBus.PublishAsync(ICommand command) in /src/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs:line 71\n at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.AssignContributorAsync() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 254\n at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ProcessAsync() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 192"
}
}

Expected behavior

Restore Complete

Minimal reproduction of the problem

Try to restore this backup: http://www.sennit.com.br/bkp/backup-site-settings-2021-03-02_11-13-39.zip

Environment

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [5.6.0]

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [X] Edge

Others:

Thank you very much for the good and detailed bug report. I will have a look.

1 Like

Hi Sebastian!

I create new instance from squidex in my infraestructure, now I`m using a version 4.7.6 from squidex and try to restorer new backup from other app.
https://www.sennit.com.br/bkp/backup-site-sennit-2021-03-11_14-14-18.zip

You can see below a message :
2021-03-17T23:07:52Z: Started. The restore process has the following steps:

2021-03-17T23:07:52Z: * Download backup

2021-03-17T23:07:52Z: * Restore events and attachments.

2021-03-17T23:07:52Z: * Restore all objects like app, schemas and contents

2021-03-17T23:07:52Z: * Complete the restore operation for all objects

2021-03-17T23:07:52Z: Downloading Backup

2021-03-17T23:07:58Z: Downloaded Backup

2021-03-17T23:07:58Z: Creating Users

2021-03-17T23:08:36Z: Reading 2999 events and 263 attachments completed.

2021-03-17T23:08:36Z: Restored Apps

2021-03-17T23:08:36Z: Failed with internal error

and log in container docker:

    {
  "logLevel": "Error",
  "action": "restore",
  "status": "failed",
  "operationId": "2d2ad188-f58f-496c-9897-42f9e42d6e07",
  "url": "https://www.sennit.com.br/bkp/backup-site-sennit-2021-03-11_14-14-18.zip",
  "profiler": {
    "MongoEventStore/AppendAsync": {
      "elapsedMsTotal": 23236,
      "elapsedMsAvg": 7,
      "count": 2998
    },
    "Download": {
      "elapsedMsTotal": 5587,
      "elapsedMsAvg": 5587,
      "count": 1
    },
    "ReadEvents": {
      "elapsedMsTotal": 38266,
      "elapsedMsAvg": 38266,
      "count": 1
    },
    "CreateUsers": {
      "elapsedMsTotal": 51,
      "elapsedMsAvg": 51,
      "count": 1
    },
    "MongoAssetRepository/WriteAsync": {
      "elapsedMsTotal": 7,
      "elapsedMsAvg": 1,
      "count": 4
    },
    "MongoSnapshotStore\u00602/WriteAsync": {
      "elapsedMsTotal": 14,
      "elapsedMsAvg": 7,
      "count": 2
    },
    "BackupApps/RestoreAsync": {
      "elapsedMsTotal": 26,
      "elapsedMsAvg": 26,
      "count": 1
    },
    "MongoEventStore/QueryAsync": {
      "elapsedMsTotal": 23,
      "elapsedMsAvg": 5,
      "count": 4
    },
    "MongoSnapshotStore\u00602/ReadAsync": {
      "elapsedMsTotal": 8,
      "elapsedMsAvg": 4,
      "count": 2
    },
    "BackupAssets/RestoreAsync": {
      "elapsedMsTotal": 78,
      "elapsedMsAvg": 78,
      "count": 1
    }
  },
  "app": {
    "name": "Squidex",
    "version": "4.7.6.0",
    "sessionId": "f736c6f0-9120-463a-889e-b957e6014389"
  },
  "timestamp": "2021-03-17T23:08:36Z",
  "exception": {
    "type": "System.NullReferenceException",
    "message": "Object reference not set to an instance of an object.",
    "stackTrace": "   at Squidex.Domain.Apps.Entities.MongoDb.Assets.MongoAssetRepository.Squidex.Infrastructure.States.ISnapshotStore\u003CSquidex.Domain.Apps.Entities.Assets.State.AssetState,System.Guid\u003E.WriteAsync(Guid key, AssetState value, Int64 oldVersion, Int64 newVersion) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository_SnapshotStore.cs:line 48\n   at Squidex.Infrastructure.Commands.LogSnapshotDomainObject\u00601.RebuildStateAsync() in /src/src/Squidex.Infrastructure/Commands/LogSnapshotDomainObject.cs:line 106\n   at Squidex.Infrastructure.Commands.Rebuilder.\u003C\u003Ec__DisplayClass7_0\u00602.\u003C\u003CInsertManyAsync\u003Eb__0\u003Ed.MoveNext() in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 78\n--- End of stack trace from previous location where exception was thrown ---\n   at Squidex.Infrastructure.Commands.Rebuilder.InsertManyAsync[T,TState](IdSource source, CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 104\n   at Squidex.Domain.Apps.Entities.Assets.BackupAssets.RestoreAsync(RestoreContext context) in /src/src/Squidex.Domain.Apps.Entities/Assets/BackupAssets.cs:line 94\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ProcessAsync() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 172"
  }
}

Can you help me to do this restore ?

Thanks for support.

I will have a look, but I can only do it right now if the version the backup is made is 5.0 or higher.

Squidex also does not support to migrate backups from newer versions to older versions.

1 Like

Hi Sebastian

The first backup link is made is 5.6.0.
A second link is made is 4.X.

Thanks

Great, I will have a look, but I cannot promise that I will be able to test it today.

1 Like

take your time :slight_smile:

1 Like

I cannot reproduce it with the current dev version. But I have realized that the backup is broken. For example when you open an event from the backup:

{
   "n":{
      "t":"AppCreatedEvent",
      "s":"app-5bae70f9-cdff-4a3e-be37-c092b44d5480--5bae70f9-cdff-4a3e-be37-c092b44d5480",
      "p":"{\"name\":\"site-sennit\",\"appId\":\"5bae70f9-cdff-4a3e-be37-c092b44d5480,site-sennit\",\"actor\":\"subject:5dfbc328d28bc300013f1d60\"}",
      "h":{
         "EventId":"ec84a4b8-a45c-4c78-b365-97f834b6e3e5",
         "Timestamp":"2019-12-19T19:00:44Z",
         "AggregateId":"5bae70f9-cdff-4a3e-be37-c092b44d5480--5bae70f9-cdff-4a3e-be37-c092b44d5480",
         "CommitId":"3a203068-60a4-4ba8-9215-ac82d1f606ff",
         "EventNumber":"1576782044-1-0-7",
         "EventStreamNumber":0
      }
   },
   "eventStreamNumber":0
}

s is an event stream, each entity like app or schema has its own stream, where the name is formatted like this

[TYPE]-[APPID]-[ID] for everything except the app

and

[TYPE]-[APPID] for the app itself.

You say this version : squidex/squidex:dev-5742 ?

I will try.

Hi Sebastian!

I upgrade a version to squidex/squidex:dev-5742 docker and now restore for this 2 links above works fine!

But I have problem to restore another 2 backups:
https://www.sennit.com.br/prd/backup-e-card-app-2021-03-19_12-08-20.zip

with error below:

{
  "logLevel": "Error",
  "action": "restore",
  "status": "failed",
  "operationId": "4631379d-9338-4072-a267-61524bfe74a9",
  "url": "https://www.sennit.com.br/prd/backup-e-card-app-2021-03-19_12-08-20.zip",
  "profiler": {
    "Download": {
      "elapsedMsTotal": 499,
      "elapsedMsAvg": 499,
      "count": 1
    },
    "ReadEvents": {
      "elapsedMsTotal": 1182,
      "elapsedMsAvg": 1182,
      "count": 1
    },
    "CreateUsers": {
      "elapsedMsTotal": 28,
      "elapsedMsAvg": 28,
      "count": 1
    },
    "MongoEventStore/AppendAsync": {
      "elapsedMsTotal": 468,
      "elapsedMsAvg": 10,
      "count": 43
    }
  },
  "timestamp": "2021-03-22T21:11:19Z",
  "app": {
    "name": "Squidex",
    "version": "4.0.0.0",
    "sessionId": "6ffc31b5-cd66-4392-8a52-2e501e8c7e6a"
  },
  "exception": {
    "type": "System.InvalidCastException",
    "message": "Unable to cast object of type \u0027Squidex.Infrastructure.Json.Objects.JsonObject\u0027 to type \u0027Squidex.Domain.Apps.Core.Contents.ContentFieldData\u0027.",
    "stackTrace": "   at Squidex.Domain.Apps.Entities.Contents.BackupContents.\u003C\u003Ec.\u003C.cctor\u003Eb__22_1(IReadOnlyDictionary\u00602 obj, String key, IJsonValue value) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 38\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(IReadOnlyDictionary\u00602 source, ObjectSetter setter) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 165\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(JsonArray source) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 207\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(IReadOnlyDictionary\u00602 source, ObjectSetter setter) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 154\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(IReadOnlyDictionary\u00602 source, ObjectSetter setter) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 158\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(ContentData data) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 115\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.RestoreEventAsync(Envelope\u00601 event, RestoreContext context) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 100\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.HandleEventAsync(IBackupReader reader, IEnumerable\u00601 handlers, String stream, Envelope\u00601 event) in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 373\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.\u003C\u003Ec__DisplayClass22_0.\u003C\u003CReadEventsAsync\u003Eb__0\u003Ed.MoveNext() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 317\n--- End of stack trace from previous location ---\n   at Squidex.Domain.Apps.Entities.Backup.BackupReader.ReadEventsAsync(IStreamNameResolver streamNameResolver, IEventDataFormatter formatter, Func\u00602 handler) in /src/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs:line 116\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ReadEventsAsync(IBackupReader reader, IEnumerable\u00601 handlers) in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 315\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ProcessAsync() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 168"
  }
}

and https://www.sennit.com.br/prd/backup-proposal-sennit-app-2021-03-22_13-13-48.zip:

`    {
  "logLevel": "Error",
  "action": "restore",
  "status": "failed",
  "operationId": "1464a7b3-612c-4f5d-912a-6dc82bec25e5",
  "url": "https://www.sennit.com.br/prd/backup-proposal-sennit-app-2021-03-22_13-13-48.zip",
  "profiler": {
    "Download": {
      "elapsedMsTotal": 6259,
      "elapsedMsAvg": 6259,
      "count": 1
    },
    "ReadEvents": {
      "elapsedMsTotal": 23544,
      "elapsedMsAvg": 23544,
      "count": 1
    },
    "CreateUsers": {
      "elapsedMsTotal": 52,
      "elapsedMsAvg": 52,
      "count": 1
    },
    "MongoEventStore/AppendAsync": {
      "elapsedMsTotal": 13143,
      "elapsedMsAvg": 13,
      "count": 980
    }
  },
  "timestamp": "2021-03-22T21:18:24Z",
  "app": {
    "name": "Squidex",
    "version": "4.0.0.0",
    "sessionId": "6ffc31b5-cd66-4392-8a52-2e501e8c7e6a"
  },
  "exception": {
    "type": "System.InvalidCastException",
    "message": "Unable to cast object of type \u0027Squidex.Infrastructure.Json.Objects.JsonObject\u0027 to type \u0027Squidex.Domain.Apps.Core.Contents.ContentFieldData\u0027.",
    "stackTrace": "   at Squidex.Domain.Apps.Entities.Contents.BackupContents.\u003C\u003Ec.\u003C.cctor\u003Eb__22_1(IReadOnlyDictionary\u00602 obj, String key, IJsonValue value) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 38\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(IReadOnlyDictionary\u00602 source, ObjectSetter setter) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 165\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(JsonArray source) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 207\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(IReadOnlyDictionary\u00602 source, ObjectSetter setter) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 154\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.ReplaceAssetUrl(ContentData data) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 115\n   at Squidex.Domain.Apps.Entities.Contents.BackupContents.RestoreEventAsync(Envelope\u00601 event, RestoreContext context) in /src/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs:line 107\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.HandleEventAsync(IBackupReader reader, IEnumerable\u00601 handlers, String stream, Envelope\u00601 event) in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 373\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.\u003C\u003Ec__DisplayClass22_0.\u003C\u003CReadEventsAsync\u003Eb__0\u003Ed.MoveNext() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 318\n--- End of stack trace from previous location ---\n   at Squidex.Domain.Apps.Entities.Backup.BackupReader.ReadEventsAsync(IStreamNameResolver streamNameResolver, IEventDataFormatter formatter, Func\u00602 handler) in /src/src/Squidex.Domain.Apps.Entities/Backup/BackupReader.cs:line 116\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ReadEventsAsync(IBackupReader reader, IEnumerable\u00601 handlers) in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 315\n   at Squidex.Domain.Apps.Entities.Backup.RestoreGrain.ProcessAsync() in /src/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs:line 168"
  }
}`

Do you have any kind of paid support that I could hire?

Thanks,

Hi Sebastian.

After updating a version to squidex / squidex: dev-5742 do the restoration of the first link, even after successfully completing, the application did not appear available to me.
I then noticed this in the log:

2021-03-23T10:45:51Z: Started. The restore process has the following steps:

2021-03-23T10:45:51Z: * Download backup

2021-03-23T10:45:51Z: * Restore events and attachments.

2021-03-23T10:45:51Z: * Restore all objects like app, schemas and contents

2021-03-23T10:45:51Z: * Complete the restore operation for all objects

2021-03-23T10:45:51Z: Downloading Backup

2021-03-23T10:45:57Z: Downloaded Backup

2021-03-23T10:45:57Z: Creating Users

2021-03-23T10:46:47Z: Reading 2999 events and 264 attachments completed.

2021-03-23T10:46:47Z: Restored Apps

2021-03-23T10:46:47Z: Restored Assets

2021-03-23T10:46:49Z: Restored Contents

2021-03-23T10:46:49Z: Restored Rules

2021-03-23T10:46:49Z: Restored Schemas

2021-03-23T10:46:49Z: Completed Apps

2021-03-23T10:46:49Z: Completed Assets

2021-03-23T10:46:49Z: Completed Contents

2021-03-23T10:46:49Z: Completed Rules

2021-03-23T10:46:49Z: Completed Schemas

2021-03-23T10:46:49Z: Failed to assign contributor: Invalid command.

2021-03-23T10:46:49Z: Completed, Yeah!

and in log container not show me any error:

{
  "logLevel": "Information",
  "action": "restore",
  "status": "completed",
  "operationId": "df61073b-51a6-4bcb-af6b-589f3d873d0a",
  "url": "https://www.sennit.com.br/bkp/backup-site-sennit-2021-03-11_14-14-18.zip",
  "profiler": {
    "BackupContents/RestoreAsync": {
      "elapsedMsTotal": 1523,
      "elapsedMsAvg": 1523,
      "count": 1
    },
    "MongoAssetFolderRepository/ReadAsync": {
      "elapsedMsTotal": 73,
      "elapsedMsAvg": 5,
      "count": 14
    },
    "MongoSnapshotStore\u00602/ReadAsync": {
      "elapsedMsTotal": 274,
      "elapsedMsAvg": 7,
      "count": 39
    },
    "BackupAssets/CompleteRestoreAsync": {
      "elapsedMsTotal": 0,
      "elapsedMsAvg": 0,
      "count": 1
    },
    "MongoAssetRepository/WriteAsync": {
      "elapsedMsTotal": 1266,
      "elapsedMsAvg": 4,
      "count": 261
    },
    "BackupAssets/RestoreAsync": {
      "elapsedMsTotal": 615,
      "elapsedMsAvg": 615,
      "count": 1
    },
    "MongoAssetFolderRepository/WriteAsync": {
      "elapsedMsTotal": 75,
      "elapsedMsAvg": 5,
      "count": 14
    },
    "ReadEvents": {
      "elapsedMsTotal": 49365,
      "elapsedMsAvg": 49365,
      "count": 1
    },
    "MongoContentRepository/WriteAsync": {
      "elapsedMsTotal": 7368,
      "elapsedMsAvg": 28,
      "count": 256
    },
    "MongoEventStore/QueryAsync": {
      "elapsedMsTotal": 4733,
      "elapsedMsAvg": 8,
      "count": 560
    },
    "BackupApps/RestoreAsync": {
      "elapsedMsTotal": 18,
      "elapsedMsAvg": 18,
      "count": 1
    },
    "MongoSnapshotStore\u00602/WriteAsync": {
      "elapsedMsTotal": 62,
      "elapsedMsAvg": 4,
      "count": 13
    },
    "Download": {
      "elapsedMsTotal": 6089,
      "elapsedMsAvg": 6089,
      "count": 1
    },
    "BackupSchemas/RestoreAsync": {
      "elapsedMsTotal": 2,
      "elapsedMsAvg": 2,
      "count": 1
    },
    "CreateUsers": {
      "elapsedMsTotal": 83,
      "elapsedMsAvg": 83,
      "count": 1
    },
    "SchemasIndex/GetSchemaAsync": {
      "elapsedMsTotal": 5375,
      "elapsedMsAvg": 34,
      "count": 158
    },
    "BackupRules/CompleteRestoreAsync": {
      "elapsedMsTotal": 0,
      "elapsedMsAvg": 0,
      "count": 1
    },
    "MongoEventStore/AppendAsync": {
      "elapsedMsTotal": 32944,
      "elapsedMsAvg": 10,
      "count": 2998
    },
    "BackupContents/CompleteRestoreAsync": {
      "elapsedMsTotal": 0,
      "elapsedMsAvg": 0,
      "count": 1
    },
    "BackupSchemas/CompleteRestoreAsync": {
      "elapsedMsTotal": 0,
      "elapsedMsAvg": 0,
      "count": 1
    },
    "BackupRules/RestoreAsync": {
      "elapsedMsTotal": 42,
      "elapsedMsAvg": 42,
      "count": 1
    },
    "BackupApps/CompleteRestoreAsync": {
      "elapsedMsTotal": 33,
      "elapsedMsAvg": 33,
      "count": 1
    },
    "MongoAssetRepository/ReadAsync": {
      "elapsedMsTotal": 912,
      "elapsedMsAvg": 3,
      "count": 261
    }
  },
  "timestamp": "2021-03-23T10:46:49Z",
  "app": {
    "name": "Squidex",
    "version": "4.0.0.0",
    "sessionId": "84a87c22-e7ee-4d2e-83bf-d7d6806c6c64"
  }
}

As I said: The backup is corrupt, but I don’t know why.

You talk about a System.InvalidCastException or Failed to assign contributor: Invalid command. ?

There is any way to skip the corrupted content during the restore?

Thanks

It is the same reason with the event-stream that I described above and the reason why the app does not appear. Have you ever tried a beta-version of 5.0.0? Can you make a backup of your mongodb (with mongo-backup) and send it to me?

Hi Sebastian.

Below a mongodump :
https://www.sennit.com.br/prd/mongo.zip
This squidex instance is new and I create with this version: squidex:dev-5742.
I really appreciate your help and would like to hire paid support. How can I do this?

If you open your mongo database with a tool like studio3t (https://studio3t.com/)

you will see the following entries in EventV2 collection:

{ 
    "_id" : "e9702f8c-109b-47a2-9f54-fc2cffe7f183", 
    "Timestamp" : Timestamp(1616463380, 11), 
    "Events" : [
        {
            "Type" : "AppCreatedEvent", 
            "Payload" : "{\"name\":\"proposal-jtn-app\",\"appId\":\"798c92c9-1806-4bc9-a7dc-46d17d047dd0,proposal-jtn-app\",\"actor\":\"subject:60594593215b67a1e07f0c25\",\"fromRule\":false}", 
            "Metadata" : {
                "EventId" : "c09ef39f-b728-4cc5-9776-bd1be5f883ad", 
                "Timestamp" : "2020-06-02T13:04:31Z", 
                "AggregateId" : "b9f77ba7-1db5-4cd3-8f47-471b4d8272c0--b9f77ba7-1db5-4cd3-8f47-471b4d8272c0", 
                "CommitId" : "4c831151-d04e-4cd4-ae8d-65fcce03c3c3", 
                "EventNumber" : "1591103071-1-0-6", 
                "EventStreamNumber" : NumberLong(0)
            }
        }
    ], 
    "EventStreamOffset" : NumberLong(-1), 
    "EventsCount" : NumberLong(1), 
    "EventStream" : "app-b9f77ba7-1db5-4cd3-8f47-471b4d8272c0--b9f77ba7-1db5-4cd3-8f47-471b4d8272c0"
}

You can fix your issue by updating all these events by replacing

"EventStream" : "app-b9f77ba7-1db5-4cd3-8f47-471b4d8272c0--b9f77ba7-1db5-4cd3-8f47-471b4d8272c0"

with

"EventStream" : "app-b9f77ba7-1db5-4cd3-8f47-471b4d8272c0"

I can drop my actual instance and create a new empty if you think is the best.

About a fix. You say to fix, I need to modify a file inside backup and change property “EventStream” ?
That`s it?

Thanks

No, you need to make the change in your DB.

Ok. I will try.

But is to fix a InvalidCastException error when I restore https://www.sennit.com.br/prd/backup-e-card-app-2021-03-19_12-08-20.zip or Failed to assign contributor?

I think it is related.