Better error message from mongofiles for missing file in fs.files

129 views
Skip to first unread message

Kirill Teplinskiy

unread,
Jul 15, 2015, 9:15:09 AM7/15/15
to mongo...@googlegroups.com
Version: 3.0.3 on Windows 8.1

Steps to reproduce:

1.  Create document in `fs.files`.
2.  Do not create document in `fs.chunks`.
3.  Call `mongofiles -d gofra --local out.dat get_id <ID>`

It prints this output:

    2015-07-15T17:53:56.940+0500    connected to: localhost
    2015-07-15T17:53:56.943+0500    found file '/out/published/export_daily_001.xml.zip' with _id ObjectId("5570f79a56873010b85fdb15")
    2015-07-15T17:53:56.944+0500    Failed: error while writing data into local file 'out.dat': not found

So the file is found and not found at the same time.  Maybe it is strange having document in `fs.files` and not having in `fs.chunks` but it works good for us.  We move old files from GridFS to Ceph and when we do so we delete the file from `fs.chunks` but preserve its metadata in `fs.files`.

Do you like the idea of clarifying error message for such case a bit?  For example, the tool could write something like this "Failed: error while writing data into local file 'out.dat':file not found in fs.chunks`.
Reply all
Reply to author
Forward
0 new messages