6

When I open the Experience Profile tab on my Sitecore 9 dashboard, I get an error:

An error has occured! image

So naturally, I checked the logs and got the following error and stack trace:

>  24872 15:35:09 ERROR [Sitecore Services]: HTTP GET URL
> http://demo.site/sitecore/api/ao/v1/contacts/search?&pageSize=20&pageNumber=1&sort=visitCount
> desc&match=asdfasdsaf&searchfromdatefilter=01%2F06%2F2017&searchtodatefilter=09%2F11%2F2017&searchchannelfilters={"name":"CHANNEL_FILTERS"%2C"SearchItems":[{"ItemId":"F575D5E6-74DE-49B6-A866-E2256D213D83"}]}&searchcampaignfilters=null&searchoutcomefilters={"name":"OUTCOME_FILTERS"%2C"SearchItems":[{"ItemId":"062A1E69-0BF6-4D6D-AC4F-C11D0F7DC1E1"}]}&searchgoalfilters={"name":"GOAL_FILTERS"%2C"SearchItems":[{"ItemId":"0CB97A9F-CAFB-42A0-8BE1-89AB9AE32BD9"}]}&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 ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
>     --- End of stack trace from previous location where exception was thrown ---    at
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
> task)    at
> System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()

I found this post: https://www.brimit.com/blog/sitecore-9-experience-profile-workaround

But I believe, that is a different problem. Can anyone help me finding out, what is causing the error? I'm at a loss.

EDIT 1:

I decided to extend my post with some more info about my project:
I'm adding Contacts and Interactions to xConnect from a .NET Core application.
I have got a custom xConnect model.

EDIT 2:

Request header was requested so here it is:

GET /sitecore/api/ao/v1/contacts/search?&pageSize=20&pageNumber=%E2%80%8C%E2%80%8B1&sort=visitCount%20%E2%80%8C%E2%80%8Bdesc&match=*&searchf%E2%80%8C%E2%80%8Bromdatefilter=08%2F1%E2%80%8C%E2%80%8B0%2F2017&searchtodat%E2%80%8C%E2%80%8Befilter=09%2F11%2F20%E2%80%8C%E2%80%8B17&searchchannelfilt%E2%80%8C%E2%80%8Bers=null&searchcampa%E2%80%8C%E2%80%8Bignfilters=null&sear%E2%80%8C%E2%80%8Bchoutcomefilters=nul%E2%80%8C%E2%80%8Bl&searchgoalfilters=%E2%80%8C%E2%80%8Bnull&searchprofilefi%E2%80%8C%E2%80%8Blters=null&searchdev%E2%80%8C%E2%80%8Bicefilters=null HTTP/1.1
Host: demo.site
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: scContentEditorFoldersWidth=350; ASP.NET_SessionId=pwjpqa0edoppcgatss1bvmdi; shell#lang=en; __RequestVerificationToken=HnLdm_Now0Drb1P5cSUL4SldKgBBA7IjNyniEEizH-ZtceXy5dvvbheEeHV0bZowutgHlB7m_oLzLC-RTjjCWlkUEX8KrMsda_mhK2igSik1; __CSRFCOOKIE=4476f530-f75a-4ba8-bed4-4909607be60f; sc_fv=0.0.0; login#lang=en; sc_rte_shuser=2E9DAC23EC129E0F1B7D1B113712FEFCE23CBE8A1E770E0CF3198B88833E18BA7C98E4E51FF67BF4E76119BADC0419DADF48CD386DEE7192704505175E22A2D2D7412CAE567BC2973BDB9A01D67759A082039AB688898F348B09F7853A693D97352F49AEC76BED14B076F91D7AB7C530; website#sc_date=; sc_pview_shuser=209481495D3A610022B06B4C4B369240D448EF3D0C84D082172E3AA65E9A1493BFE98AC1EAB9EF217CC86968707DD6C990EE5EFE808491F4DCE4B595D0E5CF1E2F315AF0286F6DB76B339FED839915DD2C44C6A8927590237BB1DDA2331F1AF8D4E319630FE20926682BA578E751D27E; website#sc_mode=preview; website#lang=en; shell#sc_mode=; SC_ANALYTICS_GLOBAL_COOKIE=ea13502c80f84227909a2b77bcce2d77|True; sitecore_userticket=4904DD0629ED4175B5F029EC5EB226C5; .ASPXAUTH=144264DA69EA8BFF543760CDF27F5B92CDE96DEA99AD0CD9C45D05717DBC593965F5EB6B614A7F76A2BCBA6C8F6A5C0AEE8203187C7435289A5F3EABA675254DF053FEC600F32C07C03457A129777B5862A27C64780CD1A3F819CAA104EEF7F75FC5EF4483FC15AE9CA26695E64A29E9

I was fairly hesitant to post my code for creating the Contact and Interaction because I have it very split up throughout my application. I tried adding the IpInfo and WebVisit Facets but without luck so here we go:

Adding a Contact:

    public async Task<Contact> AddContact(string email)
    {
        var cfg = await _xconnect.InitializeXConnect();
        using (var client = new XConnectClient(cfg))
        {
            try
            {
                var contact = new Contact(
                           new ContactIdentifier("email", email, ContactIdentifierType.Known)
                           );
                client.AddContact(contact);
                await client.SubmitAsync();
                return contact;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return null;
            }
        }
    }

Adding an interaction:

public async Task<bool> SendInteraction(Interaction i, StoreInfo storeInfo, ProfileScores profileScore, Contact contact)
    {
        var cfg = await _xconnect.InitializeXConnect();
        using (var client = new XConnectClient(cfg))
        {
            try
            {
                client.SetFacet(i, StoreInfo.DefaultFacetKey, storeInfo);
                client.SetFacet(i, ProfileScores.DefaultFacetKey, profileScore);
                FillRequiredFacets(client, i, contact);
                client.AddInteraction(i);
                await client.SubmitAsync();
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return false;
            }
        }
    }

    private void FillRequiredFacets(XConnectClient client, Interaction interaction, Contact existingContact)
    {
        //Add Device profile
        DeviceProfile newDeviceProfile = new DeviceProfile(Guid.NewGuid());
        newDeviceProfile.LastKnownContact = existingContact;
        client.AddDeviceProfile(newDeviceProfile);
        interaction.DeviceProfile = newDeviceProfile;

        //Add fake Ip info
        IpInfo fakeIpInfo = new IpInfo("127.0.0.1");
        fakeIpInfo.BusinessName = "Home";
        client.SetFacet<IpInfo>(interaction, IpInfo.DefaultFacetKey, fakeIpInfo);

        //Add fake webvisit
        WebVisit fakeWebVisit = new WebVisit();
        fakeWebVisit.SiteName = "Offline";
        client.SetFacet<WebVisit>(interaction, WebVisit.DefaultFacetKey, fakeWebVisit);
    }
  • Comments are not for extended discussion; this conversation has been moved to chat. – Richard Seal Dec 8 '17 at 16:06
  • Experience Profile uses xConnect to search for contacts. A couple of things to check: 1. xConnect logs \App_Data\logs folder. 2. Ensure that Solr's endpoing is reachable (enpoint is configured in \App_Config\ConnectionStrings.config solrCore). – grg Dec 11 '17 at 9:29
  • my solr endpoint is not reachable, i'll go have a look why! – mark DE Jong Dec 11 '17 at 9:33
  • the connectionstring had the following link: localhost:8983/solr/Demo_xdb, which was not reachable, however adding a # like so: localhost:8983/solr/#/Demo_xdb made it reachable i still get the same error – mark DE Jong Dec 11 '17 at 9:37
  • @markDEJong, you should change back the Solr string to not contain hash: localhost:8983/solr/Demo_xdb. I only wanted you to verify whether Solr service is started and you confirmed that it is. Any errors in xConnect's log? – grg Dec 11 '17 at 10:55
4

