kotelnik / plasma-applet-weather-widget

Plasma 5 applet for displaying weather information from yr.no server.
GNU General Public License v2.0
88 stars 42 forks source link

Qml image: Network access is disabled. #6

Open octoploid opened 9 years ago

octoploid commented 9 years ago

Since the update to Plasma 5.4 Beta I get the following error:

/usr/share/plasma/plasmoids/org.kde.weatherWidget/contents/ui/FullRepresentation.qml:96:5: Qml image: Network access is disabled.

And the forecast image is not loaded anymore.

Loading it directly in browser works fine: http://www.yr.no/place/Germany/Berlin/Berlin/avansert_meteogram.png

Any ideas?

octoploid commented 9 years ago

Hmm, it is working again after a reboot...

octoploid commented 9 years ago

Looks like a local hiccup. Closing.

octoploid commented 9 years ago

Happened again after a new reboot. Reopening.

kotelnik commented 9 years ago

Thanks for reporting. Interesting, I probably won't have time to try this before plasma 5.4 is stable. But if I do I'll try to investigate. I also couldn't find anything useful in google search... Did you by any chance determined some steps to reliably reproduce this bug? Like after disconnecting and re-connecting wifi or after resume from RAM or something like that.

octoploid commented 9 years ago

My internet provider had some network issues. As a result packets got dropped randomly. So all you need to reproduce is a flaky internet connection....

kotelnik commented 9 years ago

Another similar report just came. That's it I'm installing testing packages right now... :-)

kotelnik commented 9 years ago

Hi! I've just installed vanilla Arch Linux (in virtualbox) with kde-unstable and testing enabled. So I have the latest plasma 5.4 and stuff. I'm trying out the widget along with disconnecting and connecting to the internet and so far no luck reproducing this bug... I also cannot reproduce the "Network access is disabled" message when I disconnect the internet... (I have something like "host not found")

Are you both (I mean octopoid and FedeDP) using Arch testing or some other distribution? Are you also using NetworkManager or something else?

octoploid commented 9 years ago

I'm running Gentoo. Network uses simple static route set up at boot (cable connected to router). NetworkManager is installed, but I never have used it.

kotelnik commented 9 years ago

Thanks. I tried also without networkmanager (so plasma-nm applet is not working) but still no luck with reproducing the bug. I wonder what setup has FedeDP because he is not able to update the widget at all after update to Plasma 5.4.

FedeDP commented 9 years ago

I'm running arch testing + kde-unstable with nm. I'm currently trying to rebuild the widget, let's see.

EDIT: still no luck...

EDIT2: uninstalling the applet, rebooting and rebuilding finally did the trick! It is working fine now!

kotelnik commented 9 years ago

Perfect! But still, octopoid has problems and they may arise again with connection problems so I leave this issue open for now...

FedeDP commented 9 years ago

It seems widget can only update first time it is added after a build. Now my widget is no more refreshing. Can't understand where the problem is (ie, why the first time it works and i could refresh the widget too, but now it doesn't).

kotelnik commented 9 years ago

That is really weird. I keep updating the testing/kde-unstable Arch linux and keep using the widget there and still no issues at all. I already tried installing it directly with "Get New Widgets" from panel but it is all the same like installing it from AUR. It survives restarts with no problem. I wonder if there can be issue with some kind of unstable internet connection like octopoid mentioned... Maybe it could somehow disable internet access for plasma but I really don't know. I hope I'll meet this issue myself eventually to be able to fix it.

FedeDP commented 9 years ago

I haven't got unstable internet connection. Where does the widget stores its data? So i'll delete config/cache or what else the widget stores before removing it. Then i'll reinstall it again.

kotelnik commented 9 years ago

The widget is using standard plasmoid.configuration map to store settings and cache. It seems that these data (for all widgets) are located in a single file (maybe with some backups around) - here in this file: ~/.config/plasma-org.kde.plasma.desktop-appletsrc

This file contains a lot of sections with "[Containments]" in the beginning. You probably want to delete only such sections which contains e.g. "xmlCacheJson=" because that is one of the settings-key the weather widget is using. By section I mean from [Containments] ... to an empty line.

You can of course delete the whole file but you'll probably lose all panel & widget settings.

FedeDP commented 9 years ago

Ok, i had a look at ~/.config/plasma-org.kde.plasma.desktop-appletsrc, and i started to cry. Your widget filled that file of weather data. I spent 20 mins cleaning it. The file size was 400Kb, now is 12Kb. Is there any way to avoid this thing? (i know, this is totally unrelated. Should i open a new issue?)

kotelnik commented 9 years ago

