Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2566

Server error ignored during GridFS chunk upload

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0
    • Affects Version/s: None
    • Component/s: GridFS
    • Labels:
      None

      Found by Jeroenooms, 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.

      Either:
      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.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: