Sure have. It's an existing site, in the process of upgrading from 7.1.2. Need to check that it's not an issue on 7.1.2, but haven't had any of our users mention it.
I am having this same issue on 7.6.6. Preview works great once the page is published. I am using Umbraco as a multi-tenant headless CMS with Angular 2 ASP.NET core front ends. The front ends receive either IContent or IPublishedContent depending on whether one is previewing the site from Umbraco or not.
All pages in Umbraco use the same template. This single template's purpose is to get the root node of whatever content is being previewed to extract some site configuration properties which help in generating the URL for a IFrame. It works great. Umbraco is fantastic!
I can get Unpublished content from our extension project API in JSON, but in Umbraco, for example, umbraco/preview/?id=1475 (1475 being the unpublished node id) it returns 404.
Also I can see the content in the app_Data/preview folder config file.
Thank you very much. That was it. In the web.config the App Setting - "owin:appStartup" was using umbracoStandardOwinStartup. This class did not have the lines you provided above. I added them and now previewing unpublished content works perfectly.
This started to happen again in version 7.10.0. It appears to redirecting to a 404 error, but the underlying reason I am unable to determine.
Here is the content of the yellow .Net screen.
Any ideas?
Sequence contains no elements
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains no elements
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Previewing new/unpublished content
Is it possible to preview a node before it has been published? When I try to do so, the preview renders our 404 page.
Makes sense (to me, at least) that an editor should be able to preview a new page prior to publishing?
Site is on 7.4.2.
Hi
Have you saved the node first? If you save the node first the prewiev button should be showing and it should work.?
Hi Amalie
Yup, absolutely saved the node - no preview button until it's saved, but preview returns a 404 until the node has been published.
It's odd.
N
Have you assigned the node a template?
Sure have. It's an existing site, in the process of upgrading from 7.1.2. Need to check that it's not an issue on 7.1.2, but haven't had any of our users mention it.
I have this exact same issue in a Live environment.
Some unpublished docs under the same node are fine whilst others are not.
All I have to go on in the Logs is:
How do you go about debugging that?
I am having this same issue on 7.6.6. Preview works great once the page is published. I am using Umbraco as a multi-tenant headless CMS with Angular 2 ASP.NET core front ends. The front ends receive either IContent or IPublishedContent depending on whether one is previewing the site from Umbraco or not. All pages in Umbraco use the same template. This single template's purpose is to get the root node of whatever content is being previewed to extract some site configuration properties which help in generating the URL for a IFrame. It works great. Umbraco is fantastic!
I can get Unpublished content from our extension project API in JSON, but in Umbraco, for example, umbraco/preview/?id=1475 (1475 being the unpublished node id) it returns 404.
Also I can see the content in the app_Data/preview folder config file.
Are there any updates to this issue?
Hi Danny
Are you by any chance using a custom Owin startup class?
We resolved this by ensuring the Umbraco application was correctly configured for backoffice auth:
Hi Nathan,
Thank you very much. That was it. In the web.config the App Setting - "owin:appStartup" was using umbracoStandardOwinStartup. This class did not have the lines you provided above. I added them and now previewing unpublished content works perfectly.
This started to happen again in version 7.10.0. It appears to redirecting to a 404 error, but the underlying reason I am unable to determine.
Here is the content of the yellow .Net screen.
Any ideas?
Sequence contains no elements Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains no elements
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Sequence contains no elements] System.Linq.Enumerable.First(IEnumerable`1 source) +264 Umbraco.Core.Configuration.UmbracoSettings.ContentErrorsElement.getError404Collection() +85 Umbraco.Core.Configuration.UmbracoSettings.ContentElement.getError404Collection() +17 Umbraco.Web.Routing.ContentFinderByLegacy404.TryFindContent(PublishedContentRequest pcr) +467 Umbraco.Web.Routing.ContentLastChanceFinderByNotFoundHandlers.HandlePageNotFound(PublishedContentRequest docRequest) +424 Umbraco.Web.Routing.ContentLastChanceFinderByNotFoundHandlers.TryFindContent(PublishedContentRequest docRequest) +10 Umbraco.Web.Routing.PublishedContentRequestEngine.HandlePublishedContent() +592 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContentAndTemplate() +283 Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +107 Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +379 Umbraco.Web.UmbracoModule.
I followed the comments provided in - https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs //Ensure owin is configured for Umbraco back office authentication. If you have any front-end OWIN // cookie configuration, this must be declared after it.
//set up the token first app.UseUmbracoBackOfficeTokenAuth();
//then configure the service app .UseUmbracoBackOfficeCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) .UseUmbracoBackOfficeExternalCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) .UseUmbracoPreviewAuthentication(ApplicationContext, PipelineStage.Authorize) .FinalizeMiddlewareConfiguration();
is working on a reply...