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:
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.
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.
@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.
Created redmine issue https://projects.theforeman.org/issues/31637 from this bug
Thanks, I've sent a fix to Foreman core for this.
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.
Upstream bug assigned to mhulan
(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.
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31637 has been resolved.
No worries, it was already merged meanwhile but thanks for the interest! I believe this will get into the next snap.
*** Bug 1919577 has been marked as a duplicate of this bug. ***
Verified on 6.9.0 snap 14.0.
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