<p>Check your phperrors.log and see if there are any errors with your 503 template. As you posted, if it encounters any errors in the template, it will just render the 503 error message instead.</p>

<p>I was confounded by the same issue and found it was catching an error with my include statement. Even though the file hadn't changed, Craft3 was throwing an exception where Craft2 never cared before.</p>

<p>In the log, it'll spit out the stack trace after the human-readable error, so you might want to search for the date you were testing (format example: 10-Oct-2018). There it should say what the error was and where it occurred.</p>

<p>Hope that helps!</p>

CC BY-SA 4.0
2018-10-10T18:23:25.880Z
2018-10-10T18:23:25.880Z
Andrea Hall
<p>I am preparing to upgrade a site from Craft 2 to 3, and would like to make a custom template to deal with the 503 Service Unavailable when the migrations need to be run.</p>

<p>I have set <code>devMode</code> to <code>false</code> and tried creating <code>templates/503.html</code> and also <code>templates/offline.html</code>, which just contain some plain HTML (no Twig/Craft functions) but each time I get:</p>

<pre><code>An internal server error occurred.
</code></pre>

<p>If I turn <code>devMode</code> back on, I can see where the <code>craft\web\ServiceUnavailableHttpException</code> is being thrown in <code>craft\web\Application-&gt;_processUpdateLogic()</code> and above it says in comments:</p>

<pre><code>// If an exception gets throw during the rendering of the 503 template, let
// TemplatesController-&gt;actionRenderError() take care of it.
</code></pre>

<p>However, I can't see this method trying to find and/or serve a <code>503.html</code> template, or see what is wrong with the template I've created?</p>

<craft3><error-message><error-templates>
Custom 503 template
# Custom 503 template

(Asked by: username_0 on 2018-09-20)

I am preparing to upgrade a site from Craft 2 to 3, and would like to make a custom template to deal with the 503 Service Unavailable when the migrations need to be run.
I have set devMode to false and tried creating templates/503.html and also templates/offline.html, which just contain some plain HTML (no Twig/Craft functions) but each time I get:
An internal server error occurred.

If I turn devMode back on, I can see where the craft\web\ServiceUnavailableHttpException is being thrown in craft\web\Application->_processUpdateLogic() and above it says in comments:
// If an exception gets throw during the rendering of the 503 template, let
// TemplatesController->actionRenderError() take care of it.

However, I can't see this method trying to find and/or serve a 503.html template, or see what is wrong with the template I've created?

**Tags:** craft3, error-message, error-templates


---

## 1 answers

### Answer by username_1 on 2018-10-10. Score: 1

Check your phperrors.log and see if there are any errors with your 503 template. As you posted, if it encounters any errors in the template, it will just render the 503 error message instead.

I was confounded by the same issue and found it was catching an error with my include statement. Even though the file hadn't changed, Craft3 was throwing an exception where Craft2 never cared before.

In the log, it'll spit out the stack trace after the human-readable error, so you might want to search for the date you were testing (format example: 10-Oct-2018). There it should say what the error was and where it occurred.

Hope that helps!


---

