dglent / meteo-qt

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

Error 401 Unauthorized #129

Closed aldobelus0 closed 1 year ago

aldobelus0 commented 2 years ago

When I try to configure the place, in the box where we have to insert the ID, or the place, or its name, or the longitude and latitude, no matter what I insert of this options, it responds with

Error 401 Unauthorized
Intentelo de nuevo más tarde

(try again later, in english)

What should I do? Is there a way to solve this behavior?

dglent commented 2 years ago

Hello

Check if you have the latest version and try then to create à personal openweathermap key from the settings dialogue

aldobelus0 commented 2 years ago

I've installed the version on my system, Ubuntu 20.04. This should do the trick, isn't it?

dglent commented 2 years ago

I don't know which version of the meteo-qt Ubuntu offerts. Check with right click > About But in any case it is better to have à personal key...

aldobelus0 commented 2 years ago

I repeat that, when I arrive to the settings place, where you can read: "Start typing the city or the ID or the geographic coordinates "latitude, longitude", I can do anyone of those and the result is always the same:

Error 401 Unauthorized
Intentelo de nuevo más tarde

About your question, the version is 1.5, if I'm no mistaken.

https://i.imgur.com/eE9numU.png

But in any case it is better to have à personal key...

The key has no sense at this step of the setting, because it must be included on other part of the program. Before to set the OpenWeather key, you have to determine where is your location, and this is impossible so far because of the problem related above.

https://imgur.com/MTvMoaO

dglent commented 2 years ago

Latest version is 3.2

I don't remember if there was à specific fix for this error message since the version 1.5

However you cannot contact openweathermap to search for the city because thé default key of the version 1.5 is invalid now. So, create a key, add it in the settings, wait à few minutes to be activated by openweathermap and then try again it should work

dglent commented 2 years ago

Check the changelog from version 1.5 to 3.2 here:

https://github.com/dglent/meteo-qt/releases

You can also download the latest version from here, unzip and then run python meteo_qt.py or install with python setup.py install (python 3)

aldobelus0 commented 2 years ago

Latest version is 3.2

I don't remember if there was à specific fix for this error message since the version 1.5

However you cannot contact openweathermap to search for the city because thé default key of the version 1.5 is invalid now. So, create a key, add it in the settings, wait à few minutes to be activated by openweathermap and then try again it should work

I already did that. It didn't work. In fact, I told you I already did it. It's shown in this image.

https://imgur.com/MTvMoaO

I will try to install other version, more updated.

dglent commented 2 years ago

This is impossible. You need a key first in order to add a city And if the key is invalid you will have the 401 Unauthorized error.

