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 780558 - NetworkManager does not send proxy configuration to pacrunner
NetworkManager does not send proxy configuration to pacrunner
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
1.6.x
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2017-03-26 10:56 UTC by Marcos Mello
Modified: 2017-04-11 12:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcos Mello 2017-03-26 10:56:42 UTC
The connection configuration file (keyfile) has

[proxy]
method=1

and my DHCP server sends option 252, as dhclient lease file shows

/var/lib/NetworkManager/dhclient-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-enp0s3.lease

lease {
  interface "enp0s3";
  fixed-address 192.168.50.39;
  option subnet-mask 255.255.255.0;
  option wpad "http://centos.localdomain/proxy.pac";
  option dhcp-lease-time 14400;
  option routers 192.168.50.1;
  option dhcp-message-type 5;
  option dhcp-server-identifier 192.168.50.1;
  option domain-name-servers 192.168.50.1;
  option dhcp-renewal-time 7200;
  option dhcp-rebinding-time 12600;
  option broadcast-address 192.168.50.255;
  option host-name "arch";
  option domain-name "localdomain";
  renew 0 2017/03/26 11:47:12;
  rebind 0 2017/03/26 13:39:01;
  expire 0 2017/03/26 14:09:01;
}
lease {
  interface "enp0s3";
  fixed-address 192.168.50.39;
  option wpad "http://centos.localdomain/proxy.pac";
  option subnet-mask 255.255.255.0;
  option routers 192.168.50.1;
  option dhcp-lease-time 14400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.50.1;
  option dhcp-server-identifier 192.168.50.1;
  option dhcp-renewal-time 7200;
  option broadcast-address 192.168.50.255;
  option dhcp-rebinding-time 12600;
  option host-name "arch";
  option domain-name "localdomain";
  renew 0 2017/03/26 12:11:38;
  rebind 0 2017/03/26 13:54:38;
  expire 0 2017/03/26 14:24:38;
}

pacrunner 0.10 is running

dbus[244]: [system] Activating service name='org.pacrunner' (using servicehelper)
dbus[244]: [system] Successfully activated service 'org.pacrunner'
pacrunner[299]: PAC Runner version 0.10

NetworkManager (log level debug) says

NetworkManager[248]: <debug> [1490524791.6934] create NMPacrunnerManager singleton (0x257db70)
NetworkManager[248]: <debug> [1490524792.6307] pacrunner[0x257db70]: proxy config sent to pacrunner

But pacrunner (compiled with --enable-curl --enable-mozjs --enable-libproxy) proxy tool does not work:

$ proxy http://www.foo.com
direct://

If I manually configure pacrunner, it works as expected:

$ gdbus call --system --dest org.pacrunner --object-path /org/pacrunner/manager --method org.pacrunner.Manager.CreateProxyConfiguration "{'Method': <'auto'>, 'URL': <'http://centos.localdomain/proxy.pac'>}"
(objectpath /org/pacrunner/configuration1,)

$ proxy http://www.foo.com
http://centos.localdomain:3128

I run NetworkManager 1.6.2 on Arch Linux.
Comment 1 Beniamino Galvani 2017-04-04 08:16:22 UTC
Hi,

can you please:

 killall pacrunner
 pacrunner -n -d

