Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather icon, temperature come up only some of the time on panel restart #603

Closed
lukefromdc opened this issue Jun 29, 2017 · 30 comments
Closed

Comments

@lukefromdc
Copy link
Member

lukefromdc commented Jun 29, 2017

Expected behaviour

If "show weather" is checked in clock-preferences, always show the weather icon when the panel starts
if "show temperature" is checked, always show the temperature when the panel starts

Actual behaviour

The weather icon and temperature sometimes are displayed on a panel start and sometimes not. The weather icon almost always comes up, but the temperature usually does not. It made no difference in my tests if only the temperature or both were selected. Going into the clock preferences, deselecting, then reselecting them will always bring them up as they are redrawn.

Steps to reproduce the behaviour

Add a location to the calendar so weather can be fetched from a server
Open clock-preferences, check "show weather," and "show temperature," these can be tested together or separately with same results

MATE general version

1.19 from git master or branches therof

Package version

locally compiled mate-panel from ev-img-background-fixes branch as of June 29, 2017 but June 7 git master (before the background work) gave the same result. Panel background type (system,color, image) made no difference, neither did gtk theme.

Linux Distribution

Debian Unstable with locally compiled gtk 3.22.15 (no change with 3.22.16) and glib 2.53.3


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@lukefromdc lukefromdc mentioned this issue Jun 29, 2017
@monsta
Copy link
Contributor

monsta commented Sep 20, 2017

I can confirm this, it happens on panel restart, but not always. Using Debian Stretch. I don't remember when it started...

@vfscanf
Copy link
Contributor

vfscanf commented Dec 6, 2017

This also happens with the dedicated Weather widget, and not only when the panel restarts. It can happen every time the weather applet reloads the weather information. Sometimes it fails and will only show "--". If I click on reload it fixes it.
It is likely that the bug is actually in libmateweather.

I can remember that the GNOME weather applet had the exact same problem, and it was due to the weather service not always returning information. In that case, the code didn't retry but waited a certain time before trying again, due to terms and conditions of the weather service. I think they fixed it by keeping the old information around until the weather service worked again. I'll look into this.

@lukefromdc
Copy link
Member Author

Workaround for situations where there is no old information (or it is too old and should not be displayed) could be a "waiting" icon and/or text, and a "waiting for weather service" tooltip.

@vfscanf
Copy link
Contributor

vfscanf commented Dec 6, 2017

It would be best to have a defined threshold, after which the weather applet changes to the loading icon if we not get valid weather information in that timeframe. This approach is more resilient to temporary failures but also avoids showing the user outdated weather information, if the service has a longer outage.

@lukefromdc
Copy link
Member Author

Good idea, show recent but not outdated information if available, and the weather service not responding or cannot yet be queried

@vfscanf
Copy link
Contributor

vfscanf commented Dec 6, 2017

If I look through the journal (syslog) I can see some of these messages:

mateweather-app[883]: METAR-Daten konnten nicht geholt werden: 502 Proxy Error.

It looks like the weather provider sometimes gives an error 502. Can somebody confirm this, or maybe look through their system logs for similar errors?

@monsta
Copy link
Contributor

monsta commented Dec 7, 2017

The clock applet actually keeps showing the last retrieved info after the network problem happens. The weather tooltip doesn't work at that time though (shows clock's general tooltip about the calendar). Also if you open the calendar, the weather icons in the locations list are missing. Of course it works that way only when there's some old info available, not when the applet just started.

I saw error 502 a few times, but recently it doesn't show up in the log while the weather still doesn't load. Looks more like a slow connection, maybe timing out, I don't know.

@Safari77
Copy link
Contributor

I changed location, testing Houston. Tooltip does not appear, icons do not appear in the panel (but in the calendar page it shows the scattered clouds icon...)
Toggling show weather/temperature or restarting mate-panel does not make it work, either.

If I change location, the panel is too stupid to fetch new data.

I added there a debug info, it received metar info OK but doesn't wanna show it.

(mate-panel:2144295): MateWeather-WARNING **: metar_parse [ext>KIAH 221831Z 34012G21KT 10SM SCT027 SCT250 19/13 A3005]

test_metar

Returned info:
  update:   Sun Apr 22 21:31:00 2018
  sky:      Scattered clouds
  cond:     -
  temp:     19.0 °C
  dewp:     13.0 °C
  humidity: 68%
  wind:     North - Northwest / 6.2 m/s
  pressure: 1017.49 hPa
  vis:      16093m

Then some debugs to mate-panel.

2018-04-22 22:57:37.579192043 (mate-panel:2215196): MateWeather-WARNING **: _weather_info_fill info=(nil)/reqs=0 location=0x55d83786f7b0/name=Helsinki,code=EFHF prefs=0x7ffdf973e0c0
2018-04-22 22:57:37.628208090 (mate-panel:2215196): MateWeather-WARNING **: metar_start_open stationString=EFHF reqs=0
2018-04-22 22:57:37.628208650 ** (mate-panel:2215196): WARNING **: weather_info_updated 377s
2018-04-22 22:57:37.754199334 ** (mate-panel:2215196): WARNING **: weather_info_updated 536s
2018-04-22 22:57:37.754199734 (mate-panel:2215196): MateWeather-WARNING **: _weather_info_fill info=0x55d836f76680/reqs=0 location=(nil)/name=,code= prefs=0x7ffdf973dab0
2018-04-22 22:57:37.754207074 (mate-panel:2215196): MateWeather-WARNING **: metar_start_open stationString=EFHF reqs=0
2018-04-22 22:57:37.754277889 ** (mate-panel:2215196): WARNING **: weather_info_updated 538s
2018-04-22 22:57:37.754278239 (mate-panel:2215196): MateWeather-WARNING **: _weather_info_fill info=0x55d836f76680/reqs=0 location=(nil)/name=,code= prefs=0x7ffdf973dab0
2018-04-22 22:57:37.754278758 (mate-panel:2215196): MateWeather-WARNING **: metar_start_open stationString=EFHF reqs=0
2018-04-22 22:57:37.764984860 ** (mate-panel:2215196): WARNING **: weather_info_updated 670s
blah blah
2018-04-22 22:57:38.485038015 ** (mate-panel:2215196): WARNING **: weather_info_updated 1580s

And no weather info displayed, naturally.
set_weather_update_timeout prints priv->weather_timeout.

@Safari77
Copy link
Contributor

Safari77 commented Apr 22, 2018

Very funny! Look:
metar_finish p=<raw_text>KIAH 222153Z 29009KT 10SM FEW040 FEW250 22/12 A2998 RMK AO2 SLP152 T02220122</raw_text>
metar_parse gets this string ext>KIAH 222153Z 29009KT 10SM FEW040 FEW250 22/12 A2998

because you do
p += WEATHER_LOCATION_CODE_LEN + 2;
instead of
p += strlen("<raw_text>XXXX ");

Also, metar_parse gets also the trailing </raw_text>\u000d if there is no RMK string in it... Hmm I wonder has someone coded a xml parser before which you could use 🤔

I found a difference why sometimes weather is not shown, for example Houston airport:

2018-04-23 01:39:35.743856155 (mate-panel:2252185): MateWeather-WARNING **: request_done ok=1
2018-04-23 01:39:35.743892302 (mate-panel:2252185): MateWeather-WARNING **: request_done calling cb=0x561106a5d9a0
2018-04-23 01:39:35.743902662 (mate-panel:2252185): MateWeather-WARNING **: request_done called cb=0x561106a5d9a0

does not show weather in panel...

Then I edit location to Vantaa (EFHK):

2018-04-23 01:40:17.361496893 (mate-panel:2252185): MateWeather-WARNING **: request_done ok=1
2018-04-23 01:40:17.361509302 (mate-panel:2252185): MateWeather-WARNING **: request_done calling cb=0x561107107cd0
2018-04-23 01:40:17.361524281 (mate-panel:2252185): MateWeather-WARNING **: weather_info_get_icon_name valid=1
2018-04-23 01:40:17.361784113 (mate-panel:2252185): MateWeather-WARNING **: request_done called cb=0x561107107cd0

