Bug 1302658 - evolution --force-online delays to go online
evolution --force-online delays to go online
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: evolution (Show other bugs)
23
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Milan Crha
Fedora Extras Quality Assurance
:
: 1352195 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-28 05:35 EST by Jiri Prajzner
Modified: 2016-07-04 05:04 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-04 04:00:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test-nm.c (2.12 KB, text/plain)
2016-01-29 02:47 EST, Milan Crha
no flags Details

  None (edit)
Description Jiri Prajzner 2016-01-28 05:35:04 EST
Description of problem:
evolution --force-online doesn't work as expected; after the evo startup, I have to confirm that I really want to work online so the finally evo uses the readily available network connection and starts syncing.

Version-Release number of selected component (if applicable):
3.18.4

How reproducible:
Always

Steps to Reproduce:
1. execute evolution --force-online
2. 
3.

Actual results:
I have to click "Work online" and the following is printed out:

evolution --force-online &
[1] 3516
[jprajzne@dhcp-10-40-0-213 ~]$ evolution-shell-Message: Network disconnected.  Forced offline.
evolution-shell-Message: Connection established.  Going online.
No bp log location saved, using default.
[000:000] Cpu: 6.60.3, x8, 3800Mhz, 15737MB
[000:000] Computer model: Not available
[000:000] Browser XEmbed support present: 1
[000:000] Browser toolkit is Gtk2.
[000:003] Using Gtk2 toolkit
No bp log location saved, using default.
[000:000] Cpu: 6.60.3, x8, 3800Mhz, 15737MB
[000:000] Computer model: Not available

(evolution:3516): GLib-GIO-CRITICAL **: g_network_address_set_addresses: assertion 'addresses != NULL && addr->priv->sockaddrs == NULL' failed

Expected results:
Evo simply connects without asking for confirmation if to go online or not and the critical assertion failure passes.

Additional info:
I don't have any special network setup, but I do have both wifi and ethernet connections enabled if that makes any difference.
Comment 1 Milan Crha 2016-01-28 06:32:10 EST
Thanks for a bug report. The two messages:
> evolution-shell-Message: Network disconnected.  Forced offline.
> evolution-shell-Message: Connection established.  Going online.
are just it. The first means that the GNetworkMonitor reported no network availability. The second is a reaction on --force-online call.

How exactly the GNetworkMonitor works I do not know, it's part of GLib (gio). I think it uses netlink or something similar, talking to kernel to know network availability. usually, when the connections are managed by a NetworkManager, the network availability detection works properly.

