Troubleshooting Sitecore 9 Analytics and Forms

For this project, our goal was to implement simple Sitecore 9 forms that would create new profiles and trigger the goal on submission.  Unfortunately, this post is not an instruction on how to do that! What we’ll talk about today is the list of issues we found and how to troubleshoot Sitecore 9 Analytics and Forms.  We documented our progress until we figured it all out. Hopefully, this will help you on your journey too!

Issue 1: Database is being recovered. Waiting until recovery is finished.

Starting the website locally would crash with a YSOD and error “Database is being recovered. Waiting until recovery is finished.”

The Solution?

  • Check to see if SQL service is running
  • If SQL service is running, check to see if your database is set to auto-close. When AUTO CLOSE option is set to true, SQL Server Database Engine will close the user database after its use. The database will be turned ON the next time  someone wants to access the database.

sql auto close

Issue 2: Error when rebuilding reporting database

There are several things that could cause an issue when rebuilding a reporting database. You need to make sure that your Sitecore license supports xconnect, that your Solr service is running and that Solr is connecting through https. If ALL of that is correct, you can navigate command prompt to yoursite.xconnect\App_data\jobs\continuous\IndexWorker and run this command “XConnectSearchIndexer -rr

This was the error we were getting:

XConnectSearchIndexer -rr
Requesting rebuild.

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> 
System.Net.Http.HttpRequestException: An error occurred while sending the request. --->
System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine...
...

The Solution?

Check your Solr version and Sitecore compatibility table.  Upgrading Solr from 6.6.1 to 6.6.2 resolved this issue.

Issue 3: Individual experience profiles are all showing that an error has occurred

sitecore error occured

This message doesn’t give you much information, so you need to search through the Sitecore logs.

We found this error in our logs:

7520 2018:08:20 12:54:57 ERROR [Sitecore Services]: HTTP GET
URL http://*****/sitecore/api/ao/v1/contacts/search?&pageSize=20&pageNumber=1&sort=visitCount desc&match=*&searchfromdatefilter=21%2F07%2F2018&searchtodatefilter=20%2F08%2F2018&searchchannelfilters=null&searchcampaignfilters=null&searchoutcomefilters=null&searchgoalfilters=null&searchprofilefilters=null&searchdevicefilters=null

Exception System.NullReferenceException: Object reference not set to an instance of an object.
   at Sitecore.Cintel.Endpoint.Plumbing.NegotiateLanguageFilter.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
   at System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
 ...

The Solution?

We revisited our profiles implementation and found out that we didn’t have any pattern cards.  Creating a default pattern card item resolved the issue.

Issue 4:  Where are my forms? “There are no forms to display” in Forms designer

You created a new Sitecore form, saved it and published. However, if you reload Forms Designer the form is gone –  and there is a message that says “There are no forms to display”.

The Solution?

Rebuild the master index and check again.

 

Issue 5: Where did my data go? The default submit button saved data to a csv file and you need them in your contacts (or somewhere else)

If you created a form with default submit button your data will be saved in a csv file and you can export them from Forms designer.  This is expected and it works without issues. However, if you need those data somewhere else you will need to implement custom submit action.

The Solution?

Sitecore provides a detailed walk-through document if you need custom submit action that updates contact details  and walk-through document to create custom action.

Issue 6:  Custom submit action doesn’t work

The Solution?

To create a custom submit action, you need to inherit SubmitActionBase class and overwrite Execute forms.

It is important which order you put submit actions on your form. So if you put custom action after redirect page action, the custom action will never execute.

If your custom action always returns error message you need to revisit your code.

If you used a string as type parameter in SubmitActionBase, like this


public class CustomSubmit : SubmitActionBase<string>

Then you need to overwrite TryParse method as well


protected override bool TryParse(string value, out string target)
	{
		target = string.Empty;
		return true;
	}

TryParse executes before Execute method and if the value is empty it will return false and skip Execute method. More details about this issue you can find on João Neto’s blog

Issue 7: Sitecore Rocks cannot connect to Sitecore 9 instance

Sitecore rocks cannot overwrite Sitecore 9 security settings. This is a known issue and documented here https://github.com/JakobChristensen/Sitecore.Rocks/issues/68

The Solution?

Edit Web.config and authorize all users to access WebService:


<location path="sitecore/shell/WebService">
    <system.web>
        <authorization>
            <allow users="?,*" />
        </authorization>
    </system.web>
</location>

Issue 8: Cannot add new Speak item in Sitecore rocks

Add new dialog is stuck on loading.

speak dialog

The Solution?

Right Click on your Connection, then click to Connections/Modify Connection and select Hard Rock Web Service as Data Provider. Click OK.

Issue 9: Javascript console error when opening custom Speak Dialog

If your custom Speak component is causing JavaScript errors like peak.component and speak.pageCode undefined errors in the console, then you need to make sure you are using the correct version of Speak.

The Solution?

Go back to your code, with Sitecore rocks edit your custom dialog (right click/ tasks/design layout) and find PageCode component. Set  SpeakCoreVersion property to SPEAK 2-x

speak version property

I hope this list is helpful for you and speeds up your development. Happy coding!

Marijana Omorac

I have a Bachelor’s Degree in Computer Science Engineering and became a Sitecore Certified Developer in 2013. My main areas of expertise are in consulting and software development. I love development work. Taking a client’s specifications and translating them into code is especially rewarding. When I am not working on Sitecore projects, I am doing DevOps. In my free time, I like to travel and read.

More posts from Marijana Omorac >

Add a Comment

Your email address will not be published. Required fields are marked *

Or request call back