Actions
Bug #31637
closedRepository enable failed on http-proxy configured setup.
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1907864
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. </p> *Actual results:* repository enable failed with a configuration error. *Expected results:* repository enable should work *Additional info:*'
Added by Marek Hulán over 4 years ago
Actions
Fixes #31637 - nilify http proxy credentials
Recently a HTTP form password field changed and is disabled unless user
explicitly sets the password. From the HTML forms nature, if user does
not specify any value in the text field, server receives the value as an
empty string. If the field is disabled, there's no value sent and the
server keeps that attribute as nil.
After the mentioned change, if user does not set any of username and
password, we end up in a situation where username is empty string and
password is nil. This causes problems at some backend services, namely
Pulp 2.
We should either keep both as empty strings or both as nils. The later
seems more universal, since it's consistent with the API behavior in
case user does not specify the values. Therefore we make sure the value
is nilified if it's an empty string.