Bug 471428 - RFE - Fedora-business-cards can't be used through a proxy
Summary: RFE - Fedora-business-cards can't be used through a proxy
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-fedora
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Toshio Ernie Kuratomi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-13 17:33 UTC by Mathieu Bridon
Modified: 2008-12-24 18:42 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-11-17 15:30:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
error trace when trying to use f-b-c behind a proxy (1.48 KB, text/plain)
2008-11-14 09:17 UTC, Mathieu Bridon
no flags Details
new error trace (1.97 KB, text/plain)
2008-11-14 16:33 UTC, Mathieu Bridon
no flags Details
New proxyclient ported to pycurl (12.32 KB, text/plain)
2008-11-15 18:02 UTC, Toshio Ernie Kuratomi
no flags Details

Description Mathieu Bridon 2008-11-13 17:33:35 UTC
Description of problem:
I tried to use f-b-c behind the proxy of my company. It failed.


Version-Release number of selected component (if applicable):
fedora-business-cards-0.2.2-1.fc10.noarch


How reproducible:
Always


Actual results:
f-b-c throws an exception.


Expected results:
f-b-c should be able to pass through the proxy and get the FAS informations

Comment 1 Ian Weller 2008-11-13 21:34:43 UTC
Can you post an attachment of the exception?

CCing python-fedora people.

Comment 2 Toshio Kuratomi 2008-11-13 22:06:53 UTC
Also, transparent or non-transparent proxy?

Comment 3 Mathieu Bridon 2008-11-14 09:17:11 UTC
Created attachment 323557 [details]
error trace when trying to use f-b-c behind a proxy

Comment 4 Mathieu Bridon 2008-11-14 09:17:24 UTC
I'm not sure what you call a transparent proxy. If that's what you mean, I have to set up the proxy configuration in my client (either the Gnome proxy settings, the Firefox network settings, yum.conf, etc...) in order to access the Internet, so it would be a non-transparent proxy.

I attach the trace of the error (not an « exception », but I'm coming from the Java world so my vocabulary might not be the most appropriate for pythonic stuff :)

Comment 5 Toshio Kuratomi 2008-11-14 15:57:58 UTC
Do you have proxy settings configured in the environment?  In particular the services that python-fedora talks to are all https based.  So you'd need to have https_proxy set.

  env |grep https_proxy

Should tell you.

I haven't tested this so if there's problems even after you set https_proxy, I'll set up a proxy and see if I can reproduce the error.

Comment 6 Mathieu Bridon 2008-11-14 16:32:41 UTC
Okay, I didn't know about the HTTPS thing.

I exported the env var now:
$ env | grep http
http_proxy=http://172.16.86.98:8080/
https_proxy=http://172.16.86.98:8080

The trace is different now, see attached file.

Comment 7 Mathieu Bridon 2008-11-14 16:33:10 UTC
Created attachment 323596 [details]
new error trace

Comment 8 Toshio Ernie Kuratomi 2008-11-14 21:13:26 UTC
Okay. I did some research and it looks like urllib doesn't support https proxying.  I'm looking into integrating some GPL'd code to enable python-fedora to do this now.

We also have porting to pycurl on our todo list and that might be another way to fix this.

Comment 9 Toshio Ernie Kuratomi 2008-11-15 18:02:35 UTC
Created attachment 323700 [details]
New proxyclient ported to pycurl

new proxyclient ported to pycurl

Comment 10 Toshio Ernie Kuratomi 2008-11-15 18:10:56 UTC
If you could try the attached proxyclient.py file that would be appreciated.  I've tested here with a squid proxy that I setup but I'd like to be sure it works in a real-world situation as well.

This proxyclient.py file should replace the existing proxyclient.py in /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py

This proxyclient is a port to pycurl so it has some major architectural changes.  I need to make one more change to the file and a lot of changes before I'm ready to release this but I've checked it into the devel branch already as it passes the few checks I've made.

For the record, the urllib2 hacks I tried failed to work and this port needed to be done at some point in the future anyway.

Comment 11 Mathieu Bridon 2008-11-15 21:26:27 UTC
I did that, now fedora-business-cards doesn't even work:
$ fedora-business-cards 
There was a problem importing the fedora_business_cards module. Please make
sure that you have fedora-business-cards installed properly.


Just to be sure, here is what I did:
# wget https://bugzilla.redhat.com/attachment.cgi?id=323700
# mv attachment.cgi\?id\=323700  proxyclient.py
# cp \
 /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py \
 /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py.backup
# mv \
 proxyclient.py \
 /usr/lib/python2.5/site-packages/fedora/client/proxyclient.py

Did I do something incorrectly ?

Comment 12 Ian Weller 2008-11-15 21:31:18 UTC
So we can get a traceback, replace /usr/bin/fedora-business-cards with this:

import sys
from fedora_business_cards.frontend import cmdline
cmdline.main()

Comment 13 Mathieu Bridon 2008-11-15 21:41:14 UTC
Ok, that was because I didn't have pycurl (the traceback revealed this).

Now f-b-c works fine. I'll try it on monday when I'm back to work, behind the proxy.

Comment 14 Mathieu Bridon 2008-11-17 09:09:45 UTC
Just tried it this morning.

It works great, it could connect to FAS, retrieve my data and I could generate a card.

Fixed for me :)

Thanks

Comment 15 Toshio Ernie Kuratomi 2008-11-17 15:30:30 UTC
Excellent.  This is checked into the python-fedora-devel branch and will be in the next release.

Comment 16 Fedora Update System 2008-11-21 00:43:39 UTC
python-fedora-0.3.8-1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/python-fedora-0.3.8-1.fc10

Comment 17 Fedora Update System 2008-12-24 12:57:16 UTC
python-fedora-0.3.8-1.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2008-12-24 18:42:07 UTC
python-fedora-0.3.8-1.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


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