The MU forums have moved to WordPress.org

WP-cron doesn't work (11 posts)

  1. bechster
    Member
    Posted 15 years ago #

    Hi.

    I'm having trouble with wp-cron. It doesn't work. Scheduled posts are never published.

    I have looked a bit around on teh interwebs and found that this may have something to do with fsocket being blocked to port 80.
    http://wordpress.org/support/topic/208194?replies=5

    I'm not very much into php (or servers for that matter) but I have tried running a small script to test port 80:

    <?php
    $ip = "localhost";
    $port = 80; 
    
    if ($sock = fsockopen($ip, $port)) {
    print "Port $port is open";
    fclose($sock);
    } else {
    print "Port $port is not open";
    }
    ?>

    I've tried this with different IP's and port 80 is apparently open.

    Also, I can't import images from other blogs via the Wordpress XML import function and I suspect it relates to the above problem (although I'm not sure at all).

    Does anybody have any ideas?

    Thanks in advance.

  2. Trent
    Member
    Posted 15 years ago #

    WP Cron should work if you are not using .htaccess AUTH on the directory. That will make it so it doesn't work for sure as I figured out with password protected directories...

    Just something in case that was the issue. Otherwise, I would start going through directory permissions both both issues to start.

    Trent

  3. VentureMaker
    Member
    Posted 15 years ago #

    Discussed here: http://mu.wordpress.org/forums/topic.php?id=5543
    Check the last post.

  4. WilliamTully
    Member
    Posted 15 years ago #

    Ok, so script indicates that the port is open, dirs are not password protected, no issues establishing a scheduled post within the system, and manually running wp-cron.php doesn't publish the post either (no reported errors in server logs either).

    Running WPMU 2.6, PHP 5.2.4, and mysql 5...

    Anyone know if it is possible to set a server to block cron jobs? For example, say you had some specific cron jobs established on the server and you wanted to prevent other jobs like blogs (or rogue software) from running cron jobs? Is this possible?

    Grasping at straws at this point... help.

  5. VentureMaker
    Member
    Posted 15 years ago #

    Anyone know if it is possible to set a server to block cron jobs? For example, say you had some specific cron jobs established on the server and you wanted to prevent other jobs like blogs (or rogue software) from running cron jobs? Is this possible?

    http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s2-autotasks-cron-access.html

    Should work not only on RedHat :)

  6. bechster
    Member
    Posted 15 years ago #

    I do have an .htaccess file in the (root)directory.
    The apache error.log does give errors in my case. Please see below:

    ##### .htaccess start ######
    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    ##### .htaccess end ######

    ### error.log start ###
    [Thu Nov 20 12:59:57 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 12:59:57 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 12:59:58 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:15:12 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:15:13 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:15:54 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:15:55 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:17:56 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:17:57 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:17:58 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:17:59 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:18:34 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:18:51 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:18:52 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:19:40 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:20:09 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:20:10 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:23:01 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:23:13 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:25:52 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network [Thu Nov 20 13:27:21 2008] [info] [client ::1] (32)Broken pipe:
    core_output_filter: writing data to the network ### error.log end###

    Can anybody tell me if there is anything in the above, that may have some influence on this issue?

  7. VentureMaker
    Member
    Posted 15 years ago #

    This is probably your PHP memory limit kicking in...
    Not sure, but it's maybe a place to start digging.

  8. WilliamTully
    Member
    Posted 15 years ago #

    After this post I found this one:

    http://mu.wordpress.org/forums/topic.php?id=10252

    Which raises quite a bit of questions - especially the part about

    We run WordPressMU in a cluster of a few httpd Web servers + a few MySQL Database servers behind a load balancer. WPMU's method of making internal HTTP requests (used by wp-cron, RSS, etc.) caused issues, so we implemented a round-robin for internal HTTP GET requests.

    On our system I have issues with wp-cron not running, and I cannot get WP to call another local WP RSS feed - I had to setup a feedburner account and make the call to an external source to simply show the latest 5 posts of a blog.

    Now that I think about it, telling a server not to run other cron jobs would explain the wp-cron issue, however, it wouldn't explain the RSS issue... Internal HTTP requests problems does explain both, however I'm lost as to what the 'round-robin' solution would entail. Any ideas?

  9. steve.mcnally
    Member
    Posted 15 years ago #

    Hello - I've been pounding my head on this issue for two days straight.

    I'm seeing requests to wp-cron.php being redirected in apache's access.log:

    209.20.89.220 - - [20/Nov/2008:17:42:30 +0000] "GET /marksvenvold/wp-cron.php?check=187aed02f24bf750db06bf6c5d745618 HTTP/1.0" 302 - "-" "-" 209.20.89.220 - - [20/Nov/2008:17:41:52 +0000] "GET /wp-cron.php?check=187aed02f24bf750db06bf6c5d745618 HTTP/1.0" 302 - "-" "-" 209.20.89.220 - - [20/Nov/2008:17:31:58 +0000] "GET /grahamkates/wp-cron.php?check=187aed02f24bf750db06bf6c5d745618 HTTP/1.0" 302 - "-" "-"

    I have no idea why the calls are being redirected.

    @VentureMaker and TheVirtualPreacher - read the post; it says ~"My webhost fixed something, but didn't say what." Doesn't really address my issue.

    Would love to hear from folks here: there's a lot of discussion on this, but no resolution.

  10. webmaestro
    Member
    Posted 15 years ago #

    @steve.mcnally - did you try the suggestion I recommended?

    All WEB servers in the cluster use the internal IP address for the load balancer in the /etc/hosts file for http://www.myblogdomain.com and mydomain.com:

    xxx.xxx.xxx.xxx   http://www.myblogdomain.com mydomain.com

    ...and also have the following in their httpd CONF file:

    <VirtualHost *>
            ServerName http://www.myblogdomain.com
            ServerAlias myblogdomain.com
    ...

    and then...

    Sorry for the delay... We entered our blog domain in internal DNS pointing to each IP available on the cluster:

    blogdomain.com   127.xx.x.1
    blogdomain.com   127.xx.x.2
    blogdomain.com   127.xx.x.3

    NOTE: blogdomain.com is the same on each line... What's different is the IP address

    Hope this helps!

  11. bechster
    Member
    Posted 15 years ago #

    @webmaestro: Thanks a lot! Your suggestion just solved the wp-cron issue in my WPMU installation.

About this Topic

  • Started 15 years ago by bechster
  • Latest reply from bechster