Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1925

GridFS downloads incorrectly swallow server-side errors

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.2
    • Affects Version/s: 1.4.1
    • Component/s: GridFS
    • None
    • Environment:
      Debian 10
    • Not Needed

      New:

      **The original ticket describes a case where the driver may be swallowing a server-side CursorNotFound error and overwriting it with io.EOF. This is incorrect as EOF should only be used to indicate that the download is complete without any errors and is generally ignored by applications. Unexpected errors during the download process should be propagated without overwriting.

      Additionally, in the case of a cursor error in download_stream, we are not Closing the cursor. This should be fixed in the same ticket.

      Previous:

      I've got a ~70MB file that is happily stored in GridFS. I can see all the chunks happily in there and can download/save the file sensibly with various tools.

      However, when using the Go driver to read the file I only get the first 16MB of the file - no errors but it just believes this is the genuine end of the file. This just rings an alarm bell as I know that 16MB is the MongoDB max doc size (but obviously shouldn't apply/be relevant with chunked GridFS). Is there an issue with the Go driver?

      I'm using very standard code to read the file. I'm using a basic Bucket (only interesting thing about it is that is has a custom "name" rather than the default "fs"), and then just calling OpenDownloadStreamByName and calling Read on that.

      Anything obvious that I am doing wrong or is this a potential issue?

      Thanks.

            Assignee:
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Reporter:
            mongodb@liambrown.co.uk Liam Brown
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: