Empty cron statistics

Hello.

Elgg version 2.3.10. PHP v7.0

I noticed that the Cron statistics is empty on Dashboard. I'm sure that cron on server is working. I also checked its work by calling the link in the browser as mysite/cron/weekly. In this case, the statistics are shown. I've activated only 1 third-party plugin - No Logging by iionly. Could it be the cause of my problem?

  • No logging plugin should not cause any problem.

    Cron daemon running on the server is only one part. Have you created the cronjobs of Elgg (e.g. in CPanel) as described at http://learn.elgg.org/en/stable/admin/cron.html? If you haven't done yet, you need to do that now. Create cronjobs for each interval (minute, fiveminute, fifteenmin, halfhour, hourly, daily, weekly, monthly, yearly) with corresponding command like

    /usr/bin/lwp-request -m GET -d http://www.YOURSITE.URL/cron/minute/ >/dev/null 2>&1

    You would need to adjust the path to lwp-request and your site url (with http or https as used on your site). If lwp-request is not installed on the server (or if it fails to work - it doesn't work for me with https) you can use the wget command instead:

    /usr/bin/wget --output-document=/dev/null http://www.YOURSITE.URL/cron/minute/ >/dev/null 2>&1

    (again you would need to adjust the path to wget - which is normally available on any server - and the site url).

  • I created the cronjob for the interval I needed (weekly). I use lwp-request command. In the system log this cronjob is shown as successfully launched without any errors. I also checked it with minute cronjob. But there're no records in the Cron statistics. As I said, if I run the command through the browser, the entry is displayed correctly.

    Perhaps I did something on the server in the settings of PHP or somewhere else. At the moment I just can't understand what determines the flow of data from the cron job to Elgg.

    Thank you for help.

  • it doesn't work for me with https

    Good catch! I will check it now with wget.

    Updated:
    Nothing, the same situation: - there're no records in the statistics; -if I run through the browser then the entry appears

  • Check the settings for localhost:80 in your server configuration

  • Thanks for the advice. I'm sure everything is right there. Perhaps there're some problems with permissions to write to database. I think this is connection over SSL. However, I solved this problem by editing the cron job:

    @weekly /usr/bin/lynx -source mysite/cron/weekly/

    I decided to use lynx to run cron.

    Now I see Cron statistics in the admin panel. Thank you all for the help.

  • Had you tried with https:// included in the url? If not wget might have tried on the non-SSL port. If you leave out ">/dev/null 2>&1" in the command there might be more added to the cron log telling you why it fails to work (later on you should add it again to have a shorter log file). If wget still doesn't work you might want to add ">/dev/null 2>&1" also to the lynx command to suppress unnecessary output / log entries.

    In addition to the "weekly" interval you might need at least the "minute" interval, too. Elgg triggers sending of notifications using the "minute" cron handler. Without a cronjob triggering this interval the notifications won't be sent. If triggering once per minute is too often for your liking (and you think users can wait longer for any notications) you can set up the "minute" cronjob at a larger interval as the important point is that the corresponding cron url gets called at all.

    With the Croncheck plugin (https://elgg.org/plugins/1864611) you can see for which intervals any handlers are registered (by Elgg or a 3rd party plugin) and you would have to set up cronjobs at least for these intervals (if changing the handler to another interval isn't possible).

  • Dear iionly, I'm very advanced user (Drupal, WordPress).

    I used all the options for the cron. 
    I've domains with SSL and without SSL and still I did't get any records in the Cron statistics.
    I've both minute and weekly intervals. 
    In my replies here I indicate weekly only but this doesn't mean that I don't check the cron by the minute.

    Of course, I tried your plugin Croncheck but it didn't bring me any good.

    I believe that I made a mistake in the settings of the SSL because on my localhost everything works well.

    If it matters please tell other users about this problem - use /usr/bin/lynx  instead of Elgg documentaitions.

     

     

  • Here's my story:

    It all started on February 10.

    On this day, I changed only the settings of my server.

    Namely, added the following entries - Using nginx I added these records in my default.conf

    ssl_protocols TLSv1.2;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384';

    I checked the work of such settings on localhost and everything works well without SSL.

    Therefore, I can inform you that editing DNS records can affect the work of your subdomains.

    Use Elgg 3.x CLI solution instead Elgg 2.x web calls via browser.

    Regards to all Elgg's team.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking