0

Has anyone else been experiencing this problem when trying to open the Experience Editor for a page or a partial view when performing local development for Sitecore XM Cloud? I am using the template https://github.com/sitecorelabs/xmcloud-foundation-head

Sometimes after a refresh the Experience Editor appears and works fine. Other times it shows that message.

2 Answers 2

4

If you are getting slow performance on your Experience Editor locally, you are probably running out of resources in your docker container. By default, docker gives your container 1gb RAM and shares the host CPU. On your CM container, the 1gb limit is easily hit.

You can give it more by modifying your docker-compose-override.yml file. Find your cm container definition and add the following lines:

cm:
  image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xmcloud-cm:${VERSION:-latest}
  build:
    context: ./docker/build/cm
    args:
      PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xmcloud-cm:${SITECORE_VERSION}
      TOOLS_IMAGE: ${TOOLS_IMAGE}
  # **** ADD THESE LINES ****
  deploy:
    resources:
      limits:
        cpus: 1.0 # <--- gives it a dedicated core
        memory: 6GB # <--- set this to a reasonable limit based on your machine specs.
  # **** ADD THESE LINES ****
  volumes:
    - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy
    - ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
    - ${HOST_LICENSE_FOLDER}:c:\license
  environment:
    SITECORE_LICENSE_LOCATION: c:\license\license.xml
    RENDERING_HOST_INTERNAL_URI: "http://rendering:3000"
    JSS_DEPLOYMENT_SECRET_xmcloudpreview: ${JSS_DEPLOYMENT_SECRET_xmcloudpreview}
    SITECORE_JSS_EDITING_SECRET: ${JSS_EDITING_SECRET}
    SITECORE_EDITING_HOST_PUBLIC_HOST: "${RENDERING_HOST}"
    SITECORE_Pages_Client_Host: ${SITECORE_Pages_Client_Host}
    SITECORE_Pages_CORS_Allowed_Origins: ${SITECORE_Pages_CORS_Allowed_Origins}
    # ADD THIS LINE
    SITECORE_GRAPHQL_CORS: ${SITECORE_GRAPHQL_CORS}
    # Development Environment Optimizations
    SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff
    Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM
  entrypoint: powershell -Command "& C:/tools/entrypoints/iis/Development.ps1"

This should make your CE and EE run better locally. Also, you can now use Pages to edit your content locally. To do this you need to:

  • Visit https://pages.sitecorecloud.io in your browser
  • Open the dev tools and add a new key to the local storage for that site
    • Key Sitecore.Pages.LocalXmCloudUrl
    • Value: https://xmcloudcm.localhost/

Reload the pages site and you should see your local site editable. If you get CORS issues, make sure these values are set in your .env file:

SITECORE_Pages_Client_Host=https://pages.sitecorecloud.io
SITECORE_Pages_CORS_Allowed_Origins=pages.sitecorecloud.io
SITECORE_GRAPHQL_CORS=*.sitecorecloud.io

Documentation for all this is here: https://doc.sitecore.com/xmc/en/developers/xm-cloud/connect-sitecore-pages-to-your-local-xm-cloud-instance.html

2
  • 1
    Many thanks! This helped solve the issue.
    – coolzoa
    Feb 7, 2023 at 15:42
  • cpus: '1.0' # <--- Ensure it's a string value and specify units memory: '6GB' # <--- Ensure it's a string value and specify units Mar 31 at 11:47
0

Seems I had similar issue some time ago. Solution below helped me. Try to add the following config patch to your solution:

<?xml version="1.0"?>

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
               xmlns:set="http://www.sitecore.net/xmlconfig/set/">
    <sitecore>
        
        <javaScriptServices>
            <renderEngines>
                <renderEngine name="http">
                    <instance id="defaults">
                        <!-- Specifies the maximum duration, in milliseconds, that your .NET code should wait for requests to the HTTP renderer (e.g. the `EndpointUrl` setting) to respond. -->
                        <RequestTimeoutMs>1000000</RequestTimeoutMs>
                    </instance>
                </renderEngine>
            </renderEngines>
        </javaScriptServices>
    </sitecore>
</configuration>

And, of course, you can set any value you want for RequestTimeoutMs parameter. Default value is 10000.

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.