Pagebuilder issues after installing latest service pack

Chris Knapik asked on July 5, 2019 15:11

After installing the latest service pack (12.0.29), pagebuilder has started throwing a "An error has occurred. If the problem persists, contact your system administrator." error. When I look into Chromes network inspector, I find the following error for each call to one of the widget zones:

Error reading JObject from JsonReader. Path '', line 0, position 0.

And here is the stack trace (identical for each section call)

[JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.]
   Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings) +373
   Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings) +103
   Kentico.PageBuilder.Web.Mvc.PageBuilderPostDataRetriever`1.GetDataFromBody() +99

[InvalidOperationException: Incorrect data format is retrieved.]
   Kentico.PageBuilder.Web.Mvc.PageBuilderPostDataRetriever`1.GetDataFromBody() +303
   Kentico.PageBuilder.Web.Mvc.PageBuilderPostDataRetriever`1.GetOrCreateFromContext() +138
   Kentico.PageBuilder.Web.Mvc.PageBuilderPostDataRetriever`1.Retrieve() +36
   Kentico.PageBuilder.Web.Mvc.PageBuilderFeature.TryGetFromPostData() +26
   Kentico.PageBuilder.Web.Mvc.PageBuilderFeature.get_PageIdentifier() +28
   Kentico.PageBuilder.Web.Mvc.PageBuilderFeature.get_DataContext() +28
   Kentico.PageBuilder.Web.Mvc.HtmlHelperExtensions.WidgetZone(ExtensionPoint`1 instance) +114
   ASP._Page_Views_Shared_Sections__SingleColumnSection_cshtml.Execute() in C:\Website\Views\Shared\Sections\_SingleColumnSection.cshtml:5
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +91
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +32
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +46
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +431
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158

There are no signs of a CORS issue, I have builder.UseResourceSharingWithAdministration() in the Registerfeatures method of ApplicationConfig, and have tried restarting the site/server multiple times. Event log also doesn't report any extra details when the error comes up. Any other suggestions to help remedy the issue?

Correct Answer

Juraj Ondrus answered on July 8, 2019 13:24

So, you are not able to create new pages, right?
If yes, then this occurs usually when administration runs on different domain than MVC project and:

a) New page template selector is used (when page type has checked Show Page tab setting): in such case it is necessary to turn on the UseResourceSharingWithAdministration() feature in ApplicationConfig:

public class ApplicationConfig
{
public static void RegisterFeatures(IApplicationBuilder builder)
{
...
builder.UseResourceSharingWithAdministration();
...
}
}  

b) The web.config was modified and IIS hijacks CORS Preflight OPTIONS request. You need to check web.config handlers section, it must contain this specific entries:

<handlers>
...
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
...
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
...
</handlers>
0 votesVote for this answer Unmark Correct answer

Recent Answers


Chris Knapik answered on July 8, 2019 14:59

Thanks Juraj, that seems to have helped get the widget windows to appear again, but am now running into a bit of a different issue with the builder js. I need to do some investigation, but if I continue to have issues, I will start a different thread with all the info.

Thanks again.

1 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 8, 2019 15:16

Great to hear there is a progress. Also, make sure you have updated all the files and NuGet Packages. Maybe some scripts and styles in the Boilerplate/Kentico folder are probably from older version.
You can try installing a fresh Kentico 12.0.29 instance and copy the scripts over to your project, clear all the cache...to see if it helps.

0 votesVote for this answer Mark as a Correct answer

Chris Knapik answered on July 8, 2019 16:06

Installed a fresh copy of DancingGoatMVC locally, and copied over the Kentico/Content and Scripts folders, and refreshed the nuget packages to the specific version for 12.0.29. However, I seem to still have issues. More specifically, its whenever I would click the + button to add a new widget or section. The popup window never comes up, and I get the following error in my console:

builder.js:1 Uncaught TypeError: Cannot read property 'left' of null
    at u (builder.js:1)
    at t.getPosition (builder.js:1)
    at a.t.onOpenComponentList (builder.js:1)
    at e (vendors.js:12)
    at HTMLElement.t._withTask.t._withTask (vendors.js:12)
    at Object.i.Ft (components.core.js:6)
    at Object.e.emit [as y] (components.core.js:6)
    at Object.emit (components.core.js:6)
    at HTMLAnchorElement.openComponentListHandler (kentico-add-component-button.js:2)

I have tried deleting any/all custom js scripts that would appear on the page, but to no avail thus far. Any tips on what to look for would be greatly appreciated.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 9, 2019 10:41

This is strange. It looks like that something else was not upgraded/updated. Have you used the hotfix tool or manually copied the files over? Is it possible for you to restore the backups and apply the service pack again? If not, please submit a ticket to support@kentico.com and refer to this thread - we will need to get the project and DB backups from you.

0 votesVote for this answer Mark as a Correct answer

Chris Knapik answered on July 9, 2019 15:18

I did restore off a backup, and updated again. That seemed to help get things back to normal currently. Thanks again for the help.

0 votesVote for this answer Mark as a Correct answer

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