[JAVA-629] Corrupted mongo records getting inserted Created: 27/Aug/12 Updated: 25/Jun/13 Resolved: 11/Sep/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Paramita Ghosh | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | bson, driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Unix |
||
| Issue Links: |
|
||||
| Description |
|
Mongo records are getting created of type BSON 101. While trying to read the record using ruby gem it fails with the following error "No c decoder for this type yet(101)" Mongo validate provide the following info
|
| Comments |
| Comment by Jeffrey Yemin [ 11/Sep/12 ] |
|
It turns out this happens when you try to use a string with embedded nulls as a key inside an embedded object. |
| Comment by Paramita Ghosh [ 07/Sep/12 ] |
|
This issue is consistent when I try to insert a MultivaluedMap<String, String> in the mongo. I have tried with mongo 2.2 as well with same results. Could you please provide any insight on this. |
| Comment by Jeffrey Yemin [ 05/Sep/12 ] |
|
Paramita, Sorry to take so long to get back to you. Though you are using the Java driver, it's not clear that anything in the driver itself is causing corruption on the server. Are you able to reliably reproduce this error, and if so, can you provide us source that we can run ourselves? |
| Comment by Paramita Ghosh [ 27/Aug/12 ] |
|
The code which inserts the records create(Map<String, Object> body, Map<String, Object> metaData, String collectionName) { metaData = new HashMap<String, Object>(); //entity is a wrapper object to hold the body and metadata along with id <Spring Mongo Template>.insert(entity, collectionName); } |
| Comment by Paramita Ghosh [ 27/Aug/12 ] |
|
Here is the output from validate(True) |
| Comment by Scott Hernandez (Inactive) [ 27/Aug/12 ] |
|
Can you provide the output from your validate(true) as well as the sample code which inserted this bad data? |
| Comment by Paramita Ghosh [ 27/Aug/12 ] |
|
This issue is happening when we are trying to insert record from java code i.e the records are getting corrupted. And when I run the mongo db validate method on the collection in question, I receive the mentioned log. Since the record is getting corrupted(as per mongo validate) during the insert from java code I do not think this is a issue with ruby. The server version : 2.0.6 |
| Comment by Scott Hernandez (Inactive) [ 27/Aug/12 ] |
|
This doesn't sounds like a java exception nor error message. Did you mean to put this in the server project, or maybe ruby? How did you get this data into the database? What version is the server? |