Bug 1265976

Summary: [origin_devexp_679]Error appears when login in mongodb26 database in container for both centos7 and rhel7
Product: Red Hat Software Collections Reporter: wewang <wewang>
Component: rh-mongodb26-containerAssignee: Marek Skalick√Ĺ <mskalick>
Status: CLOSED ERRATA QA Contact: wewang <wewang>
Severity: medium Docs Contact:
Priority: medium    
Version: rh-mongodb26CC: aos-bugs, hhorak, jorton, kanderso, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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:14 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1220712    

Description wewang 2015-09-24 04:49:39 EDT
Version-Release number of selected component (if applicable):
devenv-fedora_2387
centos/mongodb-26-centos7       17d33d90862d
rhscl/mongodb-26-rhel7               027d85807877

Description of problem:
when login in mongodb26 in container, appears error "open for '//.mongorc.js' failed with errno:13 Permission denied"

How reproducible:
Always

Steps to Reproduce:
1.Run the mongodb-26-centos7 image
$  mkdir -p /home/user/database && chown -R 234523:998 /home/user/database
$  docker run -d -u 234523 -e MONGODB_USER=user -e MONGODB_PASSWORD=pass -e MONGODB_DATABASE=test_db -e MONGODB_ADMIN_PASSWORD=pass -v /home/user/database:/var/lib/mongodb/data:Z  centos/mongodb-26-centos7

2.Access into container
$docker ps | grep mongo  (to get the container id)
$docker inspect <container_id> | grep IPAddress
$docker exec -ti <container_id> scl enable rh-mongodb26 /bin/bash

3. Create SQL queries in container 
bash-4.2$ mongo test_db -u user -p pass 
MongoDB shell version: 2.6.9
connecting to: test_db
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-24T03:17:01.840+0000 In File::open(), ::open for '//.mongorc.js' failed with errno:13 Permission denied
>

Actual results:
when Login in mongodb26 in container, appear errors
Expected results:
login in successfully ,no errors
Comment 1 Ben Parees 2015-09-24 09:57:51 EDT
wewang:  for images being provided by the SCL team, i'll be reassigning these bugs to their components, is that going to cause a problem for your processes/reporting?

SCL team:  the openshift QE team expects you'll move the bug to ON_QA once it is ready for them to re-test.
Comment 2 wewang 2015-09-24 21:59:40 EDT
Ben Parees:ok,and give similar  errors like :
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-25T01:57:32.520+0000 In File::open(), ::open for '//.mongorc.js' failed with errno:13 Permission denied
> show dbs;
2015-09-25T01:57:49.423+0000 listDatabases failed:{
	"ok" : 0,
	"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
	"code" : 13
} at src/mongo/shell/mongo.js:47
>
Comment 3 Marek Skalick√Ĺ 2015-10-12 08:40:13 EDT
Should be fixed in upstream by this pull request - https://github.com/openshift/mongodb/pull/91

I am going to sync it to the dist-git soon...
Comment 4 wewang 2015-10-16 04:51:34 EDT
verified in devenv_fedora_2444
centos/mongodb-26-centos7    image_id:3c37801bcaa6
rhscl/mongodb-26-rhel7       image_id:fccbcf0c20d7

bash-4.2$ mongo test_db -u user -p pass 
MongoDB shell version: 2.6.9
connecting to: test_db
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
> show collections;
> doc={"a":"test1"};
{ "a" : "test1" }
Comment 7 errata-xmlrpc 2015-11-16 10:56:14 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