Hello,

I have a new Heroku Cedar account and I'm working through a problem
retrieving video files from MongoLab/GridFS via Rails. It works
correctly on my local machine, and on Heroku I can successfully upload
and retrieve image files, but video files correctly uploaded are never
displayed (and apparently not returned by the database).

The Heroku logs have entries with a GET and then a [router] timestamp,
such as:

2012-04-14T23:43:57+00:00 heroku[router]: GET abcxyz.herokuapp.com/
videos/4f89ec49cf96fc0003000005 dyno=web.1 queue=0 wait=0ms
service=11ms status=200 bytes=1723
2012-04-14T23:43:57+00:00 app[web.1]:
2012-04-14T23:43:57+00:00 app[web.1]:
2012-04-14T23:43:57+00:00 app[web.1]: Started GET "/grid/video/video/
4f89ec49cf96fc0003000005/From_the_Deck-2.mov" for 76.119.xxx.xx at
2012-04-14 23:43:57 +0000
2012-04-14T23:43:57+00:00 app[web.1]:
2012-04-14T23:43:57+00:00 app[web.1]:
2012-04-14T23:43:57+00:00 app[web.1]: Started GET "/grid/video/video/
4f89ec49cf96fc0003000005/From_the_Deck-2.mov" for 76.119.xxx.xx at
2012-04-14 23:43:57 +0000
2012-04-14T23:43:58+00:00 heroku[router]: GET abcxyz.herokuapp.com/
grid/video/video/4f89ec49cf96fc0003000005/From_the_Deck-2.mov dyno=web.
1 queue=0 wait=0ms service=483ms status=200 bytes=4700208
2012-04-14T23:43:58+00:00 heroku[router]: GET abcxyz.herokuapp.com/
grid/video/video/4f89ec49cf96fc0003000005/From_the_Deck-2.mov dyno=web.
1 queue=0 wait=0ms service=239ms status=200 bytes=4700208
2012-04-14T23:43:58+00:00 app[web.1]:
2012-04-14T23:43:58+00:00 app[web.1]:
2012-04-14T23:43:58+00:00 app[web.1]: Started GET "/grid/video/video/
4f89ec49cf96fc0003000005/From_the_Deck-2.mov" for 76.119.xxx.xx at
2012-04-14 23:43:58 +0000
2012-04-14T23:43:58+00:00 heroku[router]: GET abcxyz.herokuapp.com/
grid/video/video/4f89ec49cf96fc0003000005/From_the_Deck-2.mov dyno=web.
1 queue=0 wait=0ms service=213ms status=200 bytes=4700208

Whereas the local logs have the GET followed by database calls to
stream the file:

Started GET "/grid/video/video/4f89e7375f8dab2852000002/
FromTheDriveway-1024-15a.mov" for 127.0.0.1 at 2012-04-14 19:34:16
-0400
MONGODB (0ms)
pitchfest2_development['system.indexes'].insert([{:name=>"filename_1_uploadDate_-1",
 :ns=>"pitchfest2_development.fs.files", :key=>{"filename"=>1,
"uploadDate"=>-1}}])
MONGODB (0ms)
pitchfest2_development['system.indexes'].insert([{:name=>"files_id_1_n_1", 
:ns=>"pitchfest2_development.fs.chunks", :key=>{"files_id"=>1,
"n"=>1}, :unique=>true}])
MONGODB (0ms)
pitchfest2_development['fs.files'].find({"filename"=>"video/video/
4f89e7375f8dab2852000002/
FromTheDriveway-1024-15a.mov"}).limit(1).sort([["filename", 1],
["uploadDate", -1]])
MONGODB (1ms)
pitchfest2_development['fs.chunks'].find({"files_id"=>BSON::ObjectId('4f89e7375f8dab2852000003'),
"n"=>0})

I am using code to stream the file content:

gridfs_file =
Mongo::GridFileSystem.new(Mongoid.database).open(gridfs_path, 'r')
self.response_body = gridfs_file.read
self.content_type = gridfs_file.content_type

The file does exist in the MongoLab database attached to Heroku (I can
browse to it via the web interface).

So - I'm not sure how to debug this further.... Any thoughts
appreciated.

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to