Bug 1015218 - proxy changes made in python-nectar-1.1.2-1.el6.noarch fail with "TypeError: sequence item 0: expected string, NoneType found"
Summary: proxy changes made in python-nectar-1.1.2-1.el6.noarch fail with "TypeError: ...
Keywords:
Status: CLOSED DUPLICATE of bug 1014368
Alias: None
Product: Pulp
Classification: Retired
Component: async/tasks
Version: 2.2 Beta
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-03 16:49 UTC by Paul Jochum
Modified: 2013-10-09 18:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-09 18:10:37 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1011972 0 high CLOSED proxy host setting ignored 2021-02-22 00:41:40 UTC

Description Paul Jochum 2013-10-03 16:49:21 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Pulp 2.2 beta
python-nectar-1.1.2-1.el6.noarch


How reproducible:
each time

Steps to Reproduce:
1.setup pulp, and 
2.run "pulp-admin rpm repo sync run --repo-id=rhel-6-server"
3.the command just spins the spinner for "Downloading Metadata...", and the following error comes out in /var/log/pulp/pulp.log

2013-10-03 11:02:52,556 nectar.downloaders.threaded:ERROR: Unhandled Exception in Worker Thread [139696453695232]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 92, in worker
    session = build_session(self.config)
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 281, in build_session
    _add_proxy(session, config)
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 310, in _add_proxy
    url = ':'.join((host, str(config.proxy_port)))
TypeError: sequence item 0: expected string, NoneType found


Actual results:
no repos are synced.

Expected results:


Additional info:
I have tried this with the following proxy information in /etc/pulp/server/plugins.conf.d/yum_importer.json

{
 "proxy_host" : "ih.proxy.lucent.com",
 "proxy_port" : 8000
}


[root@lss-pulp01 downloaders]# ll /etc/pulp/server/plugins.conf.d/
total 4
-rw-r--r-- 1 root root 64 Oct  3 10:40 yum_importer.json
[root@lss-pulp01 downloaders]#

Comment 1 Sayli Karmarkar 2013-10-08 21:56:23 UTC
Paul,

I think this is because of the wrong importer configuration. 

http://nectar.readthedocs.org/en/latest/general/config.html#proxy-support

You need to use proxy_url and it should include full url and not just the hostname. Can you try and see if it resolves the issue?

Thanks,

Comment 2 Paul Jochum 2013-10-09 15:23:17 UTC
1) I removed the /etc/pulp/server/plugins.conf.d/yum_importer.json file

2)  pulp-admin rpm repo delete  --repo-id=rhel-6-server

3)  pulp-admin -u admin -p admin rpm repo create \
--proxy-host=http://ih.proxy.lucent.com --proxy-port=8000 \
--repo-id=rhel-6-server \
--feed=https://cdn.redhat.com/content/dist/rhel/server/6/6Serverx86_64/os \
--feed-ca-cert=/etc/rhsm/ca/redhat-uep.pem \
--feed-key=/etc/pki/entitlement/4293201934666443712-key.pem   \
--feed-cert=/etc/pki/entitlement/4293201934666443712.pem
(and this succesfully completed)

4)  pulp-admin -u admin -p admin rpm repo sync run  --repo-id=rhel-6-server
+----------------------------------------------------------------------+
                Synchronizing Repository [rhel-6-server]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[\]
... failed

Bad Request


and in the log file (/var/log/pulp/server.log):
2013-10-09 10:10:10,201 urllib3.connectionpool:INFO: Starting new HTTP connection (1): ih.proxy.lucent.com
2013-10-09 10:10:10,327 nectar.downloaders.threaded:ERROR: Download of https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/repodata/repomd.xml failed with code 400: Bad Request
2013-10-09 10:10:10,331 pulp_rpm.plugins.importers.yum.sync:ERROR: sync failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 109, in run
    metadata_files = self.get_metadata()
  File "/usr/lib/python2.6/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 194, in get_metadata
    raise FailedException(str(e))
FailedException: Bad Request
2013-10-09 10:10:10,351 pulp.server.dispatch.task:ERROR: Importer indicated a failed response
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/dispatch/task.py", line 138, in _run
    result = call(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/sync.py", line 117, in sync
    raise PulpExecutionException(_('Importer indicated a failed response'))
PulpExecutionException: Importer indicated a failed response
2013-10-09 10:10:10,362 pulp.server.dispatch.task:INFO: FAILURE: Task f155549a-8dc3-496a-890c-082fde83c04e: CallRequest: RepoSyncManager.sync(u'rhel-6-server', sync_config_override=None)


I also tried this using our https proxy (just replaced:
--proxy-host=http://ih.proxy.lucent.com 
with
--proxy-host=https://ih.proxy.lucent.com 
but this also failed, with the same error message.

Should I open a new bug based on this?

thanks,
Paul

Comment 3 Sayli Karmarkar 2013-10-09 18:10:37 UTC
Paul, as per your last comment, this looks like the same issue as https://bugzilla.redhat.com/show_bug.cgi?id=1014368. This seems to be already fixed and will be available in the next 2.2 build. Closing it as duplicate.

*** This bug has been marked as a duplicate of bug 1014368 ***


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