Sitecore/docker-images

Sitecore form data does not save (SQL error)

moo2u2 opened this issue · 0 comments

ISSUE

Sitecore forms fails to save data upon form submission (from both CM + CD servers).
See https://stackoverflow.com/a/45794450/910971 for a fix (why it works appears to be unknown).

  • I have tried with the latest version of Docker for Windows (Stable or Edge) or Docker Enterprise.
  • Windows version is at least 1809 / ltsc2019.
  • Windows has the latest updates installed.

Expected behavior

Form data saves to the Sitecore.Experienceforms database, at least populating a row in the sitecore_forms_storage.FormEntries table. Browser redirects to success page.

Actual behavior

Form submits, redirects to success page. No data is saved, however.
Sitecore logs the error:

2984 15:10:02 ERROR [Experience Forms]: Forms database communication error.
Exception: System.Data.SqlClient.SqlException
Message: Could not obtain information about Windows NT group/user 'User Manager\ContainerAdministrator', error code 0xffff0001.
Source: .Net SqlClient Data Provider
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at Sitecore.ExperienceForms.Data.SqlServer.Commands.BaseCommand`1.<>c__DisplayClass12_1.<Execute>b__0()
   at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
   at Sitecore.ExperienceForms.Data.SqlServer.Commands.BaseCommand`1.Execute()

Additional information

Issue is reproducible.
I have only tested on the 9.3.0 XM + JSS image for the moment, as that is what I was using for the current project.

  • Output from docker info:
Client:
 Debug Mode: false

Server:
 Containers: 4
  Running: 4
  Paused: 0
  Stopped: 0
 Images: 150
 Server Version: 19.03.8
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 19042 (19041.1.amd64fre.vb_release.191206-1406)
 Operating System: Windows 10 Enterprise Version 2009 (OS Build 19042.388)
 OSType: windows
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.93GiB
 Name: XXXXXX
 ID: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
 Docker Root Dir: F:\Docker
 Debug Mode: true
  File Descriptors: -1
  Goroutines: 68
  System Time: 2020-07-21T15:23:46.9034049+10:00
  EventsListeners: 1
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine
  • Are you running inside a virtualized Windows machine or physical:
  • Physical

Steps to reproduce the behavior

  1. Run .\Build.ps1 -SitecoreVersion "9.3.0" -Topology "xm" -OSVersion "2004" -IncludeJss -IsolationModeBehaviour ForceProcess
  2. Add src folder containing simple MVC cshtml layout files FormsTestSrc.zip (eg. data\src_formtest) from Sitecore documentation
  3. Add volume to 'cm' and 'cd' in docker-compose.xml.jss.yml to be able to view logs, and a volume to add cshtml files
volumes:
      - .\data\cd:C:\inetpub\wwwroot\App_Data\logs
      - .\data\src_formtest:c:\src
  1. Run docker-compose -f docker-compose.xm.jss.yml up -d
  2. Log in to Sitecore and create a simple form (single text box and submit button) with save actions: save data, redirect to page.
    a) Alternatively use DockerFormsTest-1.0.zip
  3. Add form to a page as per Sitecore documentation (remove Analytics references and VisitorIdentification if testing on XM)
    a) Alternatively DockerFormsTest-1.0.zip also includes this on the homepage
  4. Publish everything
  5. Open page with form on CD server (or preview mode on CM server)
  6. Enter text into field and click submit
  7. View logs to see error, view SQL database to see no data saved
  8. Use SSMS to connect to SQL using SA
  9. Right click Sitecore.Experienceforms, select Properties -> Files
  10. Change 'Owner' field to 'sa'
  11. Repeat steps 7-9, however data is now saved and no error in the logs