RankOne-Umbraco-SEO-Tool icon indicating copy to clipboard operation
RankOne-Umbraco-SEO-Tool copied to clipboard

RankOne AnalyzeNode Exception

Open kristoffer-tvera opened this issue 7 years ago • 3 comments

My logs are getting semi frequent additions of this Error:

System.InvalidOperationException: Cannot render a macro when there is no current PublishedContentRequest. at Umbraco.Web.UmbracoComponentRenderer.RenderMacro(String alias, IDictionary'2 parameters) at Umbraco.Web.PropertyEditors.ValueConverters.MacroContainerValueConverter.<>c__DisplayClass1_1.<RenderMacros>b__1(String macroAlias, Dictionary'2 macroAttributes) at Umbraco.Core.Macros.MacroTagParser.ParseMacros(String text, Action'1 textFoundCallback, Action'2 macroFoundCallback) at Umbraco.Web.PropertyEditors.ValueConverters.MacroContainerValueConverter.RenderMacros(String source, Boolean preview) at Umbraco.Web.PropertyEditors.ValueConverters.MacroContainerValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview) at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value() at RankOne.Helpers.FocusKeywordHelper.FindFocusKeywordInDashboardProperties(IPublishedContent node) at RankOne.Helpers.FocusKeywordHelper.GetFocusKeyword(IPublishedContent node) at RankOne.Services.AnalyzeService.CreateAnalysis(IPublishedContent node, String focusKeyword) at RankOne.Controllers.AnalysisApiController.AnalyzeNode(Int32 id, String focusKeyword)

Do you have any idea at what is causing this? A macro I assume, but how do I find which one is responsible? If you could point me in the right direction of debugging this, that would be helpful. I dont know if this is an issue on my end, or the plugin, but regardless, I would like to find a solution.

kristoffer-tvera avatar Oct 23 '17 13:10 kristoffer-tvera

This is something I haven't seen before. Have you used views of rankone within one of your macro's?

markwemekamp avatar Oct 30 '17 09:10 markwemekamp

I'm not currently using any RankOne data-types within any views, macros, or partials.

The way I'm using RankOne, is that I have made two datatypes, one for the preview, and another for the dashboard. I then add those two datatypes onto a document-type that I use as a composite on pretty much any published item (this doc includes some basic SEO stuff, like description, img, etc).

The exception is triggered in the backoffice when I visit the tab for the two RankOne datatypes. Removing the Dashboard datatype from the tab will resolve this, but then again I wont get the analysis of my pages.

Not all pages will throw this exception, but the bigger ones (with grid, nested, macros, custom datatypes) will.

I'm using Umbraco 7.7.3.

Are errors logged anywhere when these kind of exceptions occur?

kristoffer-tvera avatar Oct 30 '17 10:10 kristoffer-tvera

The errors should be logged to the Umbraco log files, located in App_data/Logs

Can you check if you comment the macros on the failing pages if the problem still occurs? I've looked a bit at the code of the failing method (FindFocusKeywordInDashboardProperties) but I don't see any weird things there

markwemekamp avatar Oct 30 '17 13:10 markwemekamp