Thanks for the cool module.

Trying to use it with Drupal private download method there is an error, "Download location for METAR data is not accessible.

Is it possible to re-configure the data folder to point it to another folder that is public?

Comments

ShannonK’s picture

I am also receiving this error, as are my users. I've had this module up and running for quite a while now, with no problems. Was something overlooked in the last update (May)?? Does anyone know how to fix this?

joetheyeti’s picture

Assigned: toddy » Unassigned

I kept getting the same METAR error message after the module working well for weeks. I'm using a public airport METAR location, so there shouldn't be any problems. But I get the error fairly frequently. I couldn't get the error message to go away even if I told Drupal to write all errors to the log and not the screen. Here's my solution:

I hacked the module code and get the error to stop showing up on my web site. I HIGHLY recommend making a backup of the original code before you do this, so you can revert if you need to.

To remove the METAR error message:

1) Open the file weather.module (from the sites>all>modules>weather folder) in a simple text editor (WordPad works well, DON'T use MS Word)
2) Scroll to the bottom
3) Delete the following code:

// check on errors
if ($metar_raw === FALSE) {
drupal_set_message(t('Download location for METAR data is not accessible.'), 'error');
}

4) Save the document
5) Upload the document to your Drupal site

I don't know if this hack has repercussions, so you it at your own risk. It worked great on my site. If the METAR data isn't available, the weather module simply displays a question mark graphic and a nice, discreet "No data" message underneath it. But you DON'T get that ugly-ass error message in the red box at the top of the page.

toddy’s picture

Assigned: Unassigned » toddy

Hi,

we're discussing the problem in #836582: Don't show warning to non-admins.. Bottom line is: Should the error be logged in the watchdog tables? Would that be enough?

Regards,
Tobias

izmeez’s picture

@ShannonK Thanks for the tip,

I have reverted to version 6.x-5.11 and the problem is gone and the module is working.

The only time I see the error message is when I run update.php

So Private file downloads doesn't seem to be an issue.

Is there a bug in 6.x-5.12 ?

Izzy

izmeez’s picture

Assigned: Unassigned » toddy

Just a further update on this issue,

I have reverted to using 6.x-5.11 with Private file downloads and it seems to be working fine.

The "METAR data not accessible error" appears to show when users first search for a location but if they do it a second time it works fine. I am not sure why this is the case.

I may have a chance to test this again on version 6.x-5.12 later in the day.

jusyjim’s picture

I am having the same symptoms as # 5, no metar data but on reload it's fine. This just started a short while ago but I am on 5.x version.

izmeez’s picture

Well, this is strange.

I updated to 6.x-5.12 by just copying over newer files to my 6.x-5.11 installation and the problem is completely gone.

Even after flushing caches there is no problem.

Maybe the module was reporting a valid error at those earlier times?

izmeez’s picture

Title: Weather with private download location for METAR data not accessible » Weather module download location for METAR data not accessible

I am just changing the title of this issue because it does not appear to be a problem specific to private download file system. Hope no one minds the change.

ShannonK’s picture

So....is there a consensus here on what we should do? Should I revert back to 5.11 (by disabling 5.12, deleting, then reinstalling 5.11?). Or, I'm not sure, since izmeez updated to 5.12 and doesn't have the problem anymore. For what it's worth, I noticed my weather block shows the incorrect day/time, even after refresh. I did check my system date/time (https://www.mysite.com/admin/settings/date-time), and it's correct there. Any ideas where to go from here??

* Update: I reverted back to 5.11 just to see if the ugly error would go away and the time would reset, but the time is still wrong. It's showing the weather for yesterday at 2:10PM, even after refresh and clearing cache. I'm guessing the error message will return as well. Anyone have any ideas?

** Also - I have another Drupal site with the same weather module, ver 5.12, and it is working fine. So, there's something conflicting I guess with this one site. I don't know where to start digging....I'm at a loss here.

steinmb’s picture

Chiming in.
Also seen this happening lately, randomly on page load the system global weather block is missing all, one or multiple METAR stations.

So what changed between 5.11 and 5.12 regarding the pull-data method?

steinmb’s picture

I have done some debugging and I think I found the problem. Retrieving METAR data fails when the Weather module uses the http/POST method instead of the preferred FTP method. Instead of a OK from the server we get an "error 301". Looks like NOAA have stopped using the Perl script and now redirect is to a PHP script mgetmetar.php.

Quick fix:
At line 2114 in the file weather.module, change the use of the Perl script to the new PHP-script.
$request = "POST /mgetmetar.php HTTP/1.1\r\n";

Let me know if this resolve the issue and we can get an official patch rolled ASAP. It worked for me.

Cheers
Steinmb

izmeez’s picture

@steinmb #11

This seems to be working for me.

I'll see if any stoppages in receiving weather data occur.

It seems that is when the error message occurs and the weather block is empty. The frequency of that error recently gave rise to the other issue to only show the error to the site admin, not end user. http://drupal.org/node/836582

Izzy

jusyjim’s picture

That quick fix worked for my 5.x version @ line 1573.

ShannonK’s picture

@steinmb

Your fix seems to have taken away the error message, however, the time appears to be wrong. Even after refresh, my time is stuck at 9:50 AM. Shouldn't it update to the current time when I refresh? Or, will it change after an hour and is not affected by refresh? (I can't remember what the behavior was before all the trouble started).

toddy’s picture

Dear Steinmb,

the changing of the download location by weather.noaa.gov seems most certainly be the problem, thank you very much for debugging this. I'll include your fix and will release a new version very soon, hopyfully tomorrow. I'll also include the change that the error message is not displayed to everybody.

Regards,
Tobias

steinmb’s picture

@ShannonK
The time used by the Weather module is the GMT time the METAR reading was done adjusted into your site time zone settings or your Weather module local setting. You can easily verify this by turning on “raw data” in you weather settings.

mradamjohn’s picture

@steinmb #11 seems to have been the ticket, thanks!

I also commented out drupal_set_message as average users and visitors are put off by this message. they are not on the site for weather data, its a nice-to-have.. not the purpose of the visit, in most cases.

logging in watchdog is good, perhaps a configurable alert method would be best..

thanks, all!

toddy’s picture

Status: Active » Fixed

This is fixed in CVS and will be released shortly. Thanks again to steinmb.

izmeez’s picture

Thanks.

I see also that the other issue of which users see the error message is also committed in http://drupal.org/node/836582

Thanks.

Status: Fixed » Closed (fixed)

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

ShannonK’s picture

Can we reopen this? I'm having the same error again, however, this time the solution in #11 didn't do anything. Anyone else experiencing this? My "Current Weather" block is showing a yellow question mark with a bullet point below saying "No data." ??

oscarjgarza’s picture

+1 - getting yellow question mark and no data after this having worked for a couple of weeks.