as root in a terminal and attach the output when activating the connection and when running the 'proxy' command? Thanks!
Comment 2 Marcos Mello 2017-04-04 10:21:11 UTC
pacrunner[972]: PAC Runner version 0.10
pacrunner[972]: src/proxy.c:__pacrunner_proxy_init() 
pacrunner[972]: src/download.c:__pacrunner_download_init() 
pacrunner[972]: src/js.c:__pacrunner_js_init() 
pacrunner[972]: src/manager.c:__pacrunner_manager_init() 
pacrunner[972]: src/client.c:__pacrunner_client_init() 
pacrunner[972]: src/manual.c:__pacrunner_manual_init() 
pacrunner[972]: src/plugin.c:__pacrunner_plugin_init() 
pacrunner[972]: plugins/curl.c:curl_init() 
pacrunner[972]: src/download.c:pacrunner_download_driver_register() driver 0x61a840 name curl
pacrunner[972]: src/plugin.c:add_plugin() Plugin curl loaded
pacrunner[972]: plugins/mozjs.c:mozjs_init() 
pacrunner[972]: src/js.c:pacrunner_js_driver_register() driver 0x61a880 name mozjs
pacrunner[972]: src/plugin.c:add_plugin() Plugin mozjs loaded
pacrunner[972]: src/manager.c:create_proxy_config() sender :1.4 method direct interface enp0s3
pacrunner[972]: src/manager.c:create_proxy_config() browser-only 0 url (null) script (nil)
pacrunner[972]: src/proxy.c:pacrunner_proxy_create() interface enp0s3
pacrunner[972]: src/proxy.c:pacrunner_proxy_create() proxy 0x16104e0
pacrunner[972]: src/manager.c:create_config() path /org/pacrunner/configuration0
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x16104e0 domains 0x1610440 browser-only 0
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x16104e0 domain localdomain
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x16104e0 domain 192.168.50.38/24
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x16104e0 domain fe80::32a8:5705:e3ac:36fa/64
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_direct() proxy 0x16104e0
pacrunner[972]: src/proxy.c:set_method() proxy 0x16104e0 method 1
pacrunner[972]: src/proxy.c:reset_proxy() proxy 0x16104e0
pacrunner[972]: src/proxy.c:proxy_config_timeout() 
pacrunner[972]: src/manager.c:create_proxy_config() sender :1.4 method auto interface enp0s3
pacrunner[972]: src/manager.c:create_proxy_config() browser-only 0 url http://centos.localdomain/proxy.pac script (nil)
pacrunner[972]: src/proxy.c:pacrunner_proxy_create() interface enp0s3
pacrunner[972]: src/proxy.c:pacrunner_proxy_create() proxy 0x1567f60
pacrunner[972]: src/manager.c:create_config() path /org/pacrunner/configuration1
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x1567f60 domains 0x160f4c0 browser-only 0
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x1567f60 domain localdomain
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x1567f60 domain 192.168.50.38/24
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x1567f60 domain fe80::32a8:5705:e3ac:36fa/64
pacrunner[972]: src/proxy.c:pacrunner_proxy_set_auto() proxy 0x1567f60 url http://centos.localdomain/proxy.pac script (nil)
pacrunner[972]: src/proxy.c:set_method() proxy 0x1567f60 method 3
pacrunner[972]: src/proxy.c:reset_proxy() proxy 0x1567f60
pacrunner[972]: src/proxy.c:pacrunner_proxy_ref() proxy 0x1567f60
pacrunner[972]: src/download.c:__pacrunner_download_update() url http://centos.localdomain/proxy.pac
pacrunner[972]: plugins/curl.c:curl_download() url http://centos.localdomain/proxy.pac
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:timeout_callback() 
pacrunner[972]: plugins/curl.c:socket_callback() what 2 source 0
pacrunner[972]: plugins/curl.c:socket_callback() poll out
pacrunner[972]: plugins/curl.c:socket_callback() source 21
pacrunner[972]: plugins/curl.c:timer_callback() interval 0
pacrunner[972]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:event_callback() condition 4
pacrunner[972]: plugins/curl.c:socket_callback() what 1 source 21
pacrunner[972]: plugins/curl.c:socket_callback() poll in
pacrunner[972]: plugins/curl.c:socket_callback() source 23
pacrunner[972]: plugins/curl.c:event_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[972]: plugins/curl.c:event_callback() condition 1
pacrunner[972]: plugins/curl.c:write_callback() size 1 nitems 317 realsize 317
pacrunner[972]: plugins/curl.c:socket_callback() what 4 source 23
pacrunner[972]: plugins/curl.c:socket_callback() poll remove
pacrunner[972]: plugins/curl.c:socket_callback() source 0
pacrunner[972]: plugins/curl.c:event_callback() curl_multi_socket_action returns 0
pacrunner[972]: plugins/curl.c:check_sockets() result 0 handles 0
pacrunner[972]: plugins/curl.c:check_sockets() finished http://centos.localdomain/proxy.pac result 0
pacrunner[972]: src/proxy.c:download_callback() url http://centos.localdomain/proxy.pac content 0x163b9c0
pacrunner[972]: src/proxy.c:pacrunner_proxy_enable() proxy 0x1567f60
pacrunner[972]: src/proxy.c:pacrunner_proxy_ref() proxy 0x1567f60
pacrunner[972]: plugins/mozjs.c:mozjs_set_proxy() proxy 0x1567f60
pacrunner[972]: plugins/mozjs.c:mozjs_clear_proxy() proxy 0x1567f60 ctx (nil)
pacrunner[972]: src/proxy.c:pacrunner_proxy_get_script() proxy 0x1567f60
pacrunner[972]: src/proxy.c:pacrunner_proxy_unref() proxy 0x1567f60
pacrunner[972]: plugins/curl.c:timer_callback() interval 0


Now, proxy http://www.foo.com :

pacrunner[972]: src/client.c:jsrun_thread() sender :1.56
pacrunner[972]: src/client.c:jsrun_thread() url http://www.foo.com host www.foo.com
pacrunner[972]: src/proxy.c:pacrunner_proxy_lookup() url http://www.foo.com host www.foo.com
pacrunner[972]: src/client.c:jsrun_thread() result (null)

