Watchdog had the following error in it this morning:

Download location for METAR data is not accessible.

This occurred at 05:57 server time. I have cron configured to run and update the weather data hourly, so it ran again at 7:00 and 8:00, and then for good measure I ran it once more manually a few minutes ago. The weather data was not updated. The only way to force an update is to delete the row with the old data from the database, which forces the module to rebuild it on the next page load in which the block is displayed.

Comments

toddy’s picture

Assigned: Unassigned » toddy
Status: Active » Closed (works as designed)

Hi,

if the download location is not available, the module will check again after 10 minutes. If the data still cannot be downloaded, the next check occurs after 3 hours, then 6, 12, and 24 hours after the initial download attempt. From then on, the module tries once a day to download the weather data. You don't need to manually delete the row. Judging from the times you've mentioned above, you've probably just missed the three-hour-check. Could that be the explanation?

Regards,
Tobias

macman824’s picture

Status: Closed (works as designed) » Active

Hi toddy,

To test your suggestion, I let the module sit with outdated data for three days -- it never changed in that time (and the METAR data was quite accessible; as soon as I deleted the row it repopulated with the current METAR). Since this doesn't appear to match up with your design intent, I've gone ahead and re-opened the issue. I feel like the problem might be here on line 2073-2075 of weather.module:

        $last_update = $data['metar_raw'];
        $hours = 3 * 60 * 60;
        while (($last_update + $hours + 120) < time()) {

$last_update is set to the raw METAR data, which is a string. That string then has arithmetic performed on it as if it was a timestamp, but it's not. I suggest the following change:

        $metar= weather_parse_metar($data['metar_raw']);
        $last_update = $metar['reported_on'];
        $hours = 3 * 60 * 60;
        while (($last_update + $hours + 120) < time()) {
toddy’s picture

You're right, thanks for checking that again. I'll prepare a fix.

toddy’s picture

Status: Active » Fixed

Hi,

this should be fixed in the latest release, 6.x-5.20.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.