Data protection keys got vanished by cache keys when using `OrchardCore.Redis.DataProtection` together with `OrchardCore.Redis.Cache`
When using OrchardCore.Redis.DataProtection only:
When using OrchardCore.Redis.DataProtection together with OrchardCore.Redis.Cache:
Startup.cs
public class Startup
{
// Another code
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddHttpClient();
services.AddHsts(options =>
{
options.MaxAge = TimeSpan.FromDays(365);
options.IncludeSubDomains = true;
options.Preload = true;
});
services.Configure<CookiePolicyOptions>(options =>
{
options.Secure = CookieSecurePolicy.Always;
options.HttpOnly = HttpOnlyPolicy.Always;
options.MinimumSameSitePolicy = SameSiteMode.Lax;
});
var orchardBuilder = services.AddOrchardCms();
orchardBuilder
.AddSetupFeatures("OrchardCore.AutoSetup")
.AddTenantFeatures(
"OrchardCore.Redis",
"OrchardCore.Redis.Cache",
"OrchardCore.Redis.Lock",
"OrchardCore.Redis.DataProtection"
);
}
}
Dependencies
-
OrchardCore.Application.Cms.Targets3.0.0-preview-18841 -
OrchardCore.Redis3.0.0-preview-18841
Please elaborate when this vanishing happens.
Also, have you enabled Redis persistence? (on your redis server)
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).
This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.
Please elaborate when this vanishing happens.
When using OrchardCore.Redis.DataProtection alone:
- Running new mssql & redis using docker compose
- Restore bak file to mssql (containing dump from latest saved content from production)
- Restore assets to s3
- Running orchard core cms with auto setup in it
- Checking redis, nothing saved yet
- Visiting orchard core cms on
http://localhost:8080 - Response 404
- Checking redis, now it's have 1 key containing dataprotection key (see first screenshot on original comment)
When using OrchardCore.Redis.DataProtection & OrchardCore.Redis.Cache:
- Running new mssql & redis using docker compose
- Restore bak file to mssql (containing dump from latest saved content from production)
- Restore assets to s3
- Running orchard core cms with auto setup in it
- Checking redis, nothing saved yet
- Visiting orchard core cms on
http://localhost:8080 - Response 404
- Checking redis, now it's full with orchard caches, no dataprotection key saved (see second screenshot on original comment)
Both are tested from empty volumes. So no states/caches are related between each others.
Let see if i can make this one reproducible through public repo example.
Thanks.
Also, have you enabled Redis persistence? (on your redis server)
No. But as long as the redis container doesn't restarted, it must be there i think unless something delete it.
Without OrchardCore.Redis.Cache installed using AddSetupFeatures, the dataprotection cache is still there no matter i visited the web many times.
Thank you! It seems to me that it's not necessarily that the DataProtection keys vanish, but they maybe aren't created in the first place when OrchardCore.Redis.Cache is enabled.
I checked out the code but nothing struck me as able to cause the behavior you're seeing.
Do you see any errors in the log?
Just to confirm, getting a 404 response on step 7 is expected, right?