Bug 1907864 - Repository enable failed on http-proxy configured setup.
Summary: Repository enable failed on http-proxy configured setup.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.9.0
Hardware: x86_64
OS: Linux
unspecified
high vote
Target Milestone: 6.9.0
Assignee: Marek Hulan
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
: 1919577 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-15 11:55 UTC by Devendra Singh
Modified: 2021-04-21 13:24 UTC (History)
6 users (show)

Fixed In Version: foreman-2.3.1.8-1
Doc Type: Known Issue
Doc Text:
Enabling repository on a Satellite installation with http-proxy configured fails with a 404 error.
Clone Of:
Environment:
Last Closed: 2021-04-21 13:24:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31637 0 Normal Closed Repository enable failed on http-proxy configured setup. 2021-02-18 13:58:51 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:24:45 UTC

Description Devendra Singh 2020-12-15 11:55:36 UTC
Description of problem: Repository enable failed on http-proxy configured setup.


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

How reproducible:
always

Steps to Reproduce:
1. Install satellite on ipv6 setup.
2. Configure http-proxy.
3. Add the latest subscription.
4. Enable the RedHat repository, Repository enables failed with 404 error.

Dec 15 06:39:50 qesat68 pulp: kombu.transport.qpid:INFO: Connected to qpid with SASL mechanism ANONYMOUS
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920) Exception adding importer to repo [695ada71-9d1e-482b-afe6-7443f21f6443]; the repo will be deleted
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920) Traceback (most recent call last):
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 422, in create_repo
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     importer_controller.set_importer(repo_id, importer_type_id, importer_repo_plugin_config)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/celery/local.py", line 191, in __call__
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     return self._get_current_object()(*a, **kw)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 688, in __call__
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     return super(Task, self).__call__(*args, **kwargs)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 110, in __call__
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     return super(PulpTask, self).__call__(*args, **kwargs)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/celery/app/task.py", line 379, in __call__
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     return self.run(*args, **kwargs)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/importer.py", line 99, in set_importer
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     validate_importer_config(repo, importer_type_id, clean_config)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/importer.py", line 177, in validate_importer_config
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920)     raise exceptions.PulpDataException(message)
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920) PulpDataException: Configuration errors:
Dec 15 06:39:50 qesat68 pulp: pulp.server.controllers.repository:ERROR: (11461-97920) The configuration parameter <proxy_username> requires the <proxy_password> parameter to also be set.
Dec 15 06:39:50 qesat68 pulp: pulp.server.webservices.middleware.exception:INFO: (11461-97920) Configuration errors:
Dec 15 06:39:50 qesat68 pulp: pulp.server.webservices.middleware.exception:INFO: (11461-97920) The configuration parameter <proxy_username> requires the <proxy_password> parameter to also be set.


Actual results:
repository enable failed with a configuration error.

Expected results:
repository enable should work

Additional info:

Comment 4 Marek Hulan 2020-12-17 16:05:06 UTC
So what happens is, if HttpProxy object has username set to emtpy string, pulp 2 thinks it is asked to use username and password, but the password is not passed (the value in Foreman DB is nil). The empty string stored for the user name comes from WebUI form, if user leaves the field blank. After resetting this to nil in DB, it works fine again.

This can be seen as a regression from 6.8 but technically it is not. The change in 6.9 is that password field of http proxy form is disabled by default, once needs to click on the pencil icon to enable it. If it remains disabled, the value for passowrd is nil, if it is enabled, it's empty string. If both username and password is empty string, pulp is happy and all works. So we need to make sure either both username and password is empty string (submitted enabled empty text fields) or none of them is empty string (can be acheived through API).

After a discussion with Ina, the fix should land in Pulp 2.

The workaround to unblock QE: when you create a HTTP proxy in UI, click the pencil and save the form only when the password field is enabled. Or use API and don't specify any username and password.

Comment 5 pulp-infra@redhat.com 2020-12-17 17:24:40 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2020-12-17 17:24:41 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 7 Ina Panova 2021-01-08 17:49:42 UTC
@Marek, turned out that even if the fix is not complex, we would need to touch the code for multiple plugin types  in multiple plances, which I would try to really avoid.
Can you please ensure on your side that values for user/pass coming from UI are nil? I am removing pulp component, please update the component accordingly, I was not sure which one to select.

Comment 8 Marek Hulan 2021-01-14 14:28:57 UTC
Created redmine issue https://projects.theforeman.org/issues/31637 from this bug

Comment 9 Marek Hulan 2021-01-15 08:50:50 UTC
Thanks, I've sent a fix to Foreman core for this.

Comment 10 Marek Hulan 2021-01-15 08:52:41 UTC
Devendra, let me know if you'd like to participate in testing, the patch can be easily applied but one file needs to be omitted on the production system. I'm happy to assist.

Comment 11 Bryan Kearney 2021-01-15 14:03:50 UTC
Upstream bug assigned to mhulan

Comment 12 Bryan Kearney 2021-01-15 14:03:52 UTC
Upstream bug assigned to mhulan

Comment 13 Devendra Singh 2021-01-15 16:06:03 UTC
(In reply to Marek Hulan from comment #10)
> Devendra, let me know if you'd like to participate in testing, the patch can
> be easily applied but one file needs to be omitted on the production system.
> I'm happy to assist.

yes, I would like to participate in the testing.

Comment 14 Bryan Kearney 2021-01-18 14:07:31 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31637 has been resolved.

Comment 15 Marek Hulan 2021-01-18 14:29:02 UTC
No worries, it was already merged meanwhile but thanks for the interest!  I believe this will get into the next snap.

Comment 16 Justin Sherrill 2021-01-25 17:37:17 UTC
*** Bug 1919577 has been marked as a duplicate of this bug. ***

Comment 19 Tasos Papaioannou 2021-02-25 03:23:10 UTC
Verified on 6.9.0 snap 14.0.

Comment 22 errata-xmlrpc 2021-04-21 13:24:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1313


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