Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bohdan 4 posts 75 karma points
    Mar 11, 2016 @ 15:31
    Bohdan
    0

    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?

    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)
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 14, 2016 @ 06:21
    Jan Skovgaard
    0

    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

  • Bohdan 4 posts 75 karma points
    Mar 14, 2016 @ 09:54
    Bohdan
    0

    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.

  • Tim 174 posts 398 karma points
    Jul 01, 2016 @ 11:29
    Tim
    0

    Did you get to the bottom of this? We've got the same issue after migrating the entire site to Azure.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 01, 2016 @ 11:50
    Dennis Aaen
    0

    Hi Tim,

    Which version of Umbraco are you running, and also which version of Umbraco Forms.

    Best,

    /Dennis

  • Tim 174 posts 398 karma points
    Jul 01, 2016 @ 11:56
    Tim
    0

    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

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 04, 2016 @ 07:54
    Warren Buckley
    0

    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,

  • Tim 174 posts 398 karma points
    Jul 04, 2016 @ 08:02
    Tim
    0

    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:

    )]}', {Message: "An error has occurred."}
        Message:"An error has occurred."
    
  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 04, 2016 @ 08:24
    Warren Buckley
    0

    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

  • Tim 174 posts 398 karma points
    Jul 04, 2016 @ 08:29
    Tim
    0

    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.

      <root>
        <priority value="Debug"/>
        <appender-ref ref="AsynchronousLog4NetAppender" />
      </root>
    
      <appender name="rollingFile" type="log4net.Appender.RollingFileAppender">
        <file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.%property{log4net:HostName}.txt" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
        <appendToFile value="true" />
        <rollingStyle value="Date" />
        <maximumFileSize value="5MB" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value=" %date [P%property{processId}/D%property{appDomainId}/T%thread] %-5level %logger - %message%newline" />
        </layout>
        <encoding value="utf-8" />
      </appender>
    
      <appender name="AsynchronousLog4NetAppender" type="Umbraco.Core.Logging.ParallelForwardingAppender,Umbraco.Core">
        <appender-ref ref="rollingFile" />
      </appender>
    
      <!--Here you can change the way logging works for certain namespaces  -->
    
      <logger name="NHibernate">
        <level value="WARN" />
      </logger>
    
    
    </log4net>
    
  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Jul 06, 2016 @ 13:54
    Warren Buckley
    2

    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 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.

    Thanks,
    Warren :)

  • Tim 174 posts 398 karma points
    Jul 06, 2016 @ 13:49
    Tim
    1

    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.

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Jul 06, 2016 @ 14:41
    Paul Wright (suedeapple)
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft