When I use macro "Insert form" on local dev pc it works fine. But when I'm trying do same in azure cloud(website for backoffice and azure service with 2 instances for usersites) i get into trouble when I try to view result. I'm using Umbraco v7.4.1 and UmbracoForms v4.1.5. We checked both form guid which is generated at backoffice side and guid which is passed to InsertUmbracoForm.cshtml and figured out they are identical. Please advice how can I fix it?
2016-03-11 13:54:53,407 [P3972/D2/T47] WARN umbraco.macro - Error loading partial view macro (View: ~/Views/MacroPartials/InsertUmbracoForm.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Forms.Mvc.Models.FormViewModel.Build(Form form) in f:\TeamCity\buildAgent\work\acce5a5136f4db35\Umbraco.Forms.Mvc\Models\FormViewModel.cs:line 78
at Umbraco.Forms.Web.Controllers.UmbracoFormsController.Render(Guid formId, Int32 recordId, String view, String mode) in f:\TeamCity\buildAgent\work\acce5a5136f4db35\Umbraco.Forms.Mvc\Controllers\UmbracoFormsController.cs:line 62
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues)
at ASP._Page_Views_MacroPartials_InsertUmbracoForm_cshtml.Execute() in f:\sitesroot\0\Views\MacroPartials\InsertUmbracoForm.cshtml:line 10
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Does the form you're trying insert actually exist on the live environment? If you have created the form locally but have not deployed the /App_Plugins/UmbracoForms folder then some files might be missing, which could be the reason of the error.
We've just upgraded and it would seem that the issue relates to permissions as GetWithWorkflowsByGuid is returning data (the correct data) but then GetByUserId?userId=0 is erroring 500-100
Hello Tim,
I am surprised that a 500 error being thrown with nothing being logged in the Umbraco log file on disk.
The GetByUserId is having problems with forms security permissions, can you please try browsing to the User section and then Forms Security tree to see if permissions can be set for user/s, specifically user 0, the admin user.
Can you ensure the Log4Net log level set to Debug so we can get all messages logged to the file, as you may have it set to a lower setting for now & thus it's not in the log file.
Anything unusual about the setup I need to know about?
Also does this happen on all environments or just a specific environment?
We got to the bottom of his problem that there were duplicate SQL records in the database for Forms Security.
We manually removed the conflicting SQL result in UFUserFormSecurity DB table. Where the user ID 0 & 8 both had entries where the Form column had duplicate GUIDs.
After doing this it rectified the problem. I have raised an issue to look into this problem to see one how a duplicate was created.
For anyone else who comes across this issue in the future, with the help of Warren and Tim Geyssens we found a few issues:
Firstly there were extra form records in the UFUserFormSecurity table that didn't have matching records in the ~/App_Plugins/UmbracoForms/Data/forms/ folder.
Secondly there were duplicate records in the UFUserFormSecurity table for a single user.
Deleting the extra records appears to have resolved the issue.
This seems to be a common occurance, as I've had problems with Umbraco Forms creating these kind dupe DB rows before. Not 100% sure what triggers it and when, but hopefully it'll be bottomed, and fix implemented.
Umbraco Forms error
Hello all,
When I use macro "Insert form" on local dev pc it works fine. But when I'm trying do same in azure cloud(website for backoffice and azure service with 2 instances for usersites) i get into trouble when I try to view result. I'm using Umbraco v7.4.1 and UmbracoForms v4.1.5. We checked both form guid which is generated at backoffice side and guid which is passed to InsertUmbracoForm.cshtml and figured out they are identical. Please advice how can I fix it?
Hi Bohdan and welcome to our :)
Does the form you're trying insert actually exist on the live environment? If you have created the form locally but have not deployed the /App_Plugins/UmbracoForms folder then some files might be missing, which could be the reason of the error.
/Jan
Hi Jan,
The form i'm trying to insert is the same as local. The only difference is that it works local and throw an error in azure.
thanks, Bohdan.
Did you get to the bottom of this? We've got the same issue after migrating the entire site to Azure.
Hi Tim,
Which version of Umbraco are you running, and also which version of Umbraco Forms.
Best,
/Dennis
We've just upgraded and it would seem that the issue relates to permissions as GetWithWorkflowsByGuid is returning data (the correct data) but then GetByUserId?userId=0 is erroring 500-100
Nothing in the logs frustratingly
Hello Tim,
I am surprised that a 500 error being thrown with nothing being logged in the Umbraco log file on disk.
The GetByUserId is having problems with forms security permissions, can you please try browsing to the User section and then Forms Security tree to see if permissions can be set for user/s, specifically user 0, the admin user.
Thanks,
I can't edit the permissions of UserId 0 or 8 (the two that have the issue) it throws the same error. There's nothing in the logs.
UserId 8 has permissions in the Umbraco Forms table but User Id doesn't so it's not that their record is just missing.
Response from call is just:
Can you ensure the Log4Net log level set to Debug so we can get all messages logged to the file, as you may have it set to a lower setting for now & thus it's not in the log file.
Anything unusual about the setup I need to know about?
Also does this happen on all environments or just a specific environment?
Thanks,
Warren
As mentioned in Slack I already have :)
This is happening on the DEV and LIVE versions of the site which are clones of each other and auto-sync'd.
After talking with Tim directly.
We got to the bottom of his problem that there were duplicate SQL records in the database for Forms Security.
We manually removed the conflicting SQL result in
UFUserFormSecurity
DB table. Where the user ID 0 & 8 both had entries where theForm
column had duplicate GUIDs.After doing this it rectified the problem. I have raised an issue to look into this problem to see one how a duplicate was created.
Thanks,
Warren :)
For anyone else who comes across this issue in the future, with the help of Warren and Tim Geyssens we found a few issues:
Firstly there were extra form records in the UFUserFormSecurity table that didn't have matching records in the ~/App_Plugins/UmbracoForms/Data/forms/ folder.
Secondly there were duplicate records in the UFUserFormSecurity table for a single user.
Deleting the extra records appears to have resolved the issue.
This seems to be a common occurance, as I've had problems with Umbraco Forms creating these kind dupe DB rows before. Not 100% sure what triggers it and when, but hopefully it'll be bottomed, and fix implemented.
is working on a reply...