When manually configured (and NM's interface proxy method set to 'none'):

pacrunner[722]: src/manager.c:create_proxy_config() sender :1.42 method auto interface (null)
pacrunner[722]: src/manager.c:create_proxy_config() browser-only 0 url http://centos.localdomain/proxy.pac script (nil)
pacrunner[722]: src/proxy.c:pacrunner_proxy_create() interface (null)
pacrunner[722]: src/proxy.c:pacrunner_proxy_create() proxy 0x2150f20
pacrunner[722]: src/manager.c:create_config() path /org/pacrunner/configuration1
pacrunner[722]: src/proxy.c:pacrunner_proxy_set_domains() proxy 0x2150f20 domains (nil) browser-only 0
pacrunner[722]: src/proxy.c:pacrunner_proxy_set_auto() proxy 0x2150f20 url http://centos.localdomain/proxy.pac script (nil)
pacrunner[722]: src/proxy.c:set_method() proxy 0x2150f20 method 3
pacrunner[722]: src/proxy.c:reset_proxy() proxy 0x2150f20
pacrunner[722]: src/proxy.c:pacrunner_proxy_ref() proxy 0x2150f20
pacrunner[722]: src/download.c:__pacrunner_download_update() url http://centos.localdomain/proxy.pac
pacrunner[722]: plugins/curl.c:curl_download() url http://centos.localdomain/proxy.pac
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: src/manager.c:disconnect_callback() path /org/pacrunner/configuration1
pacrunner[722]: src/manager.c:destroy_config() path /org/pacrunner/configuration1
pacrunner[722]: src/proxy.c:pacrunner_proxy_disable() proxy 0x2150f20
pacrunner[722]: src/proxy.c:pacrunner_proxy_unref() proxy 0x2150f20
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:timeout_callback() 
pacrunner[722]: plugins/curl.c:socket_callback() what 2 source 0
pacrunner[722]: plugins/curl.c:socket_callback() poll out
pacrunner[722]: plugins/curl.c:socket_callback() source 30
pacrunner[722]: plugins/curl.c:timer_callback() interval 0
pacrunner[722]: plugins/curl.c:timeout_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:event_callback() condition 4
pacrunner[722]: plugins/curl.c:socket_callback() what 1 source 30
pacrunner[722]: plugins/curl.c:socket_callback() poll in
pacrunner[722]: plugins/curl.c:socket_callback() source 32
pacrunner[722]: plugins/curl.c:event_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 1
pacrunner[722]: plugins/curl.c:event_callback() condition 1
pacrunner[722]: plugins/curl.c:write_callback() size 1 nitems 317 realsize 317
pacrunner[722]: plugins/curl.c:socket_callback() what 4 source 32
pacrunner[722]: plugins/curl.c:socket_callback() poll remove
pacrunner[722]: plugins/curl.c:socket_callback() source 0
pacrunner[722]: plugins/curl.c:event_callback() curl_multi_socket_action returns 0
pacrunner[722]: plugins/curl.c:check_sockets() result 0 handles 0
pacrunner[722]: plugins/curl.c:check_sockets() finished http://centos.localdomain/proxy.pac result 0
pacrunner[722]: src/proxy.c:download_callback() url http://centos.localdomain/proxy.pac content 0x22251b0
pacrunner[722]: src/proxy.c:pacrunner_proxy_enable() proxy 0x2150f20
pacrunner[722]: src/proxy.c:pacrunner_proxy_ref() proxy 0x2150f20
pacrunner[722]: plugins/mozjs.c:mozjs_set_proxy() proxy 0x2150f20
pacrunner[722]: plugins/mozjs.c:mozjs_clear_proxy() proxy 0x2150f20 ctx (nil)
pacrunner[722]: src/proxy.c:pacrunner_proxy_get_script() proxy 0x2150f20
pacrunner[722]: src/proxy.c:pacrunner_proxy_unref() proxy 0x2150f20
pacrunner[722]: plugins/curl.c:timer_callback() interval 0

And... proxy http://www.foo.com :

pacrunner[722]: src/client.c:jsrun_thread() sender :1.44
pacrunner[722]: src/client.c:jsrun_thread() url http://www.foo.com host www.foo.com
pacrunner[722]: src/proxy.c:pacrunner_proxy_lookup() url http://www.foo.com host www.foo.com
pacrunner[722]: plugins/mozjs.c:mozjs_execute() proxy 0x2150f20 ctx 0x221b820 url http://www.foo.com host www.foo.com
pacrunner[722]: plugins/mozjs.c:dnsresolve() host www.foo.com
pacrunner[722]: plugins/mozjs.c:dnsresolve() address 23.23.132.56
pacrunner[722]: src/client.c:jsrun_thread() result PROXY centos.localdomain:3128
Comment 3 Beniamino Galvani 2017-04-04 11:59:25 UTC
We passed wrong domains to pacrunner, and pacrunner 0.10 (unlike previous versions) takes them into account.

Fix in branch bg/pacrunner-domains-bgo780558.
Comment 4 Atul Anand 2017-04-05 08:36:52 UTC
(In reply to Beniamino Galvani from comment #3)
> We passed wrong domains to pacrunner, and pacrunner 0.10 (unlike previous
> versions) takes them into account.
> 
> Fix in branch bg/pacrunner-domains-bgo780558.

Looks very Nice.

!VPN connection's proxy server will be treated as generic servers and one of them will be picked up by PACrunner in the order they were sent by NM in case of a fall back.

Maybe in Future we'll handle multiple !VPN connections more precisely inside PACRunner.
Thanks.
Comment 6 Marcos Mello 2017-04-09 19:14:59 UTC
Will the fix be in NM 1.8?
Comment 7 Beniamino Galvani 2017-04-11 12:50:19 UTC
(In reply to Marcos Mello from comment #6)
> Will the fix be in NM 1.8?

Yes, I've backported it:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-8&id=12d16e8a898f689e0d68b15870807c6cda386ecb