Bug 1371295

Summary: mongoexport / mongoimport fail auth
Product: OpenShift Online Reporter: M Chibani <mch5000>
Component: ocAssignee: Timothy Williams <tiwillia>
Status: CLOSED WONTFIX QA Contact: Xingxing Xia <xxia>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: abhgupta, aos-bugs, jokerman, mch5000, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-31 18:22:11 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:

Description M Chibani 2016-08-29 20:18:09 UTC
Description of problem:

mongoexport / mongoimport on db that is not named as the app name fail auth and send a fail message as follows:

connected to: 127.7.108.2
assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }


How reproducible:

tried it on two different gears and got the same results.


Steps to Reproduce:
1. mongoexport --db AnotherName --collection AnyCollection --out app-root/repo/data/Outputfile.json -u $OPENSHIFT_MONGODB_DB_USERNAME -p $OPENSHIFT_MONGODB_DB_PASSWORD -h $OPENSHIFT_MONGODB_DB_HOST

2 1. mongoimport --db AnotherName --collection AnyCollection 
--file Imputfile.json --type json -u $OPENSHIFT_MONGODB_DB_USERNAME 
-p $OPENSHIFT_MONGODB_DB_PASSWORD -h $OPENSHIFT_MONGODB_DB_HOST


Actual results:

connected to: 127.7.108.2
assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }

Expected results:

connected to: 127.8.212.2
Mon Aug 29 11:22:57.701 check X xxx
Mon Aug 29 11:22:57.730 exported / imported xxx objects

Additional info:

Not sure this the right place for this issue!! if it is not please advise. Thanks

Comment 1 Abhishek Gupta 2016-09-26 19:39:16 UTC
I have a couple of questions to help identify the issue and the use case and the appropriate fix.

Q1. How do we end up in this situation? Are you creating a new db on the existing mongo gear in your application via the mongo CLI?
Q2. If the above is true, what is the use case for creating a separate db in the gear?

Comment 2 M Chibani 2016-09-27 19:07:17 UTC
(In reply to Abhishek Gupta from comment #1)
> I have a couple of questions to help identify the issue and the use case and
> the appropriate fix.
> 
> Q1. How do we end up in this situation? Are you creating a new db on the
> existing mongo gear in your application via the mongo CLI?
> Q2. If the above is true, what is the use case for creating a separate db in
> the gear?

Initially the database was not on the gear.  From inside the app, I created / used the database without thinking of any changes and everything was working seamlessly. Then for a reason I wanted to import/export dbs content and got into the bug. From inside the app everythong is working. The only problem occurs when it come to import export with a name different than the app name. It seems that the gear architecture  allows only for one db. Not sure if that is the case. and if it is why.

Comment 3 Eric Paris 2017-05-31 18:22:11 UTC
We apologize, however, we do not plan to address this report at this time. The majority of our active development is for the v3 version of OpenShift. If you would like for Red Hat to reconsider this decision, please reach out to your support representative. We are very sorry for any inconvenience this may cause.

Comment 4 M Chibani 2017-06-01 14:10:35 UTC
Understood