Bug 1706409 - osc fails with exception, if https_proxy environment variable is set [PATCH available]
Summary: osc fails with exception, if https_proxy environment variable is set [PATCH a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: osc
Version: 29
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Haïkel Guémar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-04 16:57 UTC by Fritz Elfert
Modified: 2019-06-01 04:02 UTC (History)
3 users (show)

Fixed In Version: osc-0.165.1-255.1.2.fc30 osc-0.165.1-255.1.2.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-01 00:52:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
This patch fixes the bug (497 bytes, patch)
2019-05-04 17:39 UTC, Fritz Elfert
no flags Details | Diff

Description Fritz Elfert 2019-05-04 16:57:17 UTC
User-Agent:       Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier: 

If https_proxy is set AND I run an osc command that actually attempts to fetch some package metadata (like "osc r") then osc fails wit the following backtrace:

[felfert@floh opennx]$ osc r
Traceback (most recent call last):
  File "/usr/bin/osc", line 41, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 61, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 344, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 367, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 501, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1232, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 5245, in do_results
    get_results(**kwargs)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 5740, in get_results
    for results in get_package_results(apiurl, project, package, **kwargs):
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 5795, in get_package_results
    xml = b''.join(show_results_meta(apiurl, project, package, *args, **kwargs))
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 5673, in show_results_meta
    f = http_GET(u)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 3387, in http_GET
    def http_GET(*args, **kwargs):    return http_request('GET', *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 3376, in http_request
    fd = urlopen(req, data=data)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/site-packages/osc/oscssl.py", line 201, in https_open
    request_uri = urldefrag(full_url)[0]
NameError: global name 'urldefrag' is not defined

Reproducible: Always

Steps to Reproduce:
1. set https_proxy e.g. export https_proxy=http://192.168.2.17:3128/
2. cd into a previously checked-out OBS package directory
3. run osc r to show build status on OBS
Actual Results:  
The above exception is thrown

Expected Results:  
Output of the actual build status

Comment 1 Fritz Elfert 2019-05-04 17:39:06 UTC
Created attachment 1563382 [details]
This patch fixes the bug

Comment 2 Fedora Update System 2019-05-31 01:38:45 UTC
FEDORA-2019-18146b9cfb has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-18146b9cfb

Comment 3 Fedora Update System 2019-05-31 01:38:45 UTC
FEDORA-2019-0d78e279d7 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0d78e279d7

Comment 4 Fedora Update System 2019-06-01 00:52:22 UTC
osc-0.165.1-255.1.2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2019-06-01 04:02:28 UTC
osc-0.165.1-255.1.2.fc29 has been pushed to the Fedora 29 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.