Try to open the following url with your key (replace the xxx with your key - don't show your key, keep it private):

https://api.openweathermap.org/data/2.5/weather?id=3035639&mode=xml&units=metric&APPID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

finjulhich commented 1 year ago

I have a key for a free subscription. It seems
Fetching url for 6 days => unauthorized Fetching url for actual weather => works Fetching url for forecast of the day + 4:=> works DEBUG: OneCall URL: I think fails

and then it repeatedly tries every minute or so. and it never shows the applet.

Is there a way to make the py script query just for the actual weather?

dglent commented 1 year ago

You use a personal created key or the key present already in meteo-qt ?

finjulhich commented 1 year ago

personal

finjulhich commented 1 year ago

personal key

On Mon, 5 Dec 2022 at 05:20, Dimitrios Glentadakis @.***> wrote:

You use a personal created key or the key present already in meteo-qt ?

— Reply to this email directly, view it on GitHub https://github.com/dglent/meteo-qt/issues/129#issuecomment-1336767312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB67QO5ZQNYWLED5CPUZXLDWLV3Q5ANCNFSM52MLJLQA . You are receiving this because you commented.Message ID: @.***>

dglent commented 1 year ago

Can you show/send me the log file ? ~/.config/meteo-qt/meteo-qt.log ***remove your key from the file

finjulhich commented 1 year ago

This is repeated multiple times

2022/12/28 17:44:11 DEBUG: -------- START --------- - 1954: meteo_qt
2022/12/28 17:44:11 DEBUG: London_GB_2643743 - 1973: meteo_qt
2022/12/28 17:44:11 DEBUG: Updating... - 1997: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for 6 days: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2670: meteo_qt
2022/12/28 17:44:11 DEBUG: Url of 6 days forcast not available: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2694: meteo_qt
2022/12/28 17:44:11 DEBUG: 6 days forcast not available: HTTP Error 401: Unauthorized - 2695: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=2643743&mode=xml&units=metric&APPID=myappid - 2698: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for forecast of the day + 4: http://api.openweathermap.org/data/2.5/forecast?id=2643743&mode=xml&units=metric&APPID=myappid - 2705: meteo_qt
2022/12/28 17:44:11 DEBUG: OneCall URL: http://api.openweathermap.org/data/2.5/onecall?lat=51.5085&lon=-0.1257&exclude=current,minutely,hourly,daily&appid=myappid - 2770: meteo_qt
2022/12/28 17:44:11 WARNING: Error: HTTP Error 401: Unauthorized - 2817: meteo_qt
2022/12/28 17:44:11 INFO: Try again...1 - 2818: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for 6 days: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2670: meteo_qt
2022/12/28 17:44:11 DEBUG: Url of 6 days forcast not available: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2694: meteo_qt
2022/12/28 17:44:11 DEBUG: 6 days forcast not available: HTTP Error 401: Unauthorized - 2695: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=2643743&mode=xml&units=metric&APPID=myappid - 2698: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for forecast of the day + 4: http://api.openweathermap.org/data/2.5/forecast?id=2643743&mode=xml&units=metric&APPID=myappid - 2705: meteo_qt
2022/12/28 17:44:11 DEBUG: OneCall URL: http://api.openweathermap.org/data/2.5/onecall?lat=51.5085&lon=-0.1257&exclude=current,minutely,hourly,daily&appid=myappid - 2770: meteo_qt
2022/12/28 17:44:11 WARNING: Error: HTTP Error 401: Unauthorized - 2817: meteo_qt
2022/12/28 17:44:11 INFO: Try again...2 - 2818: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for 6 days: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2670: meteo_qt
2022/12/28 17:44:11 DEBUG: Url of 6 days forcast not available: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2694: meteo_qt
2022/12/28 17:44:11 DEBUG: 6 days forcast not available: HTTP Error 401: Unauthorized - 2695: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=2643743&mode=xml&units=metric&APPID=myappid - 2698: meteo_qt
2022/12/28 17:44:11 DEBUG: Fetching url for forecast of the day + 4: http://api.openweathermap.org/data/2.5/forecast?id=2643743&mode=xml&units=metric&APPID=myappid - 2705: meteo_qt
2022/12/28 17:44:11 DEBUG: OneCall URL: http://api.openweathermap.org/data/2.5/onecall?lat=51.5085&lon=-0.1257&exclude=current,minutely,hourly,daily&appid=myappid - 2770: meteo_qt
2022/12/28 17:44:11 WARNING: Error: HTTP Error 401: Unauthorized - 2817: meteo_qt
2022/12/28 17:44:11 INFO: Try again...3 - 2818: meteo_qt
2022/12/28 17:44:12 DEBUG: Fetching url for 6 days: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2670: meteo_qt
2022/12/28 17:44:12 DEBUG: Url of 6 days forcast not available: http://api.openweathermap.org/data/2.5/forecast/daily?id=2643743&mode=xml&units=metric&APPID=myappid&cnt=7 - 2694: meteo_qt
2022/12/28 17:44:12 DEBUG: 6 days forcast not available: HTTP Error 401: Unauthorized - 2695: meteo_qt
2022/12/28 17:44:12 DEBUG: Fetching url for actual weather: http://api.openweathermap.org/data/2.5/weather?id=2643743&mode=xml&units=metric&APPID=myappid - 2698: meteo_qt
2022/12/28 17:44:12 DEBUG: Fetching url for forecast of the day + 4: http://api.openweathermap.org/data/2.5/forecast?id=2643743&mode=xml&units=metric&APPID=myappid - 2705: meteo_qt
2022/12/28 17:44:12 DEBUG: OneCall URL: http://api.openweathermap.org/data/2.5/onecall?lat=51.5085&lon=-0.1257&exclude=current,minutely,hourly,daily&appid=myappid - 2770: meteo_qt
2022/12/28 17:44:12 WARNING: Error: HTTP Error 401: Unauthorized - 2817: meteo_qt
2022/12/28 17:44:12 INFO: Try again...4 - 2818: meteo_qt
dglent commented 1 year ago

It seems that the Free personal key has no access to the onecall api any more (but old keys still work) The above commit is to handle this case and let the application running

dglent commented 3 weeks ago

Fix for onecall: https://github.com/dglent/meteo-qt/commit/1b64e862ac9ba8adfd5d41aa4027a6da629ecb29