Bug 742275

Summary: yast2 ignores proxy settings
Product: [openSUSE] openSUSE 12.1 Reporter: Olaf Hering <ohering>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P3 - Medium CC: forgotten_KjUTH09OjI
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: Outsourced Testing Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: bug742275.tar.xz
.xsession-errors

Description Olaf Hering 2012-01-19 10:14:28 UTC
fresh 12.1-x86_64 gnome desktop, with updates.

This bug may be related to bug #732590 and bug #725948.

During second stage a proxy was configured once again because booting installation with proxy=URL does not automatically honor that proxy setting for the installed system.
Later in second stage the configured proxy was used to download the 12.1 repo urls.

After initial login the user has to configure a proxy once more in his settings so that firefox has a proxy as well.
But yast does not use any proxy now anymore. zypper does honor the settings for some reason.
Comment 1 Olaf Hering 2012-01-19 10:17:46 UTC
Created attachment 471845 [details]
bug742275.tar.xz

some logfiles
Comment 2 Olaf Hering 2012-01-19 10:18:55 UTC
Created attachment 471846 [details]
.xsession-errors
Comment 3 Arvin Schnell 2012-01-20 11:37:38 UTC
What does /etc/sysconfig/proxy contain?

Where do you configure the proxy after initial login so that firefox
works? In YaST, GNOME or Firefox?

What module of YaST does not use the proxy setting anymore?
Comment 4 Olaf Hering 2012-01-23 15:16:33 UTC
(In reply to comment #3)
> What does /etc/sysconfig/proxy contain?

Its in the logs:
PROXY_ENABLED="yes"
HTTP_PROXY="http://192.168.2.100:3128"

As I said, zypper uses the proxy.

> Where do you configure the proxy after initial login so that firefox
> works? In YaST, GNOME or Firefox?

FireFox uses the GNOME settings, but it can be configured to use private proxy settings. Just checked, thats how I configured firefox while I filed this bug.

I used the GNOME network settings as well, which is the place where the per session (or user?) proxy is configured.

> What module of YaST does not use the proxy setting anymore?

I try online update, repos, and software.


Now that I play more with the test installation:
reconfiguring firefox to use system settings tells me it uses a proxy it can not reach. 
After double checking I noticed the GNOME settings dialog has a wrong port number (3180 instead of 3128). Sorry for that. I did also a re-login.

Now firefox connects fine using system settings.
smolt uses the proxy (not sure which setting it uses)
rhythmbox uses the proxy (not sure which setting it uses, likely the GNOME setting).

But yast software repos fails. Appearently it tries to connect directly, it gets an IPv6 address and tries to connect to that. To me it looks like yast does not use any proxy setting for some reason.

I will paste to full error message.
Comment 5 Olaf Hering 2012-01-23 15:19:54 UTC
This is what I get with 'refresh all repos':

Download (curl) error for 'http://widehat.opensuse.org/update/12.1/repodata/repomd.xml':
Error code: Connection failed
Error message: Failed to connect to 2a01:138:a004:0:21a:a0ff:fe26:efa9: Network is unreachable



olaf@optiplex:~> host widehat.opensuse.org
widehat.opensuse.org has address 62.146.92.202
widehat.opensuse.org has IPv6 address 2a01:138:a004:0:21a:a0ff:fe26:efa9


Is perhaps curl the culprit?
Comment 6 Arvin Schnell 2012-01-30 12:52:54 UTC
*** Bug 743361 has been marked as a duplicate of this bug. ***
Comment 7 Ladislav Slezák 2012-01-31 12:38:56 UTC
Strange, zypper code doesn't handle proxy settings itself, it is handled by libzypp. So it should work in YaST the same way.

Michael, any idea why proxy doesn't work in YaST? Is the proxy initialization related to the target system init? When libzypp reads the proxy settings?
Comment 8 Michael Andres 2012-01-31 14:57:08 UTC
In 12.1 this is handled by libproxy, but it's the same for zypper and yast.

It might depend on the way yast is invoked ('su' or 'su -'). libproxy reads the settings from /etc/sysconfig unless the environment tells you are in a kde/gnome session. In this case the kde/gnome settings are used. 

So if yast is started from a root login shell /etc/sysconfig is used. 

--
The settings libproxy uses can be tested by calling:
  _PX_DEBUG=1 proxy <URL>

(proxy is provided by package libproxy-tools)
Comment 9 Ladislav Slezák 2012-02-07 18:04:33 UTC
Olaf, please check the previous comment and try the different ways mentioned there...
Comment 10 Olaf Hering 2012-02-08 19:12:50 UTC
Thats the output:
optiplex:~ # _PX_DEBUG=1 proxy http://dist.suse.de/
Using config: 26sysconfig_config_extension
Using ignore: 
Config is: http://192.168.2.100:3128
http://192.168.2.100:3128
optiplex:~ #
Comment 11 Ladislav Slezák 2012-03-30 10:40:27 UTC
Michael, what does that ^^^ mean? I don't understand the proxy stuff at all...
Comment 12 Michael Andres 2012-03-30 11:27:17 UTC
Note: There have been various issues with libproxy, so it's recommended to use at least libzypp-11.1.1 and watch out for libproxy updates.


The above output shows which proxy conf module libproxy is considering. It is '26sysconfig_config_extension' which is the right for zypp as /etc/sysconfig/proxy rules. So if you start yast from the above shell, the sysconfig settings should be used.


libzypp versions prior to 11.1.1 followed libproxy even if gnome/kde config modules were considered. This may easily happen if the GUI launches zypper/yast using a non-login root shell. Since 11.1.1 libzypp forces libproxy into using '26sysconfig_config_extension'.


The rest of the output shows the NO_PROXY value (Using ignore:) and PROXY value (Config is:) as derived from the config module used.

The last line shows the suggested way of connecting to 'http://dist.suse.de/', i.e. via proxy 'http://192.168.2.100:3128'. (direct:// would instruct to use no proxy).
Comment 13 Ladislav Slezák 2012-04-17 11:38:42 UTC
Olaf, could you retry it in the latest openSUSE-12.2 milestone release?

There is libzypp 11.1.0 which should have included some proxy fixes as mentioned in the previous comment.
Comment 14 Olaf Hering 2012-05-09 17:40:20 UTC
(In reply to comment #13)
> Olaf, could you retry it in the latest openSUSE-12.2 milestone release?
> 
> There is libzypp 11.1.0 which should have included some proxy fixes as
> mentioned in the previous comment.

I dont have a 12.2 system at home yet, but I found that yast2 in sles11sp2 has appearently the exact same issue: with zypper or firefox the proxy is used, while yast does not use it.
Comment 15 Olaf Hering 2012-07-02 08:47:42 UTC
Today I tried a Factory snapshot, a state of roughly Beta2.

In yast2 proxy the 'Test Proxy Settings' worked.
In yast2 repos the 'refresh all enabled repos' worked as well.
Comment 16 Ladislav Slezák 2012-07-02 09:10:40 UTC
Olaf, thanks for retesting it!

I'm closing it as FIXED (for 12.2).