Blog

Fix WordPress “Missed schedule” error on Media Temple (dv) / Plesk

July 18th, 2009 at 10:37pm | 9 Comments

After a lot of debugging, I was able to figure out that Media Temple’s (dv) configuration was responsible for the “Missed schedule” errors I was getting in WordPress.  By default, the /etc/hosts file looks like this:

127.0.0.1  yourdomain.com yourdomain localhost localhost.localdomain

To execute cron tasks, WordPress needs to post to the URL http://yourdomain.com/wp-cron.php?doing_wp_cron. This isn’t usually a problem, but with the above hosts file and Plesk’s Apache configuration, that URL will actually result in a 404 error.

I tried removing yourdomain.com and youdomain from the hosts file:

127.0.0.1  localhost localhost.localdomain
Unfortunately, when you restart the VPS using Virtuozzo in Plesk, yourdomain.com and yourdomain will just be added back in.  However, after some exhausting Google searching I found out that you can just move them down to the next line with the proper IP address:
127.0.0.1  localhost localhost.localdomain
xxx.xxx.xxx.xxx yourdomain.com yourdomain

Now when you restart the VPS, these changes to the hosts file will remain.

I looked at several other possible solutions to fix the “Missed schedule” problem.  One solution was setting the “ALTERNATE_WP_CRON” constant in the wp-config.php:

define('ALTERNATE_WP_CRON', true);

This activated some very messy redirecting for the user as they browsed the site though.  Not a great solution.  Another solution I was considering was just executing wp-cron.php from a cronjob every hour. Something like this:

0 * * * * /home/yourdomain/htdocs/wp-cron.php >/dev/null

Willie Jackson

1. That comment preview feature is sliiiiiick. Nice!
2. This is exactly what I was looking for. I’ll be testing it out this week. Thanks for taking the time to post the solution.

August 5th, 2009 at 6:54am

Ask Questions

Does adding a some cron job help? I got a lot of blogs where i schedule posts. Now i have to keep checking and publishing them. Its made life difficult.

August 7th, 2009 at 2:47am

bradt

Yes, scheduling wp-cron.php to run as a cron job on the server could work as well.

August 7th, 2009 at 2:26pm

Derek

I have two domains on my (dv) account, one for my main site and the other for anything else. Which IP should I be adding there?

Also, I have a crontab running it now, but since I use super cache I get an error email so I would really like to get this working.

August 8th, 2009 at 1:38am

bradt

@Derek If you don’t know the IP addresses for your domains, you should contact Media Temple for support.

August 9th, 2009 at 5:28pm

Derek

I know what my IP’s are, that wasn’t my question. My question was which one do I use?

August 9th, 2009 at 6:33pm

bradt

@Derek If you have two domains with two IP addresses, and your /etc/hosts currently looks like this:

127.0.0.1 yourdomain1.com yourdomain1 yourdomain2.com yourdomain2 localhost localhost.localdomain

You could try something like this:

127.0.0.1 localhost localhost.localdomain
ip_address1 yourdomain1.com yourdomain1
ip_address2 yourdomain2.com yourdomain2

If you share 1 ip address between your two domains, you could try:

127.0.0.1 localhost localhost.localdomain
ip_address yourdomain1.com yourdomain1 yourdomain2.com yourdomain2

August 10th, 2009 at 9:11am

Derek

I actually have my main domain on one IP and the other 10 or so sharing the other IP. I’ll try and ask MT and see what they say about it.

August 10th, 2009 at 6:04pm

Emily

Just wanted to thank you for posting this fix, in particular the part about moving the hostname to a second line! Saved me. Cheers.

June 17th, 2010 at 10:34am

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>