[GODRIVER-724] Downloading files from gridfs does not match uploaded data Created: 19/Dec/18 Updated: 28/Oct/23 Resolved: 08/Jan/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | GridFS |
| Affects Version/s: | 0.1.0 |
| Fix Version/s: | 0.2.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Ronnie van der Veen | Assignee: | Devin Hilly (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongodb v3.6.9 |
||
| Attachments: |
|
| Description |
|
See attached main.go file
I'd expect the input and output files to be the same size and have the same content, but for file sizes smaller than the default chunksize the downloaded file seems to be "padded" so it ends up being 256kb. For big files (say 12MB) the resulting outfile does not match the infile. The size is often smaller, and big chunks of data just seem to be nulls instead of the actual file data.
I also had issues uploading a 16MB video file, then the UploadFromStream returns the following error: 2018/12/19 16:21:37 Uploading to mongo2018/12/19 16:21:37 Uploading to mongopanic: runtime error: index out of range
I ran the same test using the mgo driver and there it worked as expected.
|
| Comments |
| Comment by Githook User [ 08/Jan/19 ] |
|
Author: {'username': 'dmhilly', 'email': 'devin.hilly@mongodb.com', 'name': 'Devin Hilly'}Message: Fixed bugs in gridfs implementation Change-Id: I5afcd5b7dc810f1696a7ba1f258f3a80c4d0284c |
| Comment by Ronnie van der Veen [ 19/Dec/18 ] |
|
What I forgot to mention with the first part of the report is that when I download the file from mongodb using another tool (NoSQLBooster for MongoDB) the file is correct. So the issue seems to be with downloading the file, not during the upload. |