<p>When a connection to the database can't be made Craft throws a 404. This sound like it might be your problem because you say it happens intermittently.</p>

CC BY-SA 3.0
2015-07-19T03:10:41.230Z
That has to be it! I remember seeing a db connection error in the logs this morning, though I cant find it for the life of me now. Plus, I regularly get db connection error when using the admin, but I have no idea why. I've only had one 404 since this morning. I'll continue to keep an eye on it. Thanks!
Incraigulous
CC BY-SA 3.0
2015-07-18T18:16:48.737Z
2015-07-18T18:16:48.737Z
Jamie Pittock
<p>I have a template that fails to load intermittently, resulting in a 404. I haven't been able to debug it since 99% of the time the page loads perfectly.</p>

<blockquote>
  <p>2015/07/18 12:18:57 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in /var/www/html/cotm_2015/craft/app/controllers/TemplatesController.php:59
  Stack trace:
  0 [internal function]: Craft\TemplatesController->actionRender('30-days-of-pray...', Array)</p>
</blockquote>

<p>Anyone have any ideas?</p>

CC BY-SA 3.0
2015-07-18T16:43:44.537Z
Can you share the URL of the template?
Brad Bell
CC BY-SA 3.0
2015-07-19T03:01:19.133Z
@BradBell, It's http://events.churchonthemove.com/thirty-days-of-prayer
Incraigulous
<templating><routes><404>
Template fails to load intermittently
# Template fails to load intermittently

(Asked by: username_0 on 2015-07-18)

I have a template that fails to load intermittently, resulting in a 404. I haven't been able to debug it since 99% of the time the page loads perfectly.

> 2015/07/18 12:18:57 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in /var/www/html/cotm\_2015/craft/app/controllers/TemplatesController.php:59
> Stack trace:
> 0 [internal function]: Craft\TemplatesController->actionRender('30-days-of-pray...', Array)

Anyone have any ideas?

**Tags:** templating, routes, 404

> **Comments:**
> **username_1**: Can you share the URL of the template?  
> **username_0**: @BradBell, It's http://events.churchonthemove.com/thirty-days-of-prayer  

---

## 1 answers

### Answer by username_2 on 2015-07-18. Score: 2 | Accepted answer

When a connection to the database can't be made Craft throws a 404. This sound like it might be your problem because you say it happens intermittently.

> **Comments:**
> **username_0**: That has to be it! I remember seeing a db connection error in the logs this morning, though I cant find it for the life of me now. Plus, I regularly get db connection error when using the admin, but I have no idea why. I've only had one 404 since this morning. I'll continue to keep an eye on it. Thanks!  

---

