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 15:56:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1220712    

Description wewang 2015-09-24 08:49:39 UTC
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 13:57:51 UTC
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-25 01:59:40 UTC
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 12:40:13 UTC
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 08:51:34 UTC
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 15:56:14 UTC
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