Bug 1194676 - Pulp does not authenticate with mongodb using username with an empty password if specified
Summary: Pulp does not authenticate with mongodb using username with an empty password...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 2.6.1
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-20 14:03 UTC by Irina Gulina
Modified: 2021-04-06 18:03 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 23:25:24 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 708 0 High CLOSED - CURRENTRELEASE Pulp does not authenticate with mongodb using username with an empty password if specified Never

Description Irina Gulina 2015-02-20 14:03:11 UTC
Description of problem:

Pulp does not allow authentication with mongodb using username with an empty password if specified in server.conf and shows a traceback, though mongo allows access to pulp_database with an empty pass

Might be connected to BZ 1182335


Version-Release number of selected component (if applicable):
>> rpm -qa pulp-server
pulp-server-2.6.0-0.7.beta.fc20.noarch


Steps to Reproduce:
>>  mongo 
MongoDB shell version: 2.4.6
connecting to: test
> use pulp_database
switched to db pulp_database
> db.changeUserPassword("gena", "")
> exit
bye

>>  mongo pulp_database -u gena
MongoDB shell version: 2.4.6
connecting to: pulp_database
> db.repos.find()
{ "_id" : ObjectId("54b7c4cb99cca86045dd3fcb"), "_ns" : "repos", "content_unit_counts" : { "erratum" : 4, "package_category" : 1, "package_group" : 2 }, "description" : null, "display_name" : "zoo_repo", "id" : "zoo_repo", "last_unit_added" : ISODate("2015-01-15T13:47:14.329Z"), "last_unit_removed" : null, "notes" : { "_repo-type" : "rpm-repo" }, "scratchpad" : { "checksum_type" : "sha256" } }
> exit
bye

>> vi /etc/pulp/server.conf

username: gena
password:

>> for s in {qpidd,pulp_celerybeat,pulp_resource_manager,pulp_workers,httpd}; do sudo systemctl restart $s; done;

>> pulp-admin login -u admin -p admin
There was an internal server error while trying to access the Pulp application.
One possible cause is that the database needs to be migrated to the latest
version. If this is the case, run pulp-manage-db and restart the services. More
information may be found in Apache's log.

>> sudo -u apache pulp-manage-db
Database initialization failed: The server config specified username/password authentication but is missing either the username or the password
The server config specified username/password authentication but is missing either the username or the password
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 124, in main
    connection.initialize(max_timeout=1)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 92, in initialize
    raise Exception(_("The server config specified username/password authentication but "
Exception: The server config specified username/password authentication but is missing either the username or the password



>> mongo 
MongoDB shell version: 2.4.6
connecting to: test
> use pulp_database
switched to db pulp_database
> db.changeUserPassword("gena", "genka")
> exit
bye
>> vi /etc/pulp/server.conf
username: gena
password: genka

>> for s in {qpidd,pulp_celerybeat,pulp_resource_manager,pulp_workers,httpd}; do sudo systemctl restart $s; done;

>> pulp-admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  zoo_repo
Display Name:        zoo_repo
Description:         None
Content Unit Counts: 
  Erratum:          4
  Package Category: 1
  Package Group:    2

Comment 1 Brian Bouterse 2015-02-23 17:58:29 UTC
I think this bug is as simple as adjusting this section [0] of code so that if username is not the default (empty string) then both username and password will be included as connection_kwargs. The default password is an empty string so if the user does not adjust the password of server.conf [database] section then an empty password should be allowed.

[0]: https://github.com/pulp/pulp/blob/master/server/pulp/server/db/connection.py#L87-L93

Comment 2 Brian Bouterse 2015-02-28 23:25:24 UTC
Moved to https://pulp.plan.io/issues/708

Comment 3 pulp-infra@redhat.com 2015-05-22 16:30:29 UTC
The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug.

Comment 4 pulp-infra@redhat.com 2015-05-22 16:30:30 UTC
The Pulp upstream bug priority is at High. Updating the external tracker on this bug.

Comment 5 pulp-infra@redhat.com 2015-05-25 12:00:30 UTC
The Pulp upstream bug status is at VERIFIED. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2015-09-14 13:00:51 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.


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