Error when add new page template

Nguyen Anh asked on January 3, 2023 11:34

Hi, I have a problem when add new page(with template) into tree node, it throw message An error occurred while attempting to retrieve page templates. The live site application is not running or is not accessible. My live site still running but cant add new page with template. When I check DevTools, it show 2 requests error:

GetFiltered CORS error xhr

GetFiltered 404 prelight

Image


Here is detail of query:

http://localhost:25305/cmsctx/pv/6415b8ce-8072-4bcd-8e48-9d7178b826b7/culture/en-US/wg/c862f34c-325e-4f5e-9e6b-a6f4de0ad43e/readonly/0/h/54ca92ed444e9e933225a8d90030b5e21720769ee5573ee74ce14b883a44f945/-/Kentico.PageBuilder/PageTemplates/GetFiltered?uh=0e3e3c93f898d53a9a2dd9daeb228065a1ec1984820f96bbc9ebbcefb219d4bb&pagetype=InsightPage&culture=en-US

image


Thanks & Best regards

Recent Answers


Juraj Ondrus answered on January 4, 2023 06:45

What is set as the presentation URL in your admin app? Is it the right URL to the live site, front end app?

0 votesVote for this answer Mark as a Correct answer

Elmar Höfinghoff answered on January 6, 2023 09:21

Is your CMS running on HTTPS? If yes, run the MVC app on HTTPS, too. Which Kentico version do you use? When registering CORS you may could do something like this to avoid issues on dev instances.

if (Environment.IsDevelopment())
{
    // Allow every kind of origin, header or method while developing
    // CORS = cross origin requests.
    // see also: https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-5.0
    services.AddCors(options =>
    {
        options.AddDefaultPolicy(
            builder =>
            {
                builder
                    .AllowAnyOrigin()
                    .AllowAnyHeader()
                    .AllowAnyMethod();
            });
    });
}
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.