<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-724] Downloading files from gridfs does not match uploaded data</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-724</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;See attached main.go file&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;it reads a file from /tmp/infile and uploads it to GridFS&lt;/li&gt;
	&lt;li&gt;downloads it from GridFS and writes it to /tmp/outfile&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;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 &quot;padded&quot; so it ends up being 256kb.&lt;/p&gt;

&lt;p&gt;For big files (say 12MB) the resulting&#160;outfile does not match the infile.&#160; The size is often smaller, and big chunks of data just seem to be nulls instead of the actual file data.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I also had issues uploading a 16MB video file, then the&#160;UploadFromStream returns the following error:&lt;/p&gt;

&lt;p&gt;2018/12/19 16:21:37 Uploading to mongo2018/12/19 16:21:37 Uploading to mongopanic: runtime error: index out of range&lt;br/&gt;
goroutine 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;running&amp;#93;&lt;/span&gt;:github.com/mongodb/mongo-go-driver/mongo/gridfs.(*UploadStream).uploadChunks(0xc0000bc2d0, 0x985940, 0xc0001680c0, 0x985940, 0xc0001680c0) /pkg/mod/github.com/mongodb/mongo-go-driver@v0.1.0/mongo/gridfs/upload_stream.go:163 +0x7bfgithub.com/mongodb/mongo-go-driver/mongo/gridfs.(*UploadStream).Close(0xc0000bc2d0, 0x0, 0x0) /pkg/mod/github.com/mongodb/mongo-go-driver@v0.1.0/mongo/gridfs/upload_stream.go:70 +0xfdgithub.com/mongodb/mongo-go-driver/mongo/gridfs.(*Bucket).UploadFromStreamWithID(0xc0001be000, 0x2bb9ac88f1531a5c, 0xc0c125834f, 0x85a272, 0x9, 0x9812c0, 0xc0001ae000, 0x0, 0x0, 0x0, ...) /pkg/mod/github.com/mongodb/mongo-go-driver@v0.1.0/mongo/gridfs/bucket.go:174 +0x1aegithub.com/mongodb/mongo-go-driver/mongo/gridfs.(*Bucket).UploadFromStream(0xc0001be000, 0x85a272, 0x9, 0x9812c0, 0xc0001ae000, 0x0, 0x0, 0x0, 0x0, 0xc000000000, ...) /pkg/mod/github.com/mongodb/mongo-go-driver@v0.1.0/mongo/gridfs/bucket.go:138 +0xd1main.Set(0xc0001a2060, 0x85a272, 0x9, 0x9812c0, 0xc0001ae000, 0x0, 0xc0001a2060) /src/bitbucket.org/mybeat/sortd_go/cmd/testmongo/main.go:70 +0x17bmain.main() /src/bitbucket.org/mybeat/sortd_go/cmd/testmongo/main.go:40 +0x33e&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I ran the same test using the mgo driver and there it worked as expected.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>mongodb v3.6.9&lt;br/&gt;
ubuntu1604</environment>
        <key id="657894">GODRIVER-724</key>
            <summary>Downloading files from gridfs does not match uploaded data</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="devin.hilly@mongodb.com">Devin Hilly</assignee>
                                    <reporter username="ronnie@sortd.com">Ronnie van der Veen</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Dec 2018 14:24:06 +0000</created>
                <updated>Sat, 28 Oct 2023 11:39:14 +0000</updated>
                            <resolved>Tue, 8 Jan 2019 16:07:23 +0000</resolved>
                                    <version>0.1.0</version>
                                    <fixVersion>0.2.0</fixVersion>
                                    <component>GridFS</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2108610" author="xgen-internal-githook" created="Tue, 8 Jan 2019 15:18:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;dmhilly&apos;, &apos;email&apos;: &apos;devin.hilly@mongodb.com&apos;, &apos;name&apos;: &apos;Devin Hilly&apos;}
&lt;p&gt;Message: Fixed bugs in gridfs implementation&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-724&quot; title=&quot;Downloading files from gridfs does not match uploaded data&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-724&quot;&gt;&lt;del&gt;GODRIVER-724&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Change-Id: I5afcd5b7dc810f1696a7ba1f258f3a80c4d0284c&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/2c8e308599d5b93871a9bfa75405148aea0d9257&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/2c8e308599d5b93871a9bfa75405148aea0d9257&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2095765" author="ronnie@sortd.com" created="Wed, 19 Dec 2018 14:34:08 +0000"  >&lt;p&gt;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.&#160; So the issue seems to be with downloading the file, not during the upload.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="204139" name="main.go" size="1914" author="ronnie@sortd.com" created="Wed, 19 Dec 2018 14:11:20 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu6zmn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>