You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an "Invalid serial number for shell descriptor" error if I have a module with two data migrations, and each migration executes a recipe with a "Feature" step. Example from DataMigration class:
Both recipes ("0001_migration.json" and "0002_migration.json") contain a "Feature" step that is meant to ensure certain core features are activated. If both of these migrations run back-to-back, which would happen when activating the feature for the first time, I get this error when the second recipe runs:
2024-05-08 13:45:50.2348|||0HN3FJV95DQPC:00000001|OrchardCore.Data.Migration.DataMigrationManager|ERR|Error while running migration version 1 for 'My.Test.Modules.FeaturesModule'.
System.InvalidOperationException: Invalid serial number for shell descriptor
at OrchardCore.Environment.Shell.Data.Descriptors.ShellDescriptorManager.UpdateShellDescriptorAsync(Int32 priorSerialNumber, IEnumerable`1 enabledFeatures)
at OrchardCore.Environment.Shell.ShellDescriptorFeaturesManager.UpdateFeaturesAsync(ShellDescriptor shellDescriptor, IEnumerable`1 featuresToDisable, IEnumerable`1 featuresToEnable, Boolean force)
at OrchardCore.Features.Recipes.Executors.FeatureStep.ExecuteAsync(RecipeExecutionContext context)
at OrchardCore.Recipes.Services.RecipeExecutor.<>c__DisplayClass7_0.<<ExecuteStepAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func`2 execute, Boolean activateShell)
at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteStepAsync(RecipeExecutionContext recipeStep)
at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken)
at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken)
at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken)
at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken)
at OrchardCore.Recipes.Services.RecipeMigrator.ExecuteAsync(String recipeFileName, IDataMigration migration)
at Mbt.Phase7.Modules.FeaturesModule.Migrations.DataMigrations.UpdateFrom1Async() in C:\workspace\Mbt.Phase7\Modules\FeaturesModule\Migrations\DataMigrations.cs:line 24
at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId)`
Works fine if I just have the one recipe run.
I'm running on OC 1.8.2. Is there something I'm doing wrong here? Other than abandoning the use of the RecipeMigrator to activate features, is there a way to make this work?
Thank you.
UPDATE: As a work-around for this issue I declared all the features I want activated as dependencies of my module. Orchard activates them automatically, meaning I don't need a migration recipe step. Adding additional dependencies after the feature is activated also seems to work fine, as Orchard will pick up on those and activate them. This meets my need at present, but the original issue presented seems to stand.
The text was updated successfully, but these errors were encountered:
This looks like a bug indeed, so your workaround is what you need to do currently. Declaring dependencies in your module's manifest is recommended anyway if your module indeed depends on them.
I get an "Invalid serial number for shell descriptor" error if I have a module with two data migrations, and each migration executes a recipe with a "Feature" step. Example from DataMigration class:
Both recipes ("0001_migration.json" and "0002_migration.json") contain a "Feature" step that is meant to ensure certain core features are activated. If both of these migrations run back-to-back, which would happen when activating the feature for the first time, I get this error when the second recipe runs:
Works fine if I just have the one recipe run.
I'm running on OC 1.8.2. Is there something I'm doing wrong here? Other than abandoning the use of the RecipeMigrator to activate features, is there a way to make this work?
Thank you.
UPDATE: As a work-around for this issue I declared all the features I want activated as dependencies of my module. Orchard activates them automatically, meaning I don't need a migration recipe step. Adding additional dependencies after the feature is activated also seems to work fine, as Orchard will pick up on those and activate them. This meets my need at present, but the original issue presented seems to stand.
The text was updated successfully, but these errors were encountered: