Quick fix: XM Cloud Pages the remote name could not be resolved

Recently while working on the XM Cloud project, one of the colleagues complained that the Pages app not working and throwing following error.

The remote host used by XM Cloud Pages if configured as the Rendering Host setting item at the below given path in XM Cloud CM. This host is nothing but Editing Host used in Experience Editor and Sitecore Pages application.

/sitecore/system/Settings/Services/Rendering Hosts

Just to make sure the host, as visible in above screenshot, is working or not, I just hit that host in browser tab and it showed me the following page.

Looking at the error, I immediately recognized that the XM Cloud editing host is no more available on configured domain. It means Sitecore XM Cloud has changed the editing host value behind the scene with a new host in the Default (/sitecore/system/Settings/Services/Rendering Hosts/Default) Rendering host setting item.

How to fix the issue

To fix the issue, just try to delete the Default rendering host setting item. As soon as Sitecore detects the deletion of the item, it will restore the same item from the resources, with following message.

Once the item is restored, you can see the new editing host values are seen.

Rendering host setting item snapshot

Now you try to access the Pages app and it will work.

What caused this issue?

As per my understanding, the Default rendering host item is created based on the resource item which Sitecore maintains in resource files.

Starting for Sitecore 10.1, default Sitecore items are stored in the resource files. Before that, default items were stored in the databases. At run time, items from the Sitecore files and databases are merged into the content tree.

Items in resource items are immutable. In the content tree, if you try to edit an item stored in a resource file, Sitecore copies the item to the database using the same item ID, then applies the changes, and any future changes, to this database item.

As per Sitecore documentation, read more about it here.

So, when we edited the Default rendering host setting item to match Application name with our JSS application, Sitecore moved that item to the database.

The Default rendering host created while environment is setup through XM Cloud Deploy app from the resource file is updated from Sitecore, but being in the database, the changes did not applied to the item, it seems. And hence, we were seeing the old editing host entry which caused failure to the Pages app.

I hope the details in the article will help you to fix your issue with some detailed explanation about how editing host item is created and maintained by Sitecore.

Happy Sitecore XM Cloud, learning!!!