Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About enabling features in the setup recipe #16223

Closed
hyzx86 opened this issue Jun 3, 2024 · 3 comments
Closed

About enabling features in the setup recipe #16223

hyzx86 opened this issue Jun 3, 2024 · 3 comments

Comments

@hyzx86
Copy link
Contributor

hyzx86 commented Jun 3, 2024

Describe the bug

I refer to this project only as a module that automatically opens tenants, it works fine on 1.8.3, and when installing some of the system's own installation recipes there are no problems.
https://github.com/OrchardCMS/TryOrchardCore/blob/master/OrchardCore.Try/Controllers/HomeController.cs

But when I upgraded to version 2.0.x , it had some strange problems, such as

Error while running migration version 0 for 'OrchardCore.Contents'. OrchardCore.Recipes.Models.RecipeExecutionException: 
SQLite Error 1: 'no such table: DeploymentPlanIndex'

Or: (this tip message is from my own release of the Yessql package, just added some error details)

OrchardCore.Recipes.Models.RecipeExecutionException: The document with ID '4' and type 
'OrchardCore.ContentManagement.Metadata.Records.ContentDefinitionRecord, 
OrchardCore.ContentManagement.Abstractions' 

I tried to reproduce these issues in a single step with attach to process, but there are too many steps to feel comfortable with.

My setup recipe

This recipe was implemented in OC 1.8.3 without any problems

{
  "name": "JZLowCode",
  "displayName": "JZ LowCode",
  "description": "LowCode Service",
  "author": "EasyOC",
  "website": "https://jizhousoft.com",
  "version": "0.1",
  "issetuprecipe": true,
  "categories": [],
  "tags": [],
  "variables": {  },
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.AdminMenu",
        "OrchardCore.Admin",
        "OrchardCore.Templates",
        "OrchardCore.ArchiveLater",
        "OrchardCore.AdminTemplates",
        "OrchardCore.Autoroute",
        "OrchardCore.BackgroundTasks",
        "OrchardCore.Localization",
        "OrchardCore.Contents.Deployment.AddToDeploymentPlan",
        "OrchardCore.Contents.Deployment.Download",
        "OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget",
        "OrchardCore.Cors",
        "OrchardCore.CustomSettings",
        "OrchardCore.Users.CustomUserSettings",
        "OrchardCore.Deployment.Remote",
        "OrchardCore.Diagnostics",
        "OrchardCore.DynamicCache",
        "OrchardCore.HomeRoute",
        "OrchardCore.Https",
        "OrchardCore.Rules",
        "OrchardCore.Localization.AdminCulturePicker",
        "OrchardCore.Localization.ContentLanguageHeader",
        "OrchardCore.Navigation",
        "OrchardCore.Security",
        "OrchardCore.Users.AuditTrail",
        "OrchardCore.Workflows.Http",
        "OrchardCore.Workflows.Session",
        "OrchardCore.OpenId.Server",
        "OrchardCore.OpenId.Validation",
        "OrchardCore.Users.Authentication.CacheTicketStore",
        "OrchardCore.Search.Lucene.Worker",
        "OrchardCore.ReverseProxy",
        "OrchardCore.Recipes.Core",
        "EasyOC.Amis",
        "EasyOC.AntdAdmin",
        "EasyOC.AuditTrail",
        "EasyOC.Core",
        "EasyOC.ContentTypes",
        "EasyOC.ContentExtensions",
        "EasyOC.DynamicTypeIndex",
        "EasyOC.DynamicPermissions",
        "EasyOC.Deployment",
        "EasyOC.Excel",
        "EasyOC.GraphQL",
        "EasyOC.Lucene",
        "EasyOC.ReplaceAction",
        "EasyOC.Users",
        "EasyOC.UserProfileDIndex",
        "EasyOC.Users.Impersonation",
        "EasyOC.OpenApi",
        "EasyOC.OpenId.ImplicitLogout",
        "EasyOC.Queries",
        "EasyOC.RDBMS",
        "EasyOC.Scripting",
        "EasyOC.SwaggerUI",
        "EasyOC.System",
        "EasyOC.Workflows",
        "EasyOC.Workflows.Timers",
        "EasyOCVbenAdminTheme",
        "TheAdmin",
        "SafeMode",
        "TheTheme"
      ]
    },
    {
      "name": "settings",
      "HomeRoute": {
        "Action": "Index",
        "Controller": "Admin",
        "Area": "OrchardCore.Admin"
      }
    },
    {
      "name": "Settings",
      "ReverseProxySettings": {
        "ForwardedHeaders": 7
      }
    },
    {
      "name": "Themes",
      "Site": "TheTheme",
      "Admin": "EasyOCVbenAdminTheme"
    }
  ]
}

Error Log

 2024-06-03 23:53:07.4938|006013|OrchardCore.Data.Migration.DataMigrationManager|ERROR|::1|admin http://localhost:2919/saas/Admin
