Closed (fixed)
Project:
Weather
Version:
5.x-5.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Dec 2007 at 20:53 UTC
Updated:
20 Nov 2008 at 10:32 UTC
i am running drupal 5.5 MySQL database 5.0.45, PHP 5.1.4, Unicode library PHP Mbstring Extension, Web server Apache, godaddy hosting. whenever i set the site wide block to one of the side bars i get multiple mysql warnings. ive attached the error message because it is really big. i get error messages at the top, center block and bottom of the page. it does this on all pages.
| Comment | File | Size | Author |
|---|---|---|---|
| error message.txt | 70.4 KB | sdierks |
Comments
Comment #1
Fr0s7 commentedAfter enabling the "Weather: system-wide" block, my site hangs for a minute or more (on every page), then I get this same error as well. I was only able to disable the block and get rid of the error by manually editing the database.
Because the queries are returning such big errors, I have a hunch this is a memory issue.
Note: The "Weather: custom user" and "Weather: location of nodes" blocks do not appear at all, regardless of the Location module.
Comment #2
Fr0s7 commentedDiagnosis
The FTP connection to nws.noaa.gov is timing out. The function "file_get_contents()" in weather.module does not handle the error very gracefully, so it gets caught by mysql. This causes other peripheral mysql errors which appear all over the page.
Here's the culprit:
Proposed Solution
The _weather_retrieve_data() function which calls file_get_contents() on line 1481 needs better error handling for time-out issues, and/or an alternative to noaa.gov should be found.
Workaround
Retrieving the METAR data using FTP doesn't seem to be working smoothly, due to connection problems. So, just bypass the FTP functions, and use HTTP instead.
This method of data retrieval is slower, but certainly seems more stable.
Comment #3
toddy commentedHi,
thanks a lot for your investigation. However, I think that your workaround should not be necessary, because the module automatically falls back to use HTTP if the FTP connection does not work. This is even saved in the database, so that HTTP will be used upon the next update request.
Regards,
Tobias
Comment #4
toddy commentedNo more input, thus closing.