Nathan
Nathan

Reputation: 111

Sitecore SXA Export Page could not be downloaded from the server

My first Sitecore project and I've been tasked with building a site using Sitecore's new SXA 1.4 module. I was getting along nicely and created a wireframe version of my home page when I decided I'd like to test out the Creative Exchange Export feature to see what kind of markup would be generated by Sitecore for my front-end developer. My first attempt worked with no problems but I realized that I'd exported the site using the Wireframe theme which I did not want. Following Sitecore's documentation I dutifully created a new them for my site by right clicking on it in the Content Editor and selecting Scripts > New Site Theme. All went well during theme creation so I went back into the Experience Editor and selected the new theme as as my Default then attempted to export again. The export package contains HTML files for each of my pages but their only content is text stating that Page could not be downloaded from the server! After this I tried changing my Theme back to Wireframe and exported again with the same result. I am using Unicorn serialization on this project and my theme is included as one of the predicates. I'm not sure what happened that caused the export to stop functioning, but from what I can tell it seems to have started after running the script to create a new theme. Anything I may have missed working through this process? I tried googling for sitecore and the Page could not be downloaded from the server message to no avail.

Upvotes: 1

Views: 581

Answers (3)

Anton
Anton

Reputation: 9961

It was definitely not the case in 2017, but nowadays it could be:

When you run Sitecore with SXA inside Docker you need to make sure that the address that you use in your browser is available inside the container.

SXA uses HttpWebRequest inside for the export process. And as the hostname for a web request, it takes the URL of the current context(it will be the address that you entered in browser). That is why if you have Sitecore in the container and your website address will not be resolved inside the container then you will get Page could not be downloaded from the server.

Upvotes: 0

Geoff Warren
Geoff Warren

Reputation: 414

There is a configuration file called Sitecore.XA.Feature.CreativeExchange.config which contains the setting XA.Feature.CreativeExchange.SkipServerCertificateValidation. Changing this to true should fix the problem with self-signed certificates.

Upvotes: 1

Nathan
Nathan

Reputation: 111

Looking through the Sitecore logs I noticed this entry:

ManagedPoolThread #7 11:38:39 ERROR Creative Exchange: exporting page 
https://fakesite.com/?sc_itemid=%7b12872DF3-557B-46A3-8464-3D697DCAD00A%7d&aodisabled=true&overlay=true&sc_mode=preview&CreativeExchangeExport=true&CreativeExchangeMode=AgencyDrop&sc_lang=en&sc_device=%7bFE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3%7d&sc_site=fakesite finished with error.
Exception: System.Net.WebException
Message: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Source: System
  at System.Net.HttpWebRequest.GetResponse()
  at Sitecore.XA.Feature.CreativeExchange.Services.Export.PageRequestService.ReadUrl(HttpWebRequest request)
  at Sitecore.XA.Feature.CreativeExchange.Services.Export.PageRequestService.RetrieveHtml()

At this point I realized that Sitecore was failing to export the Agency Drop SXA package correctly because I had my development site setup with a self-signed SSL certificate. I have this certificate in my Trusted Root Certification Authorities store but it appears that Sitecore checks for SSL validity using some other method. For now I've just switched over to using HTTP to continue working on the site.

Upvotes: 0

Related Questions