8

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
{
    //Identify the user
    Tracker.Current.Session.Identify(model.Email);

    //Get the contact
    var contact = Tracker.Current.Session.Contact;

    if (contact != null)
    {
        //Update contact
        SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
    }
    else
    {
        //Create contact
        Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
    }
}
catch (Exception exception)
{
    Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
}

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore /admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Sitecore version: 8.2 rev. 170614 (Update-4)

Did anyone experience this issue before?

5
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Richard Seal
    Nov 7, 2017 at 15:40
  • Have you solved the issue?
    – grg
    Nov 8, 2017 at 9:27
  • No, i have raised a support ticket with sitecore Nov 8, 2017 at 9:39
  • Did you heard anything from Sitecore on this? Dec 4, 2017 at 12:38
  • I am also facing the same issue. did you hear back anything from Sitecore with that support ticket? Jun 14, 2020 at 6:54

1 Answer 1

1

It mostly seems related to Null Session. If you have multiple CD servers, you should have shared session. Since you are using MongoDb, here is an article from Sitecore to configure Shared session with MongoDb provider. I would suggest to make changes on Live according to this and then check. It is not needed locally as we don't have multiple CDs there.

Shared session with MongoDb provider

  • You need a shared session database.
  • Then configure it on CD server to use it.
  • Also, if you are creating any custom object to store in session, do create is as serializable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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