Craig Box
2007-May-18 03:25 UTC
[Mongrel] No return status from mongrel upload progress (and thus no updates on the bar)
Hi all, I''m using Boxroom (http://boxroom.rubyforge.org/) and trying to get upload progress working. I''ve also been testing the sample code at http://itblog.mcgeecorp.com/2007/5/15/mongrel-upload-progress-demo/. I run a Mongrel cluster, and so am using drb (as per http://mongrel.rubyforge.org/docs/upload_progress.html). Starting up rails, I get lots of useful-sounding output: ** Starting Mongrel listening at 0.0.0.0:3000 ** Loading script/../config/../config/mongrel_upload_progress.conf external config script The bar doesn''t draw updates - if I connect with irb (as per the upload_progress page) irb(main):001:0> uploads = get_status => #<DRb::DRbObject:0xb7d1ef04 @ref=nil, @uri="druby://0.0.0.0:2999"> irb(main):002:0> uploads.list => [] Nice regular output in my development.log: Processing UploadsController#upload_progress (for 127.0.0.1 at 2007-05-18 15:20:29) [POST] Parameters: {"action"=>"upload_progress", "controller"=>"uploads", "upload_id"=>"aff07334-04ee-11dc-bd4b-000d608392b8"} Completed in 0.00966 (103 reqs/sec) | Rendering: 0.00848 (87%) | 200 OK [http://localhost/uploads/upload_progress?upload_id=aff07334-04ee-11dc-b d4b-000d608392b8] Processing UploadsController#upload_progress (for 127.0.0.1 at 2007-05-18 15:21:11) [POST] Parameters: {"action"=>"upload_progress", "controller"=>"uploads", "upload_id"=>"aff07334-04ee-11dc-bd4b-000d608392b8"} Completed in 0.00909 (109 reqs/sec) | Rendering: 0.00800 (88%) | 200 OK [http://localhost/uploads/upload_progress?upload_id=aff07334-04ee-11dc-b d4b-000d608392b8] status is always nil. It sounds like exactly the same problem as this person is having: http://www.ruby-forum.com/topic/102380 The entire setup is running on Ubuntu Dapper, with mongrel 1.0.1, cluster/upload_progress 0.2.1, rails 1.2.3 and rubygems 0.9.3. Any ideas? Should I (as per http://rubyforge.org/pipermail/mongrel-users/2006-November/002237.html) look at running something other than Mongrel for accepting uploads? Regards, Craig
John Lauck
2007-May-18 14:05 UTC
[Mongrel] No return status from mongrel upload progress (and thus no updates on the bar)
Craig, I have no experience with Boxroom, but I did just recently get the Mongrel Upload Progress working using the instructions on mongrel''s site. I''m developing locally on OS X, haven''t tested moving it to my Cent OS production environment yet. Anyway, are you running the upload.rb mentioned on the site? I forgot to execute that script along with mongrel a couple times and couldn''t figure out what was wrong. I also changed all the 0.0.0.0 IPs serving drb to 127.0.0.1 and it worked at that point. It was hard to gauge the upload progress because I only tested it on my local LAN so all uploads were at 100% within a second. However, it seemed to be working fine. John On 5/17/07, Craig Box <craig at itpartners.co.nz> wrote:> > Hi all, > > I''m using Boxroom (http://boxroom.rubyforge.org/) and trying to get > upload progress working. I''ve also been testing the sample code at > http://itblog.mcgeecorp.com/2007/5/15/mongrel-upload-progress-demo/. > > I run a Mongrel cluster, and so am using drb (as per > http://mongrel.rubyforge.org/docs/upload_progress.html). Starting up > rails, I get lots of useful-sounding output: > > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Loading script/../config/../config/mongrel_upload_progress.conf > external config script > > The bar doesn''t draw updates - if I connect with irb (as per the > upload_progress page) > > irb(main):001:0> uploads = get_status > => #<DRb::DRbObject:0xb7d1ef04 @ref=nil, @uri="druby://0.0.0.0:2999"> > irb(main):002:0> uploads.list > => [] > > Nice regular output in my development.log: > > Processing UploadsController#upload_progress (for 127.0.0.1 at > 2007-05-18 15:20:29) [POST] > Parameters: {"action"=>"upload_progress", "controller"=>"uploads", > "upload_id"=>"aff07334-04ee-11dc-bd4b-000d608392b8"} > Completed in 0.00966 (103 reqs/sec) | Rendering: 0.00848 (87%) | 200 OK > [http://localhost/uploads/upload_progress?upload_id=aff07334-04ee-11dc-b > d4b-000d608392b8] > > > Processing UploadsController#upload_progress (for 127.0.0.1 at > 2007-05-18 15:21:11) [POST] > Parameters: {"action"=>"upload_progress", "controller"=>"uploads", > "upload_id"=>"aff07334-04ee-11dc-bd4b-000d608392b8"} > Completed in 0.00909 (109 reqs/sec) | Rendering: 0.00800 (88%) | 200 OK > [http://localhost/uploads/upload_progress?upload_id=aff07334-04ee-11dc-b > d4b-000d608392b8] > > status is always nil. It sounds like exactly the same problem as this > person is having: http://www.ruby-forum.com/topic/102380 > > > The entire setup is running on Ubuntu Dapper, with mongrel 1.0.1, > cluster/upload_progress 0.2.1, rails 1.2.3 and rubygems 0.9.3. > > Any ideas? Should I (as per > http://rubyforge.org/pipermail/mongrel-users/2006-November/002237.html) > look at running something other than Mongrel for accepting uploads? > > > Regards, > Craig > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070518/a1701614/attachment.html
Craig Box
2007-May-20 00:30 UTC
[Mongrel] No return status from mongrel upload progress (andthus no updates on the bar)
> Anyway, are you running the upload.rb mentioned on the site? I forgot to > execute that script along with mongrel a couple times and couldn''t figure > out what was wrong. I also changed all the 0.0.0.0 IPs serving drb to > 127.0.0.1 and it worked at that point. It was hard to gauge the upload > progress because I only tested it on my local LAN so all uploads were at > 100% within a second. However, it seemed to be working fine.Yes, I am running all the right things, as far as I can tell.. a friend ran it on his machine and it all seemed to work for him. There must be something subtle I''m missing. Changing 0.0.0.0 to 127.0.0.1 didn''t change anything. (As an aside, if it matters, I''m starting mongrel on port 3000, and tunneling it to my web browser via SSH.) I''ve just read through the thread at http://rubyforge.org/pipermail/mongrel-users/2007-February/003028.html - another similar problem. Ultimately, a flash upload plugin would be the correct answer, but that will take a bit more time to implement (can anyone point me at a guide?) and the upload progress is the only part of the puzzle missing for me in the current version of the code. Regards Craig -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3608 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070520/f047fd8e/attachment-0001.bin
Craig Box
2007-May-20 04:48 UTC
[Mongrel] No return status from mongrel upload progress (and thus no updates on the bar)
To reply to my own message..> Anyway, are you running the upload.rb mentioned on the site? I forgot to > execute that script along with mongrel a couple times and couldn''t figure > out what was wrong. I also changed all the 0.0.0.0 IPs serving drb to > 127.0.0.1 and it worked at that point. It was hard to gauge the upload > progress because I only tested it on my local LAN so all uploads were at > 100% within a second. However, it seemed to be working fine.Running with or without DRb doesn''t matter. If I manually connect to where the log suggests my 200 OKs are coming from, I get similar output to http://rubyforge.org/pipermail/mongrel-users/2006-December/002584.html - try { } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''''); throw e } with no JS to actually change the content of the bar. I don''t have any routes to change (as per http://rubyforge.org/pipermail/mongrel-users/2007-February/002995.html) and I am not using it behind a proxy. Any of this jog any memories with anyone? Craig -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3557 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070520/b3d51059/attachment.bin
Craig Box
2007-May-28 00:04 UTC
[Mongrel] No return status from mongrel upload progress (and thus no updates on the bar)
Hi again, I''ve summarised methods to get upload progress in a Rails application: http://craig.dubculture.co.nz/blog/2007/05/27/ways-to-get-an-upload-prog ress-bar-in-a-ruby-on-rails-application/ My original problem went away - I''m not 100% sure how or why, but it seems that it may have been cleared up by a combination of not running the app or DRb server as root (which seems odd), or running ''gem cleanup''. However, I''m now stuck with the problem that I''m using Apache 2.2 as my load balancer, and I assume it buffers the upload before passing it to Mongrel: I don''t get anything in the Uploads.list, so again, no progress. Works fine if I connect directly to the Mongrel it''s proxying. My options here seem to be "find a way to break Apache''s upload performance", or "run a Mongrel instance on a different port, and instruct the app to connect to this to do its uploads". The second method seems widely advocated here, but I''ve not seen any suggestions on how to actually do this. Is it as "simple" as hard-coding the location (urgh!) in the view? If I run a cluster of Mongrels for the listener and one for the uploads, will that be suitable? Or does anyone know the incantation for Apache to allow me to do what I want? The site isn''t high traffic, so I doubt it will be a huge performance hit. Thanks in advance, Craig