First of all, the setup:
-
Server: Ubuntu 10.04 server
mongod –version
db version v1.2.2, pdfile version 4.5
Wed Nov 23 11:35:42 git version: nogitversion
-
Client: Windows 7 64bit, VS2010 app, using official C# driver v1.3.
I’m trying to store a png image in the mongoDB using the GridFS. My code looks like this:
var GridFSInfo = DB.GridFS.Upload(TextureFileName, TextureFileName);
Running this code I get the following exception
An unhandled exception of type 'MongoDB.Driver.GridFS.MongoGridFSException' occurred in MongoDB.Driver.dll
Additional information: Upload client and server MD5 hashes are not equal.
I have tried to find info on this error, but I seem to be the only person having trouble with this 🙁
The server log doesn’t give any error, all I get is:
Wed Nov 23 11:42:23 connection accepted from 141.3.89.168:16861 #159
Wed Nov 23 11:42:25 building new index on { _id: ObjId(000000000000000000000000) } for ObjectDBTest.fs.files...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.files idxNo:0 { name: "_id_", ns: "ObjectDBTest.fs.files", key: { _id: ObjId(000000000000000000000000) } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 info: creating collection ObjectDBTest.fs.files on add index
Wed Nov 23 11:42:25 building new index on { filename: 1, uploadDate: 1 } for ObjectDBTest.fs.files...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.files idxNo:1 { _id: ObjId(4ecccd0382522c02f8e58d75), name: "filename_1_uploadDate_1", ns: "ObjectDBTest.fs.files", key: { filename: 1, uploadDate: 1 } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 building new index on { _id: ObjId(000000000000000000000000) } for ObjectDBTest.fs.chunks...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.chunks idxNo:0 { name: "_id_", ns: "ObjectDBTest.fs.chunks", key: { _id: ObjId(000000000000000000000000) } }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:25 info: creating collection ObjectDBTest.fs.chunks on add index
Wed Nov 23 11:42:25 building new index on { files_id: 1, n: 1 } for ObjectDBTest.fs.chunks...
Wed Nov 23 11:42:25 Buildindex ObjectDBTest.fs.chunks idxNo:1 { _id: ObjId(4ecccd0382522c02f8e58d76), name: "files_id_1_n_1", ns: "ObjectDBTest.fs.chunks", key: { files_id: 1, n: 1 }, unique: true }
Wed Nov 23 11:42:25 done for 0 records 0secs
Wed Nov 23 11:42:29 end connection 141.3.89.168:16861
This looks to me like the file transfer is initiated but then something goes wrong. I triplechecked that the file exists. I used the mongofiles command line utility to see if the GridFS works and everything is fine there, upload of files is no problem. My app also works fine if I do not make the GridFS upload and only use standard BSON document manipulation. I can insert, search, delete fine, so the connection to the server works.
I’m at a loss now as to what could be the source of this. I’d be thankful for any hints.
Is this easily reproducible? Is it related to a particular file? Let me know if you have any hints to reproduce this.
Are you really using v1.2.2 of the server? The current version is 2.0.1.