2

Whenever I try to access my local Sitecore instance in the Pages editor, it shows an error: Connection to rendering host http://rendering:3000/api/editing/render failed with the following error: The remote server returned an error: (500) Internal Server Error

And when I check the rendering host, via the PUBLIC_URL or by running curl http://rendering:3000 in the CM container’s terminal, it shows this error:

TypeError: fetch failed
at Object.processResponse
<unknown>
<unknown>
Async.runInAsyncScope

Has anyone encountered this as well?

2 Answers 2

0

It could be related to HTTP binding. See if it works for you.

This happened because the URL in SITECORE_API_HOST in my .env file was using an HTTPS connection. When I added an HTTP binding to my site and changed the URL to HTTP it worked.

Credit: Guide To Fixing Setup Errors: Sitecore Headless SXA, Next.js, XM Cloud Dev

Hope it help!

0

This error usually means the rendering host can’t reach the CM instance, so the /api/editing/render call fails and you see TypeError: fetch failed.

Check the following common causes:

  1. Incorrect hostnames in the rendering host environment Use the Docker service names, not localhost. For example:

    PUBLIC_URL=http://rendering:3000
    SITECORE_API_HOST=http://cm
    SITECORE_API_EDITORIAL_HOST=http://cm
    

    If these point to localhost, the request won’t reach CM from inside the container.

  2. Rendering host cannot connect to CM Test from inside the rendering container:

    curl http://cm/sitecore/api/layout/render
    

    If this fails, editing will fail as well.

  3. Wrong or missing Layout Service API key The key in the rendering host must match the API key configured in CM.

  4. HTTP/HTTPS mismatch Use http://cm if your CM container is not exposing HTTPS internally.

Whenever the rendering host returns TypeError: fetch failed, it almost always indicates that the server-side call to CM (Layout Service or GraphQL) could not be completed. Fixing the hostnames or connectivity usually resolves the Pages editor error.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.