After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794801 - /network-monitor/add_networks fails if there is a proxy and glib-networking is installed
/network-monitor/add_networks fails if there is a proxy and glib-networking i...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.56.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-03-29 10:34 UTC by Iain Lane
Modified: 2018-04-10 09:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests/network-monitor: Ignore the system's proxy settings (1.80 KB, patch)
2018-03-29 10:44 UTC, Iain Lane
none Details | Review
tests/network-monitor: Always use the dummy proxy resolver (1.81 KB, patch)
2018-04-09 20:50 UTC, Iain Lane
committed Details | Review

Description Iain Lane 2018-03-29 10:34:11 UTC
We just noticed in Ubuntu that glib's testsuite started failing-

GLib-GIO:ERROR:../../../../../gio/tests/network-monitor.c:171:reach_cb: assertion failed (error == NULL): Host unreachable (g-io-error-quark, 37)
Bail out! GLib-GIO:ERROR:../../../../../gio/tests/network-monitor.c:171:reach_cb: assertion failed (error == NULL): Host unreachable (g-io-error-quark, 37)

I'll skip all the tedious investigation, but it turns out that our test environment got glib-networking installed, probably via a dependency on some other package. This means that now glib's installed-tests are using its GIO modules, in particular the libproxy based proxy resolver instead of the dummy one.

We don't have all of the addresses that the network-monitor tests are testing in $no_proxy, and so libproxy is correctly telling us to go through the proxy for some of them. Unfortunately in test_add_network we removed all networks from the GNetworkMonitorBase, so as far as it is concerned the proxy cannot be reached.

Couple of solutions, I think.

 - (preferable, patch coming up) The network-monitor tests aren't trying to test the proxy, so unset *_proxy before running them.
 - Find out what the proxy is - possibly by just calling g_proxy_resolver_lookup() and resolving it to a name - and re-adding that to the GNetworkMonitorBase. We're just checking reachability here, so that is probably enough.
Comment 1 Iain Lane 2018-03-29 10:36:01 UTC
If there's a way to always use the dummy resolver we could use that too, but I'm not aware that there is.
Comment 2 Iain Lane 2018-03-29 10:44:20 UTC
Created attachment 370287 [details] [review]
tests/network-monitor: Ignore the system's proxy settings

If glib-networking is installed and built with libproxy support, this
test will use it. If a proxy is set in the environment, we might get
correctly told to go through it for certain acesses. However, this isn't
going to work, because the testsuite monkeys with the network monitor to
tell it that all addresses - including the proxy - aren't reachable.

We're trying to check if adding networks to a GNetworkMonitor works in
general. Proxies just get in the way here, so let's unset the
environment variables and pretend the system doesn't have one.
Comment 3 Simon McVittie 2018-04-09 12:39:56 UTC
Review of attachment 370287 [details] [review]:

Not a maintainer, but this makes sense to me.
Comment 4 Simon McVittie 2018-04-09 12:43:14 UTC
(In reply to Iain Lane from comment #1)
> If there's a way to always use the dummy resolver we could use that too, but
> I'm not aware that there is.

There seems to be an undocumented $GIO_USE_NETWORK_MONITOR and $GIO_USE_PROXY_RESOLVER, would those help? (Presumably they should be mentioned in docs/reference/gio/overview.xml but aren't yet?)
Comment 5 Dan Winship 2018-04-09 18:16:08 UTC
(In reply to Simon McVittie from comment #4)
> There seems to be an undocumented $GIO_USE_NETWORK_MONITOR and
> $GIO_USE_PROXY_RESOLVER, would those help? (Presumably they should be
> mentioned in docs/reference/gio/overview.xml but aren't yet?)

Yes, g_setenv ("GIO_USE_PROXY_RESOLVER", "dummy", TRUE) should do the trick
Comment 6 Iain Lane 2018-04-09 20:50:23 UTC
Created attachment 370710 [details] [review]
tests/network-monitor: Always use the dummy proxy resolver

Yeah, that works, thanks!
Comment 7 Philip Withnall 2018-04-10 09:31:45 UTC
Review of attachment 370710 [details] [review]:

Nitpick: s/acesses/accesses/ in the commit message

I’ll fix that when I push. Thanks for the patch!
Comment 8 Philip Withnall 2018-04-10 09:38:00 UTC
Pushed to master and glib-2-56.

Attachment 370710 [details] pushed as ec20cb4 - tests/network-monitor: Always use the dummy proxy resolver