Found by Jeroen Ooms [X], possible bug in the C Driver's GridFS implementation. Using a free mLab account, uploading a 3.5MB file silently fails. The fs.files document is written with "length" equal to one chunk (255k), and no chunk is written at all. The GridFS API appears to return a success, however.
This seems related to mLab storage limits. Once we dropped the database, uploads worked correctly.
1. The C Driver ignores an error that it should report when chunk-upload fails
2. Jeroen's use of the C Driver ignores an error
3. mLab acts weird when it a write would exceed the storage limit
Jeroen, could you paste the C code that uploads a file and checks for error please?
Update: #1 is correct. mongoc_gridfs_create_file_from_stream() ignores errors from mongoc_gridfs_file_writev while uploading chunks. I imagine that if an mLab user is too close to quota to save a chunk but still has space left for the fs.files record, that mongoc_gridfs_file_writev fails silently and mongoc_gridfs_file_save succeeds.