[SERVER-12976] Misleading error when inserting into collection with long name. Created: 28/Feb/14 Updated: 28/Oct/15 Resolved: 07/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 2.6.0-rc0 |
| Fix Version/s: | 2.6.0-rc2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||
| Operating System: | ALL | ||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||
| Participants: |
| Description |
|
Attempting to insert into a collection with a 127-character-long name fails, with the error message: "ns name too long, max size is 127 bytes". I seems it should actually say, "120 bytes." If the length of the fully-qualified namespace (db + "." + collection) is at most 127 characters, we get a more accurate error, "fully qualified namespace db.<LONG-COLLECTION-NAME> is too long (max is 120 bytes)". Another possible value is 123 bytes, documented here: http://docs.mongodb.org/manual/reference/limits/ |
| Comments |
| Comment by Githook User [ 07/Mar/14 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: This should improve error messages for over-length collections. Previously |
| Comment by Mathias Stearn [ 06/Mar/14 ] |
|
It's a bit complicated. Namespaces are limited to 127 bytes, but collections are limited to 120 since each collection also gets an db.collection.$extra namespace that also needs to fit under the 127 byte limit. I'll see what I can do about making the error better here. |