I had this issue as well. For me, it was the Newtonsoft.Json assembly. I had the latest one in my bin since I normally like to use the latest ((thru NuGet). Anyway, after some several trial and error, the Newtonsoft.Json was culprit. It needs to be the v9.0.1. The one that came with SC9. After replacing it, the error went away. Now, I'm not sure if your contacts will show up but that may be a different issue.

As LonghornTaco said above, errors may not be getting trapped smoothly. Also, there may be some bugs still. For instance, the particular error you have above with NegotiateLanguageFilter. It's an attribute that adds Language in the response header of the controller. Because of this, it's possible that the HttpContent may be null. That's not being checked when the language is being set.

  • I already tried re-installing the entire solution so i don't think it is the Newtonsoft.Json assembly, i checked the version and it should be right.. Guess i'll try to find out why the HttpContent is null. – mark DE Jong Dec 14 '17 at 10:16
  • It may be time for you to open a ticket with support. – LonghornTaco Dec 14 '17 at 14:11
  • I assume that a clean SC9 shows the Experience Profile just fine, correct? If the Newtonsoft.Json is not the culprit, see if it's one of your other assemblies. – Marco Dec 14 '17 at 18:14
  • i some how got rid of the error and am seeing a couple of unknown contacts, i was however expecting a couple contacts with names, back to investigating – mark DE Jong Dec 18 '17 at 13:18
  • 1
    Can you explain how did you solve the issue? I think i'm running in the same error as you. – Fabio Carello Feb 6 '18 at 15:01
3

I have checked the xConnect logs \App_Data\logs folder to check for the errors and found out that there is an error in accessing the SSL certificates.

The error says The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. I was able to fix it by running the script available at https://gist.github.com/jermdavis/8d8a79f680505f1074153f02f70b9105

I ran the part of the script which is responsible for setting up SSL for Solr.

2

Any chance you could post the code you're using to create the Contact and Interaction? When creating the interaction manually, outside of a Sitecore context (like in your .NET core app), there are a few bits you need to construct that you may not realize. For instance, if this is an online interaction, you need to specify data for the IpInfo facet. There were two or three objects, when I was creating my xConnect console app, that I did not know to create until I started digging.

Whenever you're viewing the xProfile for a user, a series of pipelines are kicked off. Take the Sitecore.Cintel.Reporting.ReportingServerDatasource.Visits.GetVisitsWithLocations processor for example. In the FillTableWithRow method, they are expecting a non-null IpInfo object with valid data:

    public class GetVisitsWithLocations : ReportProcessorBase
    {
        private void FillTableWithRow(DataTable rawTable, Sitecore.XConnect.Interaction curInteraction, int index = 1)
        {
            WebVisit webVisit = curInteraction.WebVisit();
            IpInfo ipInfo = curInteraction.IpInfo();
            ...
            DataRow row = rawTable.NewRow();
            ...
            row["DeviceId"] = (object) curInteraction.DeviceProfile.Id;
            ...
            row["Ip"] = (object) ipInfo.IpAddress.ToString();
            ...
            rawTable.Rows.Add(row);
        }
    }

In my opinion, they are not handling errors well enough, so a call to ipInfo.IpAddress.ToString(); results in a NullReferenceException and will lead to the dashboard error that you're seeing.

So, as I mentioned earlier, it would be helpful to see the code you're using to actually create the Contact and populate the Interaction data.

  • I'm not near my pc for the next 2 days so i can't share the code i've used for now. I do think i do not have to fill all of these fields tho, i've followed the link down here to work around that problem: brimit.com/blog/sitecore-9-experience-profile-workaround – mark DE Jong Dec 8 '17 at 23:29
  • One more reason i do not think this is the cause of this error is because i have set the search filter to today (so there should be no results) and i get the same error – mark DE Jong Dec 9 '17 at 12:37
  • If you use chrome, open the developer tools (F12) and click the Network tab, then reload the page. See which calls are throwing the errors. – LonghornTaco Dec 9 '17 at 14:37
  • the search call is throwing the error, it returns the error and stacktrace mentioned in my post – mark DE Jong Dec 9 '17 at 14:46
  • Is there any specific information from that call that you would like to see? – mark DE Jong Dec 9 '17 at 15:00
1

I have encountered this also and unable to create a contact as well on List Manager and I've managed to fix this doing the things below.

  1. Restart (SiteName).xconnect Site in IIS.
  2. Stop Solr.
  3. Delete the core sitecore_xdb in the file system of Solr.
  4. Add the core sitecore_xdb folder again with the default items in /conf and data in the file system.
  5. Add the core again on the https://localhost:8983/solr/#/~cores/ and map the created folder.
  6. Start Solr.
  7. Run C:\inetpub\wwwroot\(SiteName).xconnect\App_data\jobs\continuous\IndexWorker\XConnectSearchIndexer.exe

Thanks to this post which I also refer. https://blog.wesleylomax.co.uk/2017/11/01/solrcore-initialization-failures-xconnect-sitecore-9/

0

I found this blog useful. My issue got resolved because of the second point.

http://www.coldat.com/2019/01/31/sitecore-9-experience-profile-contacts-error/

Ensure SOLR path connection strings are formed correctly. For example, they should not have hashes in:

Correct:

https://localsolr:8984/solr/xp_xdb” />

Wrong:

https://localsolr:8984/solr/#/xp_xdb” />

XConnect\App_Config\ConnectionStrings.config XConnect\App_Data\jobs\continuous\IndexWorker\App_config\ConnectionStrings.config

0

If you are using profiles (Profile cards and pattern cards), then this error is occurring because you have not deployed the profiles that you had created under /sitecore/system/Marketing Control Panel/Profiles/

You should deploy those profiles to the web database, to solve this error. Click on the profile you have created -> Click the Review tab found in the Sitecore ribbon menu area -> Under Workflow Chunk/Section, Click on the Deploy button

NOTE : Publishing the site or item does not automatically deploy profiles you have created. You must do this manually.

This was also the solution for the below error in Sitecore Experience Analytics/ Experience Profile that I faced while using profile cards and pattern cards:

The required anti-forgery form field "__RequestVerificationToken" is not present.

0

Please check the below things.

1- Check the connection string on CM Server and check "xconnect.collection.certificate" has the same thumbprint that you have for Xconnect certificate on Xconnect Server.

2- Make sure your server certificate (SSL) for XConnect is valid and can be validated from CM Server.

3- run MMC and check that certificate is exist in your local machine

4- And In MMC>localmachine> edit the permission for certificate and give full control to account(Network Service/something else) in which application is running.

Let me know if you are facing any issue for the above points

Thanks

I have given the same solution for below question- Sitecore XP 9.1.1 certificates error

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.