I get valid METAR for Houston, but..?! weather_info_get_icon_name not called.

@Safari77
Copy link
Contributor

location_weather_updated_cb returns because clock_location_is_current(location)==false, even though metar was parsed ok. Maybe it could do something smarter than just returning.

@lukefromdc
Copy link
Member Author

Could some of the other devs take a look at this? @raveit65 ? @monsta ?

@monsta
Copy link
Contributor

monsta commented Apr 24, 2018

This code in libgweather seems to do the same, so I guess it works after all.

@muktupavels
Copy link
Contributor

I would say that it is also bug in libgweather...

https://gitlab.gnome.org/GNOME/libgweather/commit/283afc2d23355def1c1bab70a641f40cea52ba7f

searchkey was changed, but + 2 remained same... it probably should be:
p += 10 + WEATHER_LOCATION_CODE_LEN + 1;

also it probably should not search for \n, but for </raw_text>...

@Safari77
Copy link
Contributor

Looking for XML tag raw_text should be good enough, I wouldn't want to dependency on libxml2 etc.

@monsta
Copy link
Contributor

monsta commented Apr 26, 2018

Ah, I see. Forgot about that fix already. Not sure if it affects parsing though, as regex probably does its job anyway. But I'll try to correct this.

@monsta
Copy link
Contributor

monsta commented Apr 26, 2018

Actually, libxml is already required for handling locations file...

@muktupavels
Copy link
Contributor

It does not affect parsing...

@monsta
Copy link
Contributor

monsta commented Apr 26, 2018

Ok, it's in mate-desktop/libmateweather#55. Doesn't seem to correct the main issue for me though.

@lukefromdc
Copy link
Member Author

At the moment I'm not getting the issue anymore with the same weather station originally tested, but that could relate to remote reliability I suppose

@lukefromdc
Copy link
Member Author

With mate-desktop/libmateweather#55 merged, we can close this if nobody else gets this issue back. I don't normally use the weather features, so will test one more time after rebuilding but would not see this in daily use

@monsta
Copy link
Contributor

monsta commented Apr 28, 2018

No, the issue is still present. I'm getting another version of it: the icon is shown right away, but the number (temperature) is shown a few seconds later. The tooltip shows the full info though.

@lukefromdc
Copy link
Member Author

OK, we have a partial fix. What I originally got was a complete refusal of any icons or numbers to show at all until the panel was restarted. Still, if the tooltip has current information it should be on the panel, so this is probably another delayed redrawing issue

@monsta
Copy link
Contributor

monsta commented May 1, 2018

I've picked latest libmateweather fixes to 1.18 branch and tested it in older systems with GTK+ 3.14 and 3.18. This problem doesn't happen there. I'll check another VM which also has 1.18 but GTK+ 3.22, to see if the problem is in mate-panel 1.19/1.20 or in GTK+.

@monsta
Copy link
Contributor

monsta commented May 1, 2018

Ok, the problem happens with 1.18 and GTK+ 3.22...

@monsta
Copy link
Contributor

monsta commented Dec 27, 2018

Now this really gets in the way of testing #901... the initial icon appears cropped from left and right, so I have to wait until temperature appears - then the icon is redrawn in full size.

@monsta
Copy link
Contributor

monsta commented Dec 27, 2018

It wouldn't be so annoying, but we have more bugs here: currently the weather icon doesn't seem to react to panel size change and icon theme change, so I have to restart the panel after any of these changes.

@msplival
Copy link

This is still an issue... running Mate 1.20 on UbuntuMATE 18.04.

@vfscanf
Copy link
Contributor

vfscanf commented Jun 15, 2020

Since a few days, the weather information in the clock applet doesn't load at all. But it seems to be an issue with the weather provider, because the standalone weather applet doesn't work either.

Edit: There already is a bug report for this: mate-desktop/libmateweather#80

@raveit65
Copy link
Member

Does the issue still exists?

@vfscanf
Copy link
Contributor

vfscanf commented Jul 21, 2023

I've not had this problem in quite a while, so for me at least it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants