dglent / meteo-qt

System tray application for weather status information
GNU General Public License v3.0
82 stars 21 forks source link

HTTP Error 429: Too Many Requests #162

Closed hardpenguin closed 3 weeks ago

hardpenguin commented 1 month ago

Hey there, today I am getting a bunch of:

WARNING: Error: HTTP Error 429: Too Many Requests - 2819: meteo_qt

Then it just keeps retrying in an infinite loop.

The app was working just fine yesterday. Any help?

hardpenguin commented 1 month ago

I looked up DEBUG logs and it looks like the OpenWeatherMap is returning:

{"cod":429, "message": "Your account is temporary blocked due to exceeding of requests limitation of your subscription type. Please choose the proper subscription https://openweathermap.org/price"}

But their pricing page says I should be good to go with 60 calls a minute: https://openweathermap.org/price

I would assume that they changed something in their API so meteo-qt keeps retrying requests expecting some specific reply but not getting it? And then it exceeds the limit.

hardpenguin commented 1 month ago

Yeah DEBUG returns:

Fetching url for 6 days:
(...)
Url of 6 days forcast not available:
(...)
6 days forcast not available: HTTP Error 401: Unauthorized

This goes in line with their pricing page:

  1. directing people to 3.0 version of the API, while meteo-qt uses 2.5
  2. mentioning that the free API access only offers: "Current Weather" and "3-hour Forecast 5 days"
mnadhro commented 1 month ago

@hardpenguin so do you have a way to solve this? thanks in advance

BeholdersEye commented 1 month ago

I would be fine with a five day forecast if that is all that the OpenWeatherMap will furnish at no cost.

However, using the Open-Meteo API feels like a natural fit for this project.

Open-Meteo is an open-source weather API and offers free access for non-commercial use. No API key required.

https://open-meteo.com/

hardpenguin commented 1 month ago

@hardpenguin so do you have a way to solve this? thanks in advance

@mnadhro the app needs to be modified and updated to take the changes in the OpenWeatherMap API into consideration.

Or like @BeholdersEye suggested, it would have to allow for the use of other API as source of the forecast.

That's a fair amount of work by @dglent or any other dev that wants to step up (not me).

In meanwhile I switched to the default Plasma weather applet which uses wetter.com or BBC Weather as a forecast source.

hardpenguin commented 1 month ago

One more thing, in the meanwhile I recommend turning off meteo-qt on your systems to avoid getting banned permanently for spamming requests.

dglent commented 3 weeks ago

Do you use a personal api key ? (it is better) Which version of meteo-qt ? Otherwise, with meteo-qt v3.3 i don't have any issue

hardpenguin commented 3 weeks ago

Do you use a personal api key ? (it is better) Which version of meteo-qt ? Otherwise, with meteo-qt v3.3 i don't have any issue

  1. Yes, I believe I have my own API key (I don't remember creating it but I have one input in the API key field in settings).
  2. My version of the app is 3.3-2.1 (Debian Sid)

I have started the app for the first time in over 2 weeks and the issue seems to be gone. Full logs:

2024/08/16 09:14:42 DEBUG: -------- START --------- - 1954: meteo_qt
2024/08/16 09:14:42 DEBUG: Warsaw_PL_756135 - 1973: meteo_qt
2024/08/16 09:14:42 DEBUG: Updating... - 1997: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetching url for 6 days: http://api.openweathermap.org/data/2.5/forecast/daily?id=756135&mode=xml&units=metric&APPID=<my_api_key>&cnt=7 - 2670: meteo_qt
2024/08/16 09:14:42 DEBUG: Url of 6 days forcast not available: http://api.openweathermap.org/data/2.5/forecast/daily?id=756135&mode=xml&units=metric&APPID=<my_api_key>&cnt=7 - 2694: meteo_qt
2024/08/16 09:14:42 DEBUG: 6 days forcast not available: HTTP Error 401: Unauthorized - 2695: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=756135&mode=xml&units=metric&APPID=<my_api_key> - 2698: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetching url for forecast of the day + 4: http://api.openweathermap.org/data/2.5/forecast?id=756135&mode=xml&units=metric&APPID=<my_api_key> - 2705: meteo_qt
2024/08/16 09:14:42 DEBUG: OneCall URL: http://api.openweathermap.org/data/2.5/onecall?lat=52.2298&lon=21.0118&exclude=current,minutely,hourly,daily&appid=<my_api_key>1 - 2770: meteo_qt
2024/08/16 09:14:42 ERROR: Your openweathermap key has no access to onecall api - 2781: meteo_qt
2024/08/16 09:14:42 DEBUG: Icon url: http://openweathermap.org/img/w/01d.png - 2790: meteo_qt
2024/08/16 09:14:42 DEBUG: Download thread done - 2839: meteo_qt
2024/08/16 09:14:42 DEBUG: Wind degrees direction: 270 - 929: meteo_qt
2024/08/16 09:14:42 DEBUG: Download forecast icons... - 1507: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetched 6 days forecast icons - 801: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetched day forecast data - 803: meteo_qt
2024/08/16 09:14:42 DEBUG: Download forecast icons for the day... - 1773: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetched day forcast icons - 805: meteo_qt
2024/08/16 09:14:42 DEBUG: Download uv info... - 1730: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetched uv index - 807: meteo_qt
2024/08/16 09:14:42 INFO: Actual weather status for: Warsaw PL 25.2°
Odczuwalna temperatura 25.57 °C
czyste niebo - 2431: meteo_qt
2024/08/16 09:14:42 DEBUG: Icon downloading: http://openweathermap.org/img/w/02d.png - 2969: meteo_qt
2024/08/16 09:14:42 DEBUG: Icon downloading: http://openweathermap.org/img/w/03d.png - 2969: meteo_qt
2024/08/16 09:14:42 DEBUG: Fetching url for uv index: http://api.openweathermap.org/data/2.5/uvi?lat=52.2298&lon=21.0118&appid=<my_api_key> - 2896: meteo_qt
2024/08/16 09:14:43 DEBUG: UV index: 5.75 - 2901: meteo_qt
2024/08/16 09:14:43 DEBUG: Fetching url for air pollution: http://api.openweathermap.org/data/2.5/air_pollution?lat=52.2298&lon=21.0118&appid=<my_api_key> - 2909: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/01d.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/04d.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Air pollution data: {'coord': {'lon': 21.0118, 'lat': 52.2298}, 'list': [{'main': {'aqi': 2}, 'components': {'co': 260.35, 'no': 1.22, 'no2': 5.57, 'o3': 52.21, 'so2': 3.7, 'pm2_5': 17.22, 'pm10': 20.16, 'nh3': 2.47}, 'dt': 1723792483}]} - 2913: meteo_qt
2024/08/16 09:14:43 DEBUG: UV gauge ◼: ◼◼◼◼◼◼ - 1761: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/01n.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/10d.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/01n.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/04d.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/01n.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Download forecast icons thread done - 2995: meteo_qt
2024/08/16 09:14:43 DEBUG: Icon downloading: http://openweathermap.org/img/w/01n.png - 2969: meteo_qt
2024/08/16 09:14:43 DEBUG: Download forecast icons thread done - 2995: meteo_qt
dglent commented 3 weeks ago

Strange why you had this error but hopefully it is ok now. In a such case you can generate another personal key to solve it. (you can apply this to have also the weather alerts https://github.com/dglent/meteo-qt/commit/1b64e862ac9ba8adfd5d41aa4027a6da629ecb29)