[SERVER-22678] Error while inserting file in gridFS with pymongo driver Created: 17/Feb/16 Updated: 25/Feb/16 Resolved: 25/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | GridFS, MMAPv1 |
| Affects Version/s: | 3.2.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kedar Aitawdekar | Assignee: | Kelsey Schubert |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux Ubuntu14 3.13.0-77-generic #121-Ubuntu SMP Wed Jan 20 10:50:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux |
||
| Attachments: |
|
| Operating System: | Linux |
| Steps To Reproduce: | While inserting a file in gridFS. |
| Participants: |
| Description |
|
We (project: gstudio) are using mongoDB from last 2yrs for saving files in gridFS. But recently I'm facing problem of inserting files (or chunks) in gridFS in existing DB. It's giving following exception: After deeply analysing code, I comes to conclusion that code is breaking while inserting a chunk from: grid/grid_file.py file at __flush_data method's line: self._chunks.insert(chunk). And because of this following consequences are happening:
MongoDB version: collection: System details: Following is error trace from diagnostic data capture with directory '/var/lib/mongodb/diagnostic.data':
|
| Comments |
| Comment by Kelsey Schubert [ 25/Feb/16 ] |
|
That's great to hear, kedar2a. Since the issue has been resolved, I'm going to close the ticket. Regards, |
| Comment by Kedar Aitawdekar [ 21/Feb/16 ] |
|
Hello anonymous.user, Thank you for your continuous consideration into the issue.
And it solved my problem. Now files are getting into the gridFS. Thank You anonymous.user! |
| Comment by Kelsey Schubert [ 19/Feb/16 ] |
|
Hi kedar2a, Thank you for the information. Unfortunately, removing recently added files or chunks will not resolve the issue. I have a few additional questions as we continue to investigate this issue:
Assuming you are unable to insert files using mongofiles, you have two options since rebuilding the indexes did not correct the issue. The first is repairDatabase(). If the data files are not corrupted, repairDatabase will retain every document. However, if the the data files are corrupted. This method may discard some documents that are physically present in the data files, but are unreachable from the "root" data structure in the .ns file. mongodump --repair is your second option. It has a higher chance of finding all structural valid documents that can be reached, but also has a high probability of dumping the same documents multiple times as well as different versions of the same documents. This method relies on you to determine which duplicate represents the most current version of your data. Kind regards, |
| Comment by Kedar Aitawdekar [ 18/Feb/16 ] |
|
Hi Thomas Schubert, Thank you, for your attention into problem. Following is replies to your set of questions:
Some additional information:
Some queries:
|
| Comment by Kedar Aitawdekar [ 18/Feb/16 ] |
|
Some of the operations performed on db.fs.chunks regarding indexing in mongo shell. |
| Comment by Kelsey Schubert [ 17/Feb/16 ] |
|
Hi kedar2a, The stack trace that you have provided indicates that some or all of the data data files have become corrupt in some way. In these situations, the corruption may be in the index or the data itself. Unfortunately, it is very difficult to determine whether the corruption is isolated beyond the file level. I have compiled a list of routine questions about data storage and the configuration of your environment. We can use these questions to help get a better understanding of what is going on here.
I would recommend a clean resync from a node that is not affected. If that is not possible, I would recommend executing repairDatabase. I would also suggest that you check the integrity of the affected nodes's disk drives. If the assertion failures continue to persist, you may need to replace them. Regards, |