The runtime warning:
> (evolution:3516): GLib-GIO-CRITICAL **: g_network_address_set_addresses:
> assertion 'addresses != NULL && addr->priv->sockaddrs == NULL' failed
is discussed here:
https://bugzilla.gnome.org/show_bug.cgi?id=748996
Comment 2 Jiri Prajzner 2016-01-28 09:27:37 EST
That gnome bz is sad to read.
See, I have to press "work online" to actually get it working for real.
Furthermore, I can't just start Evolution from Activites and have it in online mode. I had to modify the launcher and add the --force-online option to avoid launching it from CLI every time like that.
Is there an option to switch the Evolution back to online mode while it starts in offline mode please?
It's unpleasant experience.
Comment 3 Milan Crha 2016-01-29 02:37:34 EST
(In reply to Jiri Prajzner from comment #2)
> Is there an option to switch the Evolution back to online mode while it
> starts in offline mode please?

It's the --force-online option you already use. You can try also --online, but I do not think it will help.

> It's unpleasant experience.

I understand, but you've something odd in your networking setup that GNetworkMonitor doesn't detect the network as available. Everything else is just a fallout of this.
Comment 4 Milan Crha 2016-01-29 02:47 EST
Created attachment 1119374 [details]
test-nm.c

Here is a test program which opens and checks whether GNetworkMonitor considers www.gnome.org reachable or not. It reacts on network changes (like when vpn is run or stopped), if they are detected by the GNetworkMonitor internals.

The first line of the file contains how to compile and run it. The GIO (from glib2) offers a way to override which network monitor should be used. It can be used like this:
   $ GIO_USE_NETWORK_MONITOR=netlink ./test-nm
other available values are 'base' and 'networkmanager'. If you write a wrong name, it'll tell you that. I'm not sure which one is the default value, it's probably detected in runtime somehow (I do not develop in glib2).

If I recall correctly, the 'base' option pretends that everything always works.
Comment 5 Milan Crha 2016-01-29 02:49:18 EST
By the way, any application using GNetworkMonitor will be affected, not only the evolution. It can be also evolution-data-server calendars and books, to name some I know about for sure.
Comment 6 Jiri Prajzner 2016-01-29 05:50:45 EST
(In reply to Milan Crha from comment #3)
> (In reply to Jiri Prajzner from comment #2)
> > Is there an option to switch the Evolution back to online mode while it
> > starts in offline mode please?
> 
> It's the --force-online option you already use. You can try also --online,
> but I do not think it will help.
> 

That apparently does not work without further action from my side - as I've described, I have to click on "Work online" button in GUI.
What I'd like to see is:
- the --force-online works without further confirmation in GUI
- there actually is an option in GUI where I can toggle online / offline mode. As far as I know, there's currently only the option to go offline, and the online status is (often wrongly?) detected "automagically".
> > It's unpleasant experience.
> 
> I understand, but you've something odd in your networking setup that
> GNetworkMonitor doesn't detect the network as available. Everything else is
> just a fallout of this.

None of the other applications suffers from this problem. That being said, I would truly appreciate if this has got some love, because it needs a whole lot of it.

Here's the output of test-nm with different providers:
[jprajzne@dhcp-10-40-0-213 ~]$ export GIO_USE_NETWORK_MONITOR=netlink
[jprajzne@dhcp-10-40-0-213 ~]$ ./test-nm 
[2016-01-29T10:45:50.216380Z] network_available_cb: available:1
[2016-01-29T10:45:50.254107Z] network_available_cb: www.gnome.org:80 reachable:1 
^C
[jprajzne@dhcp-10-40-0-213 ~]$ export GIO_USE_NETWORK_MONITOR=base
[jprajzne@dhcp-10-40-0-213 ~]$ ./test-nm 
[2016-01-29T10:46:13.185742Z] network_available_cb: available:1
[2016-01-29T10:46:13.228800Z] network_available_cb: www.gnome.org:80 reachable:1 
^C
[jprajzne@dhcp-10-40-0-213 ~]$ export GIO_USE_NETWORK_MONITOR=networkmanager
[jprajzne@dhcp-10-40-0-213 ~]$ ./test-nm 
[2016-01-29T10:46:28.315611Z] network_available_cb: available:0

If I run it without exporting the GIO_USE_NETWORK_MONITOR variable, it reports the same status as if I use networkmanager value.

What else can I provide to get this improved / fixed please?
Comment 7 Milan Crha 2016-02-01 06:24:52 EST
(In reply to Jiri Prajzner from comment #6)
> That apparently does not work without further action from my side - as I've
> described, I have to click on "Work online" button in GUI.

Yes, I understood it, and it's a reason why I didn't close this yet. I've some more important issues to be fixed, then I'll look on this one.

> [jprajzne@dhcp-10-40-0-213 ~]$ export GIO_USE_NETWORK_MONITOR=networkmanager
> [jprajzne@dhcp-10-40-0-213 ~]$ ./test-nm 
> [2016-01-29T10:46:28.315611Z] network_available_cb: available:0
> 
> If I run it without exporting the GIO_USE_NETWORK_MONITOR variable, it
> reports the same status as if I use networkmanager value.

Okay. That means that the default GNetworkMonitor is used the network manager and it does not understand your connection settings. I would, as an easier workaround, suggest to add
   GIO_USE_NETWORK_MONITOR=netlink
into
   /etc/environment
and then restart the machine. After that you'll not need to modify the evolution.desktop file. It'll be used as a temporary workaround.
Comment 8 Jiri Prajzner 2016-02-01 06:39:59 EST
(In reply to Milan Crha from comment #7)
> (In reply to Jiri Prajzner from comment #6)
> > That apparently does not work without further action from my side - as I've
> > described, I have to click on "Work online" button in GUI.
> 
> Yes, I understood it, and it's a reason why I didn't close this yet. I've
> some more important issues to be fixed, then I'll look on this one.

Thanks for that :)
Comment 9 Milan Crha 2016-02-02 10:23:32 EST
I tried to reproduce it here, I even broke GNetworkMonitor::networkmanager in a way that it always reported no connection available, thus I've got the same result as you with the test-nm test program, but for me the
   $ evolution --force-online
properly sets the evolution to online. I also see those
> evolution-shell-Message: Network disconnected.  Forced offline.
> evolution-shell-Message: Connection established.  Going online.
when I run evolution that way, though not the critical warnings from the GNetworkAddress structure.

What I noticed (and forgot earlier) is how the switch to online works. The thing is that the evolution is not set online immediately, but after approximately 5 seconds (the idea behind the delay is that the connection changes use to be fired quickly in some "groups", thus reacting on each of them is not a good idea). After this delay the status bar shows "Preparing online" and evolution connects to each configured mail account. Once that's done the notice to "Work Online" is hidden and the status-bar plug button (on the very left side) plugs together, indicating an online state.

Thus I guess either the delay is too long for you, or some of the accounts have some issue connecting, which prevents the "preparation to go online" finish quickly.

Could you verify the above things, that they are the same for you too, please?
Comment 10 Jiri Prajzner 2016-02-03 05:24:22 EST
You're correct - the notice "Work online" disappears after a while. My bad.
What can be done about the fact that I (we?) need to force Evo online please? I can provide details abot my system if you request some.
Comment 11 Milan Crha 2016-02-04 04:00:17 EST
That's question for glib2 or NetworkManager folks. Better to open a new bug report, eventually reference comment #4 and comment #6 there for easier reproducer, and they will tell you. My guess is that the NetworkManager doesn't manage your connections, thus it reports network as unavailable. Once you convince NetworkManager about the network it'll all start working flawlessly. The question for glib2 folks would be how to convince the GNetworkMonitor to use netlink, rather than networkmanager interface for network detection on your machine, other than adding GIO_USE_NETWORK_MONITOR=netlink into /etc/environment (see the end of comment #7).
Comment 12 Milan Crha 2016-02-04 05:42:10 EST
I made a little change in the evolution to avoid the delay when using
--force-online for 3.19.90+ [1]. It doesn't fix the issue with the connection detection, only with the delay on start.

By the way, the issue with GNetworkManager doesn't influence only the Mail part, but also all the other parts of the Evolution (and not only that, as those parts are shared between other applications too), but there is no --force-online for the addressbook and calendar factories (factory processes, D-Bus services).

[1] https://git.gnome.org/browse/evolution/commit/?id=2dd576b
Comment 13 Milan Crha 2016-07-04 05:04:46 EDT
*** Bug 1352195 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.