I think it fills it every time it is added to a different place in panel or desktop (or systray). That is probably why there is no widget names in this file. This would probably do any other widget if you'd place it multiple times in panel or desktop. So if anything it would be an issue for plasma itself (imo). There should be a way to remove e.g. all weatherWidget's (or any other named widget) configurations for plasma.

On the other hand I'm not sure where the weather cache itself should be located. I placed it to the "configuration" because its behaviour is the same like any other widget settings and that's good.

You can for example have weatherWidget with your home town placed on desktop and second weatherWidget placed on panel with another city displayed. This is what plasma widgets should be able to do. If I place my cache anywhere else to my proprietary location I would have to handle these situations myself.

To your question - I don't think there is a way to avoid piling up these settings in mentioned file. For now.

nowrep commented 9 years ago

@kotelnik In that case I think you should disable the cache for now. It really is not a good idea to store cache in appletsrc.

You should use C++ plugin and store the cache in appropriate cache location, for identifying plasmoids you can use plasmoid.id (unique ID of plasmoid instance) from QML.

kotelnik commented 9 years ago

OK, I'll try to make thinks right with the C++ extension.

FedeDP commented 9 years ago

I'm trying the applet again after some months, and i'm still having this issue. Applet won't update even if i click on "reload". I'm using connman (may be you rely on some networkmanager dependent check about connection? I guess no, but it may help you).

EDIT: starting it from konsole with "plasmawindowed org.kde.weatherWidget", runs fine. But if i normally add a new weather applet, it won't work. It seems it works only the first time the applet is added to the system (ie: after the build, and before a reboot). In fact, i guess "plasmawindowed org.kde.weatherWidget" makes it run in a "temp" environment, as if it was the first time i added it.

kotelnik commented 9 years ago

Thanks a lot for all the testing and effort to narrow the issue down. I'm still unable to reproduce. But I found somewhat similar problem with owncloud (https://github.com/owncloud/client/issues/3600). They say it could be caused by an 'improvement' in Qt 5.5.

I know it's not pleasant but could you temporarily downgrade Qt to version 5.4 and try again? Plasma should be dependent on Qt 5.4+ so this part should be OK.

nowrep commented 9 years ago

Yes, looks like https://bugreports.qt.io/browse/QTBUG-46323 - fixed in 5.5.2

FedeDP commented 9 years ago

@kotelnik i'm gonna wait until 5.5.2 before trying to downgrade, as it seems a well known issue. There's no official date for 5.5.2 though.

kotelnik commented 9 years ago

OK, hopefully 5.5.2 will fix the issue.

FedeDP commented 9 years ago

I installed networkmanager, and it seems the widget now works (it survived 2 reboots!). Great :) May be networkmanager-qt (5.15.0-1) workarounded the well known qt issue?

nowrep commented 9 years ago

networkmanager-qt has nothing to do with it.

FedeDP commented 9 years ago

Thanks for the clarification, then i don't know what could have solved the issue for me.

FedeDP commented 8 years ago

And...the issue is back. But somewhat different now: it seems the widget keeps updating, but it do not notice it. An image will explain myself better. screenshot_20151204_102656

As you can see, it is updated (tomorrow is "saturday"), but in the bottom left it keeps saying "3d ago".

kotelnik commented 8 years ago

This is standard behaviour for not updated data. The widget is using the cached data to show today's weather but the data are in fact 3 days old. I'd say the issue is still the same...

kotelnik commented 8 years ago

I mean the showed weather for today is correct for today according to 3 days old data.

FedeDP commented 8 years ago

Yes, i forgot about cached data, i'm stupid, sorry. So...let's keep waiting for qt 5.5.2 :)

christophschw commented 8 years ago

I'm still facing the same issue... What about you guys? Under Manjaro it works but unfortunateley not under Fedora 24. Any suggestions? Thanks!

gbcox commented 8 years ago

There is now a fedora rpm for this: plasma-applet-weather-widget-1.6.7-4.fc24.x86_64 I haven't noticed problems with updating.

christophschw commented 7 years ago

Sorry for the late reply. I use the Fedora rpm. I tried to debug the app and launched it in windowed mode over one day – no issues. In my panel it's hanging after around half a day. I can't hit the reload button (nothing happens) and logging out / in doesn't solve the issue.

How can I debug the plasmoid? Thanks!

Niklas81 commented 7 years ago

It hangs for me as well after some time, when running in the panel. I'm on Antergos (Arch). Has this issue been dropped? It's been open since august 2015 but still isn't resolved. It's a pity as this is otherwise an excellent widget if only the update process didn't hang and start chewing on my cpu...