Copied to clipboard

Flag this post as spam?

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


  • Will 3 posts 74 karma points
    May 15, 2020 @ 20:10
    Will
    1

    Umbraco Forms Prevalue Sources not copied across load balancer

    We're using Umbraco Forms (7.0.3) on two servers connected in a standard flex load balancing scenario. However, when adding new txt files as the prevalue source for form options, the txt file is not duplicated on the second server.

    This causes the error when viewing the form on this (secondary) server:

    System.Web.HttpException (0x80004005): Error executing child request 
    for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> 
    System.Exception: Exception while creating a value. ---> System.IO.DirectoryNotFoundException: 
    Could not find a part of the path
    'D:\home\site\wwwroot\App_Data\UmbracoForms\Data\PreValueTextFiles\e514b6e6-1d41-415e-aa02-eea5d7007565\formoptionstest.txt'.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
    at Umbraco.Core.IO.PhysicalFileSystem.OpenFile(String path)
    at Umbraco.Forms.Core.Data.PrevalueSourceStorage.PreValueTextFileStorage.GetTextFilePreValues(String filePath)
    at Umbraco.Forms.Core.Providers.Prevalues.GetValuesFromTextFile.GetPreValues(Field field, Form form)
    at Umbraco.Forms.Mvc.Models.FormViewModel.<>c__DisplayClassc.<FetchPrevalues>b__8()
    at Umbraco.Forms.Core.Cache.CacheProviderExtensions.<>c__DisplayClass9`1.<GetCacheItem>b__8()
    at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
    --- End of inner exception stack trace ---
    

    To reproduce, create a new prevalue source on the primary server: enter image description here

    Save and used this prevalue as the source for a dropdown field in a form: enter image description here

    Then you can see on BOTH SERVERS the prevalue JSON is created in: App_Data/UmbracoForms/Data/prevaluesources:

    {
      "id": "b91ec860-8216-4ce8-ab3f-b26424dad2b3",
      "name": "This is a test",
      "settings": {
        "TextFile": "PreValueTextFiles/e514b6e6-1d41-415e-aa02-eea5d7007565/formoptionstest.txt"
      },
      "fieldPreValueSourceTypeId": "35c2053e-cbf7-4793-b27c-6e97b7671a2d"
    }
    

    But the actual txt file the holds the option values only appears on the primary server at: App_Data/UmbracoForms/Data/PreValueTextFiles/e514b6e6-1d41-415e-aa02-eea5d7007565/formoptionstest.txt enter image description here

    Does anyone have any ideas about this or has encountered anything similar? I've tried looking in the later 7.* releases but can't see any relevant bug fixes. Thanks in advance!

Please Sign in or register to post replies

Write your reply to:

Draft