2sxc icon indicating copy to clipboard operation
2sxc copied to clipboard

Code editor error when going to edit template

Open ajplopez opened this issue 2 years ago • 5 comments

I'm submitting a ... [x] bug report => search github for a similar issue before submitting

...about [x] template editor

Current behavior

When I got to edit any template, I get the following alert error:

Had an error talking to the server (status 500). Message: An error has occurred. Detail: The 'ObjectContent'1' type failed to serialize the response body for content type 'application/json; charset=utf-8'. if you are an advanced user you can learn more about what went wrong - discover how on 2sxc.org/help?tag=debug

Expected behavior To be able to edit templates in the editor.

Instructions to Reproduce the Problem Click on "Edit template"

Why change the behavior? Bug

Your environment Shared hosting

  • 2sxc version(s): 14.07.04 (was also the same error in 14.03.00
  • Browser: [all ]
  • DNN: [9.10.2 ]
  • Language: [any/all ]

Anything you would like to add

This is a site that uses Patrons features. I have DNN Minification and Composite files disabled. I have incremented the CDF version, cleared cache, and restarted the application but still have the same issue where I can't edit the templates.

ajplopez avatar Jul 18 '22 17:07 ajplopez

I can confirm this, a recently install DNN 9.10.02 with 2sxc 14.7.4 image

jeremy-farrance avatar Jul 28 '22 02:07 jeremy-farrance

I can't reproduce this issues and need more info.

Editor is calling several endpoints. One (or more) is throwing this exception. Probably .../api/2sxc/admin/AppFiles/AppFiles?appId=.... I need more info about this exceptions from request and 2sxc insights.

From your issue, it looks that for some reason endpoint can not serialize response to json, so the goal is to find if that is 2sxc bug that we can fix, or it is related to iis configuration, security, something else...

Please can You (after this exception happens in your editor):

  1. open dev tools, Network tab
  2. filter Fetch/XHR (check there is one or more requests that returns status: 500, but first F5 reload if you do not see requests)
  3. Export HAR file (add .ZIP extension to HAR file and drop it here for upload)

image

Also please can you check 2sxc insights: log web-api, find request that throw exception and copy also its long content here. image

tvatavuk avatar Aug 03 '22 11:08 tvatavuk

Thanks Tonci. Here is the info you requested:

Screen Shot 2022-08-03 at 10 04 57 AM

Screen Shot 2022-08-03 at 10 06 20 AM

Screen Shot 2022-08-03 at 10 06 48 AM

website.com.har.zip

Screen Shot 2022-08-03 at 10 17 06 AM

Hope this helps

ajplopez avatar Aug 03 '22 17:08 ajplopez

I was able to create the problem that Aaron has reported by doing the following:

  1. Created new DNN v9.10.2 website with 2sxc v.14.07.04 LTS and all associated Apps and Content (Content v14.7.0).
  2. Created a page with an "Image | Text template". Added a photo and text:

Screenshot 2022-08-06 132720

  1. Clicked on the "<>" to go into edit mode and get the following error:

Screenshot 2022-08-06 132449

skarpik avatar Aug 06 '22 17:08 skarpik

Thanks @ajplopez , @jeremy-farrance and @skarpik 👍👍👍. Obviously this issue affects many users and it breaks editor UI.

It looks that you are getting exception in new api/2sxc/admin/Code/InlineHelp endpoint, that is WIP. Unfortunately I am still not able to reproduce it in my dev and test environments.

So, I updated endpoint code to be more resilient on json serialization and other exceptions. Also added more logging to 2sxc insights for this webapi endpoint. Primary intention is to handle exception on server instead of bubble it to client UI.

Lets wait for next 2sxc release so you can see if this is enough.

tvatavuk avatar Aug 08 '22 12:08 tvatavuk

I've made a pre-release of 14.07.05 https://github.com/2sic/2sxc/releases/tag/v14.07.05-pre1

Could you test it here to see if the issue persists? my guess is it's gone, but as we were not able to reproduce it, we cannot verify it ourselves.

iJungleboy avatar Aug 17 '22 10:08 iJungleboy

@iJungleboy I just upgraded to 14.07.05 and it seems to be resolved.

ajplopez avatar Aug 17 '22 20:08 ajplopez

Awesome. In this case it was related to some context info regarding language/portal which caused some trouble in 14.7.04 like #2829

iJungleboy avatar Aug 18 '22 06:08 iJungleboy

Tested v14.07.05 on an en-ca and a bilingual en-ca/fr-ca website. Works perfectly. @iJungleboy thanks for resolving this issue (especially since you weren't able to replicate it yourself - those errors are the worst).

skarpik avatar Aug 22 '22 12:08 skarpik

Had this issue occur on 2 sites today, one was in version 11.x when i started but DNN 9.10.1 and the other was in DNN 9.3 - I am unsure if it was exact same problem but seemed to occur when apps were installed for a version of 2sxc, then upgraded 2sxc to a newer version where the apps were not utilizing the new features in 2sxc v.13 plus.

We will test this pre-release version tomorrow after restoring the site back to version 11 and trying again with upgrading to this pre-release.

For what it's worth. Don't know that this was particularly tied to a 2sxc version mentioned 14.07.04, as it was occurring in 3 versions moving up from 11.x to that version. Seems more tied to DNN 9.10.x then a 2sxc version in my testing.

dustinp26 avatar Sep 21 '22 00:09 dustinp26