0

We are using Sitecore 8.2 Update 4 and WFFM 170518.

We have created a WFFM save action to take input from our website users and send that information to a downstream system. Last week, the downstream system went down and we didn't know about it. Once we discovered the problem, we were able to get the downstream system back up. However, during our testing we discovered that the form being displayed was not displaying any kind of notification that the submission failed. When I looked at the logs, I saw messages like this:

ManagedPoolThread #14 05:51:31 WARN  [WFFM] Tracker.Current  is not initialized
ManagedPoolThread #14 05:51:31 INFO  AUDIT (sitecore\Anonymous): [WFFM] Form {5821FCAF-7D01-4E90-AEFB-064C4C62E497} is saving to db
ManagedPoolThread #14 05:51:31 WARN  [WFFM] Tracker.Current.Contact  is not initialized
ManagedPoolThread #14 05:51:31 WARN  [WFFM]  Tracker.Current.Interaction  is not initialized
ManagedPoolThread #14 05:51:31 WARN  [WFFM] CurrentSession  is not initialized
ManagedPoolThread #14 05:51:31 WARN  [WFFM] The remote server returned an error: (404) Not Found.
Exception: System.Net.WebException
Message: The remote server returned an error: (404) Not Found.
Source: System
   at System.Net.HttpWebRequest.GetResponse()

However, there was no mention of a message being shown to the website visitor. When I replicated the issue in my developer environment, I got a message telling me that an error message had been displayed.

24024 16:19:58 WARN  [WFFM] The remote server returned an error: (404) Not Found.
Exception: System.Net.WebException
Message: The remote server returned an error: (404) Not Found.
Source: System
   at System.Net.HttpWebRequest.GetResponse()
   ...

24024 16:19:58 WARN  [WFFM] The 'My Contact Form Export to SE[id={9AA6767D-60CD-4358-AE36-0A8121A22DC7F}]' save action failed: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.
24024 16:19:58 WARN  [WFFM] Web Forms for Marketers: an exception: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved. has occured while trying to execute an action.
24024 16:19:58 WARN  Web Forms for Marketers: an exception 'We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.' has occured while trying to execute an action '{9AA6767D-60CD-4358-AE36-0A8121A22D7F}'.

The save action code doesn't have any error handling in it on purpose, so that way the errors would bubble up to the WFFM error handler. We are running the same code in both our Production environment as well as the development environment.

My questions are:

  1. What would cause WFFM to not notify the end user that an error had happened?
  2. What could be different between the production and the development environments that would cause that difference?
3

The WFFM module processes Save Actions differently, depending on the settings, which means that they are processed in an async or synchronous manner. This is the expected behaviour.

It might not seem obvious, but I previously provided this answer which contains all the details that you need and explains in a fair amount of detail what is going on and why.

  1. The reason the user was not notified is because the Save Action was not marked as a Client Action, which means that it was actually run on the CM Server (passed via the Event Queue). When the user submits the form, the data is serialised in the Event Queue and later picked up by the CM server for processing. Any errors would be logged in the CM server, and since processing is done by a different server (so effectively async) the user is never notified of the error.

To force a specific Save Action to run synchronously ensure the Client Action field is checked. This will force the Save Action to run one after another and any errors will force the error message to be shown to the users.

WFFM Client Action

  1. The difference between Production and Development is the configuration. Assuming you have followed the installation guide correctly, in particular section "1.2.2 Configuring the CD server", one of the steps listed is:

In the \Website\App_Config\Include\Sitecore.Forms.Config file,

  • Add the following node to the section: <setting name="WFM.IsRemoteActions" value="true" />

With this setting enabled, any Save Action which does not have Client Action checked will run on the CM instance as mentioned earlier. On your development environment this setting will be false (the default value) and so all Save Actions will run in a synchronous manner, therefore the error being returned to the user.

1
  • That sure would be a nice side-effect for the documentation to mention. It makes total sense now that you brought that to my attention. Super helpful! – Keith VanderVeen Apr 5 '18 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.