Open hyzx86 opened 8 months ago
I've been looking for days, but I've finally located the problem 🤣
cc: @sebastienros @Skrypt @ns8482e
Create a tenant name as Test1
,
Edit the tenants.json
file to add a non-existent tenant such as
"Default": {
"VersionId": "4v0jtqy5xc08j7t2z6fw351zc4",
"TenantId": "43nw8ze3xssp17hv7zbhbvx54e",
"State": "Running"
},
// It is an actual existing tenant that you create through the default tenant
// the folder does not actually exist at the "App_Data/Sites/FakeTenant" path
"Test1": {
"VersionId": "4v0jtqy5xc08j7t2z6fw351zc4xxx",
"TenantId": "43nw8ze3xssp17hv7zbhbvx54xxxe",
"State": "Running"
},
// just copy this block to oc, this tenant does not actually exist
"FakeTenant": {
"VersionId": "48p76vxdrxkgnyjxxffq5cpdm4",
"TenantId": "4vpf12d9xq86rz5y0q6953pccm",
"RequestUrlPrefix": "TestInit",
"State": "Running"
},
(Please ignore the difference in the tenant name on my computer)
change the file target
log level to Debug
.
Then run the program and enable the 'OpenID Token Validation' module on tenant Test1
.
When you open the Token Validation page, you will see that it does not work properly.
2024-03-16 19:48:56.3071|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.ShellHost|DEBUG|Creating shell context for tenant 'FakeTenant'
2024-03-16 19:48:56.3071|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.Builders.ShellContextFactory|INFO|Creating shell context for tenant 'FakeTenant'
2024-03-16 19:48:56.3071|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.Builders.ShellContextFactory|DEBUG|Creating described context for tenant 'FakeTenant'
2024-03-16 19:48:56.3071|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.Builders.CompositionStrategy|DEBUG|Composing blueprint
2024-03-16 19:48:56.3071|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.Builders.CompositionStrategy|DEBUG|Done composing blueprint
2024-03-16 19:48:56.3178|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.Environment.Shell.ShellHost|DEBUG|Registering shell context for tenant 'FakeTenant'
2024-03-16 19:48:56.3448|Test1|00-b70f63553aaaf1aab54a58a0530ca134-1b40cf302ee7c007-00||OrchardCore.DisplayManagement.DisplayManager|ERROR|IDisplayDriver`1 thrown from OrchardCore.OpenId.Drivers.OpenIdValidationSettingsDisplayDriver by NullReferenceException System.NullReferenceException: Object reference not set to an instance of an object.
at OrchardCore.Data.Migration.DataMigrationManager.GetDataMigrationRecordAsync() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 64
at OrchardCore.Data.Migration.DataMigrationManager.GetFeaturesThatNeedUpdateAsync() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 78
at OrchardCore.Data.Migration.DataMigrationManager.UpdateAllFeaturesAsync() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Data.YesSql\Migration\DataMigrationManager.cs:line 334
at OrchardCore.Environment.Shell.Scope.ShellScope.<>c.<<ActivateShellInternalAsync>b__43_0>d.MoveNext() in D:\SourceCodes\JZSoft\EasyOC.OrchardCore\OrchardCore\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 325
I think it should be related to #15511 As I mentioned there: https://github.com/OrchardCMS/OrchardCore/issues/15511#issuecomment-1997298472
@hyzx86 thanks for providing the steps to reproduce the issue.
@sebastienros I do not think this is an issue we should care about. Here we are faking a running tenant in the tenants.json file where that tenant should not exists. When we try to build the site for this fake tenant, it failed to create ISession
instance since there is no database connection given.
I am going to remove the 1.9
milestone tag from this issue.
The e problem now is that we have to make sure that all tenants are connected to the database properly, otherwise any one wrong connection will cause strange problems for the other tenants.
Yes. But this isn't a new behavior we introduced. It's been that way for a long time. At the end of the day, if you don't mess up or manually edit the core files, you won't end up in this corrupt state.
In a multi-tenant scenario, if we expose a subtenant administrator to manage the tenant database, then if a user breaks the database, it will cause problems in other tenants' applications
This problem only exists in version 1.9.x and works fine in 1.8.x
Describe the bug
To Reproduce
Fist I need to clarify that , when I copy my site data to the OC source code project,then running this page without any problems, I would like to know if I have made some breaking changes recently, which causes me to need to adjust some of my code?
I've checked this document to make sure my code has made all the adjustments. https://github.com/OrchardCMS/OrchardCore/blob/main/src/docs/releases/1.9.0.md
My project is based on Nuget package of OC, everything was fine under 1.8 version, but after upgrading to 1.9, some strange phenomenon occurred.
First, there was a problem in the openid login process, when requesting tokens, the browser reported an error.
I tried to locate the problem, using the latest code of local OC package and copy the dll and pdb to my project, then start my project (Ctrl + F5), and then go to the source code of OC and click Append to process. When I opened the
Token Validation
menu, the debugger began to report an error.http://localhost:2919/salesportal/Admin/OrchardCore.OpenId/ValidationConfiguration/Index? admin=-571533867
At present, it seems that except for this page, other pages can be opened normally.
Expected behavior
The page should open normally
Screenshots
Warning session is empty, at line 56
The following is part of the log content