[SERVER-9032] mongod fails when launched with misconfigured locale Created: 20/Mar/13 Updated: 14/Feb/17 Resolved: 17/Jun/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Stability |
| Affects Version/s: | 2.4.0 |
| Fix Version/s: | 2.6.5, 2.7.3 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Nick Demyanchuk | Assignee: | Mark Benvenuto |
| Resolution: | Done | Votes: | 2 |
| Labels: | cap-ticket-needed, community-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS: ubuntu 12.04 64 bit |
||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Operating System: | Linux | ||||||||||||||||||||||||||||||||||||||||
| Backport Completed: | |||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | in python:
|
||||||||||||||||||||||||||||||||||||||||
| Sprint: | Server 2.7.3 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Description |
| Comments |
| Comment by Akira Kurogane [ 07/Feb/17 ] | |||||||||||||||||||||||
|
Update Feb 2017:- it seems setting an invalid or empty locale no longer causes the problem as of 3.4. Versions 3.0 and 3.2 use boost 1.56 (i.e. newer than the boost bug #7388 fix listed earlier) but the error is still present. That is the following code from here still throws an exception:
MongoDB 3.4 is OK. This version uses boost 1.60.
| |||||||||||||||||||||||
| Comment by Githook User [ 15/Sep/14 ] | |||||||||||||||||||||||
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: On some Linux machines, users may have not have a locale set which will (cherry picked from commit ff70eb640552c049538a03d174edbc2c0311c8bd) | |||||||||||||||||||||||
| Comment by Githook User [ 17/Jun/14 ] | |||||||||||||||||||||||
|
Author: {u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}Message: On some Linux machines, users may have not have a locale set which will | |||||||||||||||||||||||
| Comment by Mark Benvenuto [ 28/May/14 ] | |||||||||||||||||||||||
|
Using SuSE Linux Enterprise Server 11 sp3 (PV) - ami-e8084981 (64-bit) (SuSE Linux Enterprise Server 11 Service Pack 3 (PV), EBS-backed with Amazon EC2 AMI Tools preinstalled; Apache 2.2, MySQL 5.5, PHP 5.3, and Ruby 1.8.7 available), I see
This was using GNU bash, version 3.2.51(1)-release (x86_64-suse-linux-gnu). I see that LC_CTYPE is set in /etc/profile.d/lang.sh via /etc/profile via /etc/bashrc. I also verified MongoDB 2.4.10 starts with just this single variable set. | |||||||||||||||||||||||
| Comment by Luis Barrios [ 19/May/14 ] | |||||||||||||||||||||||
|
This bug also appears with MongoDB 2.4.10 in SuSE Linux Enterprise 11 SP3. The locale is not configured by default. In order to avoid the issue, you must define the following variables in mongodb user's .bashrc file: | |||||||||||||||||||||||
| Comment by Michael Grundy [ 10/Apr/13 ] | |||||||||||||||||||||||
|
Easy repro steps for Ubuntu (from Ernie): LANG=crash mongod --logpath $(pwd)/mongod.log | |||||||||||||||||||||||
| Comment by Michael Grundy [ 26/Mar/13 ] | |||||||||||||||||||||||
|
Hi Nick - Thanks for the confirmation! I'm not sure why it doesn't fall back. Like you mentioned in 2.2 this wasn't a failure. This is specific to the logpath option. dbpath is handled differently and will print a message if there is a locale issue (and logpath wasn't specified, so it got past this issue). We should handle misconfigurations that affect logpath similarly. Thanks! | |||||||||||||||||||||||
| Comment by Nick Demyanchuk [ 26/Mar/13 ] | |||||||||||||||||||||||
|
Michael, you are absolutely right, i was trying to start mongod with nonexistent locale. BTW, why mongo just don't fall back to C locale in this case? | |||||||||||||||||||||||
| Comment by Michael Grundy [ 22/Mar/13 ] | |||||||||||||||||||||||
|
Hi Nick - Does your python script set a locale in it? I've seen this in an environment where the locale settings have uninstalled entries. Could you post the output of locale, locale -a, and any locale.setlocale() calls that are in your script (or possibly a module you are using). Thanks! | |||||||||||||||||||||||
| Comment by Eliot Horowitz (Inactive) [ 20/Mar/13 ] | |||||||||||||||||||||||
|
What directory are you running this from? |