Bug 985106 (sat6-proxy-bug)

Summary: Proxy not properly configured for pulp repo syncs
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: InstallationAssignee: Eric Helms <ehelms>
Status: CLOSED DUPLICATE QA Contact: Tazim Kolhar <tkolhar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.1CC: bchardim, cwelton, flloreda, inecas, jmontleo, miguel, mmccune, pep, tkolhar, xdmoon
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-16 21:32:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1083818    
Bug Blocks:    

Description Justin Sherrill 2013-07-16 19:34:31 UTC
Description of problem:

Katello does not use the pulp global proxy configuration to sync repositories.


Version-Release number of selected component (if applicable):

Satellite 6.0.1 mdp1

How reproducible:
always


Steps to Reproduce:
1.  Run katello configure with  the --proxy-url  option.
2.  create a yum repo
3.  Try to sync a repo when use of the proxy is required

Actual results:
Sync fails, does not attempt to go through the proxy

Expected results:
Pulp should use the proxy to sync the repo.

Comment 1 Justin Sherrill 2013-07-16 19:35:24 UTC
UPstream katello issue https://github.com/Katello/katello/issues/2090

Workaround:

create /usr/lib/pulp/plugins/importers/yum_importer/yum_importer.conf


with contents:

{
  "proxy_url" : "http://localhost/",
  "proxy_port" : "12345"
}

Comment 2 Xixi 2013-07-16 21:12:36 UTC
(In reply to comment #1)
> Workaround:
> 
> create /usr/lib/pulp/plugins/importers/yum_importer/yum_importer.conf
> with contents:
> 
> {
>   "proxy_url" : "http://localhost/",
>   "proxy_port" : "12345"
> }
(...and "service httpd restart" for the change to take effect.)

Comment 3 Justin Sherrill 2013-08-16 16:32:44 UTC
Please note that there is a typo in the original post (and the bugzillas that post was based off of).  With that configuration syncing will work, but new repositories will fail upon creation.  The  correct syntax is:


/usr/lib/pulp/plugins/importers/yum_importer/yum_importer.conf

{
  "proxy_url" : "http://localhost/",
  "proxy_port" : 12345
}


and then run 'service httpd restart'


Note the proxy_port is an Integer and NOT a string (It should NOT be surrounded by quotes).

Comment 6 Justin Sherrill 2013-10-14 15:52:31 UTC
Note new file location for pulp 2.3 in mdp2, this manual workaround should not be needed anymore though:

https://github.com/Katello/katello-installer/pull/58

Comment 8 Ivan Necas 2013-10-15 13:43:02 UTC
*** Bug 968265 has been marked as a duplicate of this bug. ***

Comment 9 Ivan Necas 2013-10-15 13:43:32 UTC
*** Bug 968390 has been marked as a duplicate of this bug. ***

Comment 11 Mike McCune 2013-10-17 21:02:03 UTC
Moving this to be tested during MDP3, not critical for MDP2 success story

Comment 12 Dane Butler 2013-11-20 00:32:48 UTC
This workaround does not appear to work on MDP2.

Comment 13 Justin Sherrill 2013-11-20 15:56:22 UTC
MDP2 should fully support pulp proxy configuration with no workarounds needed.  Simply specify the appropriate command line options to katello-configure.  If you are experiencing an issue with it, please let us know either through the mdp2 mailing list or #satellite6-mdp on freenode.

Comment 14 Justin Sherrill 2013-11-20 15:57:45 UTC
(There is a known issue using an HTTP Proxy with digest authentication though)

Comment 17 Tazim Kolhar 2014-05-28 06:06:32 UTC
Please provide verification steps

Comment 18 Justin Sherrill 2014-05-28 13:05:19 UTC
Moving this back to Assigned as this broke during enginification.

Comment 19 Justin Sherrill 2014-05-29 13:15:38 UTC
Edit:

/etc/foreman/plugins/katello.yaml

Under 'common:'

Add:

  cdn_proxy:
      host: localhost
      port: 3128
      user: login
      password: password


for example:

common:
  cdn_proxy:
    host: localhost
    port: 3128
    user: login
    password: password

This enables cdn communication via the proxy (used for enabling red hat repos).  In order to actually use your proxy for syncing rpms:



create a new file:   /etc/pulp/server/plugins.conf.d/yum_importer.conf


{
    "num_threads" : 4,
    "proxy_url" : "http://myproxy",
    "proxy_port" : 80
}

Comment 20 Justin Sherrill 2014-05-29 15:42:43 UTC
correction,  "proxy_url" should be "proxy_host":

{
    "num_threads" : 4,
    "proxy_host" : "http://myproxy",
    "proxy_port" : 80
}

Comment 21 Francisco Lloreda 2014-05-30 13:47:26 UTC
Actually, looking at code at /usr/lib/python2.6/site-packages/pulp_rpm/plugins/importers/yum/importer.py I found that filename should be /etc/pulp/server/plugins.conf.d/yum_importer.conf 

My file contents are:

{
    "proxy_host" : "http://localhost",
    "proxy_port" : 8118
}

And it's working.

Also we need a feature for proxy per-repo as if one of the repos it's internal and proxy is unable to resolve it it will fail. 

There is a workarround intalling a local proxy in the satellite server and configuring it with the correct rules to direct the HTTP querys to proxy o direct based in the destination.

Thanks

Comment 22 Francisco Lloreda 2014-05-31 23:39:49 UTC
(In reply to Francisco Lloreda from comment #21)

I mean /etc/pulp/server/plugins.conf.d/yum_importer.json

Comment 23 Benjamin Chardi 2014-06-04 09:39:58 UTC
Just to complement the info. In order to download ISO content from Satellite6-beta via proxy, an iso importer plugin must be configured:

# cat  /etc/pulp/server/plugins.conf.d/iso_importer.json

{
  "proxy_host" : "http://localhost",
  "proxy_port" : 8118
}


Then restart katello-service

# katello-service restart

Comment 24 Mike McCune 2014-06-16 21:32:44 UTC
This is resolved by 1083818 for the Satellite 6 Beta release.

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

Comment 25 Red Hat Bugzilla 2023-09-14 01:48:02 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days