Error while running migration version 0 for 'OrchardCore.Contents'. OrchardCore.Recipes.Models.RecipeExecutionException: SQLite Error 1: 'no such table: DeploymentPlanIndex'.
 ---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: DeploymentPlanIndex'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 434
   at YesSql.Store.<>c__DisplayClass44_0`2.<<ProduceAwaitedAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at YesSql.Data.WorkDispatcher`2.ScheduleAsync[TState](TKey key, TState state, Func`3 valueFactory)
   at YesSql.Store.ProduceAwaitedAsync[T,TState](WorkerQueryKey key, Func`3 work, TState state)
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at OrchardCore.Deployment.DeploymentPlanService.CreateOrUpdateDeploymentPlansAsync(IEnumerable`1 deploymentPlans) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore.Modules\OrchardCore.Deployment\DeploymentPlanService.cs:line 97
   at OrchardCore.Recipes.Services.RecipeExecutor.<>c__DisplayClass8_0.<<ExecuteStepAsync>b__0>d.MoveNext() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 188
--- End of stack trace from previous location ---
   at OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func`2 execute, Boolean activateShell) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 275
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteStepAsync(RecipeExecutionContext recipeStep) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 171
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 103
   --- End of inner exception stack trace ---
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 128
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 147
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 157
   at EasyOC.Core.Recipes.EocRecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\EasyOC\src\Core\EasyOC.Core\Recipes\EocRecipeExecutor.cs:line 32
   at OrchardCore.Recipes.Services.RecipeMigrator.ExecuteAsync(String recipeFileName, IDataMigration migration) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeMigrator.cs:line 55
   at OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget.ExportContentToDeploymentTargetMigrations.CreateAsync() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore.Modules\OrchardCore.Contents\Deployment\ExportContentToDeploymentTarget\ExportContentToDeploymentTargetMigrations.cs:line 31
   at OrchardCore.Data.Migration.DataMigrationManager.InvokeMethodAsync(MethodInfo method, IDataMigration migration) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 254
   at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 216    at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 128
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 147
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 157
   at EasyOC.Core.Recipes.EocRecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\EasyOC\src\Core\EasyOC.Core\Recipes\EocRecipeExecutor.cs:line 32
   at OrchardCore.Recipes.Services.RecipeMigrator.ExecuteAsync(String recipeFileName, IDataMigration migration) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeMigrator.cs:line 55
   at OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget.ExportContentToDeploymentTargetMigrations.CreateAsync() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore.Modules\OrchardCore.Contents\Deployment\ExportContentToDeploymentTarget\ExportContentToDeploymentTargetMigrations.cs:line 31
   at OrchardCore.Data.Migration.DataMigrationManager.InvokeMethodAsync(MethodInfo method, IDataMigration migration) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 254
   at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 216

2024-06-03 23:53:08.0331|006013|EasyOC.Core.Recipes.EocRecipeExecutor|ERROR|::1|admin http://localhost:2919/saas/Admin
配方执行失败:名称 OrchardCore.Recipes.Models.RecipeExecutionException: The document with ID '4' and type 'OrchardCore.ContentManagement.Metadata.Records.ContentDefinitionRecord, OrchardCore.ContentManagement.Abstractions' could not be updated as it has been changed by another process.
 ---> YesSql.ConcurrencyException: The document with ID '4' and type 'OrchardCore.ContentManagement.Metadata.Records.ContentDefinitionRecord, OrchardCore.ContentManagement.Abstractions' could not be updated as it has been changed by another process.
   at YesSql.Commands.UpdateDocumentCommand.ExecuteAsync(DbConnection connection, DbTransaction transaction, ISqlDialect dialect, ILogger logger)
   at YesSql.Session.FlushInternalAsync(Boolean saving)
   at YesSql.Session.FlushInternalAsync(Boolean saving)
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at OrchardCore.Deployment.DeploymentPlanService.CreateOrUpdateDeploymentPlansAsync(IEnumerable`1 deploymentPlans) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore.Modules\OrchardCore.Deployment\DeploymentPlanService.cs:line 97
   at OrchardCore.Recipes.Services.RecipeExecutor.<>c__DisplayClass8_0.<<ExecuteStepAsync>b__0>d.MoveNext() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 188
--- End of stack trace from previous location ---
   at OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func`2 execute, Boolean activateShell) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 275
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteStepAsync(RecipeExecutionContext recipeStep) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 171
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 103
   --- End of inner exception stack trace ---
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 128
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 147
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 157
   at EasyOC.Core.Recipes.EocRecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\EasyOC\src\Core\EasyOC.Core\Recipes\EocRecipeExecutor.cs:line 32    at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 128
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 147
   at OrchardCore.Recipes.Services.RecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Recipes.Core\Services\RecipeExecutor.cs:line 157
   at EasyOC.Core.Recipes.EocRecipeExecutor.ExecuteAsync(String executionId, RecipeDescriptor recipeDescriptor, IDictionary`2 environment, CancellationToken cancellationToken) in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\EasyOC\src\Core\EasyOC.Core\Recipes\EocRecipeExecutor.cs:line 32

Screenshots

Database
image

image

@hyzx86 hyzx86 added the bug 🐛 label Jun 3, 2024
@Piedone
Copy link
Member

Piedone commented Jun 3, 2024

Please share a minimal repro with a vanilla OC, since we won't really be able to repro this.

BTW DeploymentPlanIndex or its migration didn't change since 1.8.0.

Also, which DB engine are you using?

@gvkries
Copy link
Contributor

gvkries commented Jun 7, 2024

Has this been fixed by #16257?

@hyzx86
Copy link
Contributor Author

hyzx86 commented Jun 7, 2024

yes same as #16212 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants