[SERVER-32421] Mongo is not accepting password as a parameter Created: 20/Dec/17 Updated: 27/Oct/23 Resolved: 10/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.2.11 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | t.jones | Assignee: | ADAM Martin (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Debian 9.3 x64 |
||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
While connecting to MongoDB 3.2 via "mongo" from Debian 9 shell it seems that the password can only be typed manually after being promted for it. Example:
Repro steps:
Expected result:
Actual result:
According to the documentation, passing password as a parameter is possible, so what's going on here? |
| Comments |
| Comment by ADAM Martin (Inactive) [ 10/Jan/18 ] | ||||||||||
|
This appears to work correctly in the shell for version 3.6. This issue has been fixed in current versions of the shell. If you are unable to use the workaround for this issue, please upgrade to a later version of the MongoDB Shell. | ||||||||||
| Comment by t.jones [ 02/Jan/18 ] | ||||||||||
|
adam.martin I did some testing and indeed I can now connect with space between -p and password:
I tested on Debian 8.10 with Mongo installed from MongoDB's repos: https://docs.mongodb.com/master/tutorial/install-mongodb-on-debian/
I'd like to point out, however, that this testing scenario is not exactly perfect for me:
| ||||||||||
| Comment by ADAM Martin (Inactive) [ 29/Dec/17 ] | ||||||||||
|
Hello t.jones, I've performed a small test of this behavior on our master branch, and it seems that the shell accepts a password without a space between "-p" and the password text. Can you confirm that this is now fixed for your use case with 3.6's shell? | ||||||||||
| Comment by t.jones [ 21/Dec/17 ] | ||||||||||
|
mark.agarunov, thanks for the feedback. The workaround is suprisingly trivial, so I am totally OK with using it until the fix appears. Thanks! | ||||||||||
| Comment by Mark Agarunov [ 20/Dec/17 ] | ||||||||||
|
Hello t.jones, Thank you for the report. After some testing, I'm able to reproduce this issue and am investigating the cause. However, as a workaround it appears that if you do not leave a space between the -p flag and the password, it logs in as expected:
Thanks, |