I have an existing Craft Pro installation (v2.5.2757) that I'm using to drive an application. The current install does not have a homepage or any entry associated with a URL. All requests are being handled by Dynamic Sites Routes (routes.php).

The site has been running without issue for months with edits being made to entries and content being updated in the application.

However, when I went to create a homepage for the site, I would receive the following error when the site loaded:

Template Error - Variable "entry" does not exist

I confirmed that the 'This is for the homepage' was checked and that the correct 'Entry Template' was entered. I suspected that something in routes.php was causing the issue, but cleared that out and still received the error. I tried clearing the caches as well but no luck.

After multiple hours of troubleshooting I'm at a loss.


After trying many different things I noticed that the background tasks que was backed up:

Background Tasks - Resaving Entries

The queue was not moving. After a little research I came across the support ticket on craft on how to Resolve "Stuck" Background Tasks. After completing the couple steps of updating the stuck task status and restarting the queue, they all cleared out.

After this, my homepage was pulling in the entry properly and parsing the 'entry' variable without issue.

My guess is that if you create an entry while the background tasks queue is stuck you will run into this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.