Bug 1266399 - [origin_devexp_679]Mongodb cannot be connected after change admin and user password or re-deployment for persistent storage for centos7 and rhel7
[origin_devexp_679]Mongodb cannot be connected after change admin and user pa...
Status: CLOSED ERRATA
Product: Red Hat Software Collections
Classification: Red Hat
Component: rh-mongodb26-docker (Show other bugs)
rh-mongodb26
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Marek Skalický
wewang
:
Depends On:
Blocks: 1220712
  Show dependency treegraph
 
Reported: 2015-09-25 04:06 EDT by wewang
Modified: 2015-11-16 10:56 EST (History)
5 users (show)

See Also:
Fixed In Version: rhscl/mongodb-26-rhel7:2.6-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-16 10:56:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description wewang 2015-09-25 04:06:10 EDT
Version-Release number of selected component (if applicable):
devenv-fedora_2396
centos/mongodb-26-centos7       ef7c6cc1245e
rhscl/mongodb-26-rhel7          201b0b69dd4e

Description of problem:
When change the admin and user password of mongodb, connect db using new password, error appears like: Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1260

How reproducible:
Always

Steps to Reproduce:
1. Setup nfs server
2. Create pv on master
3.Create imagestream and deploy mongodb-26-centos7 image in openshift
$oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/image-streams/extra-image-streams-centos7.json
$oc process -f examples/db-templates/mongodb-persistent-template.json  | oc create  -f -

4. Check the pod is running
  #oc get pods
  
5. Access mongodb 
# oc rsh mongodb-1-tf358
bash-4.2$  mongo  sampledb  -u userTP7 -p3mTi1WiM4EBGa1KT

6. Change the admin and user password of mongodb
$ oc env dc/mongodb MONGODB_PASSWORD=NewPassrod MONGODB_ADMIN_PASSWORD=NewPassrod

7. Verify the password in pod have changed
# oc env pods mongodb-2-cepng --list
# pods mongodb-2-cepng, container mongodb
MONGODB_USER=userTP7
MONGODB_PASSWORD=NewPassrod
MONGODB_DATABASE=sampledb
MONGODB_ADMIN_PASSWORD=NewPassrod

8. Verify can connect to mongodb using new password and all the data still exist after change password.
# oc rsh mongodb-2-cepng
bash-4.2$  mongo  sampledb  -u userTP7 -pNewPassrod
MongoDB shell version: 2.6.9
connecting to: sampledb
2015-09-25T02:04:14.198+0000 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1260
exception: login failed

9. Using old password to connect mongodb
bash-4.2$  mongo  sampledb  -u userTP7 -p3mTi1WiM4EBGa1KT
MongoDB shell version: 2.6.9
connecting to: sampledb
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
2015-09-25T02:04:42.287+0000 In File::open(), ::open for '//.mongorc.js' failed with errno:13 Permission denied
> 


Actual results:
Cannnot using new password to connect to mongdb26


Expected results:
Can using new password to connect to mongdb26

Additional info:
Comment 1 Marek Skalický 2015-10-22 09:35:47 EDT
This is fixed in upstream by this PR - https://github.com/openshift/mongodb/pull/97

So please test.
Comment 5 errata-xmlrpc 2015-11-16 10:56:21 EST
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, 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://rhn.redhat.com/errata/RHBA-2015-2056.html

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