# Cgi.params sometimes empty following post to a form handler with mod\_ruby

**URL:** <https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243>\
**Category:** Ruby\
**Created:** [February 6, 2008, 4:10am UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243 "2008-02-06T04:10:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 6, 2008, 4:10am UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/1 "2008-02-06T04:10:29Z")

</div>

I have a simple form handler in the form of an rhtml file being served  
by Apache 2 and mod\_ruby. On occasion, the CGI object created with  
CGI.new will have an empty parameter list even though values were  
posted from the form. I checked with a packet sniffer to make sure the  
values were actually being transmitted, and they were. It works 90% of  
the time, but that’s not acceptable for something seen by real users.

It’s very hard to troubleshoot this, as the problem only occurs  
occasionally. Has anyone seen something like this before?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 6, 2008, 12:03pm UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/2 "2008-02-06T12:03:58Z")

</div>

Isn’t mod\_ruby legacy now for serving ruby applications over the web?  
Are you using a custom framework or something like camping et al?

Cheers

Tim

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 6, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/3 "2008-02-06T19:00:27Z")

</div>

On Feb 6, 6:03 am, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Isn’t mod\_ruby legacy now for serving ruby applications over the web?  
> Are you using a custom framework or something like camping et al?

Probably, but legacy shouldn’t mean totally broken. I’m not using a  
framework at all - just a couple rhtml files. This really isn’t  
complicated enough to justify using a framework, but if I keep having  
problems, I might move to Merb.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 6, 2008, 7:02pm UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/4 "2008-02-06T19:02:53Z")

</div>

To be honest, if its just a web RHTML files dont bother moving to merb -  
you dont need the overhead. Take a look at ‘webby’ or ‘webgen’ - they’ll  
give you the RHTML functionality you need.

Cheers

Tim

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 6, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/5 "2008-02-06T19:07:14Z")

</div>

Tim P. wrote:

> To be honest, if its just a web RHTML files dont bother moving to merb -  
> you dont need the overhead. Take a look at ‘webby’ or ‘webgen’ - they’ll  
> give you the RHTML functionality you need.

Neither of those need mod\_ruby by the way. They’ll just work with Apache  
as straight HTML

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 7, 2008, 10:10am UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/6 "2008-02-07T10:10:25Z")

</div>

removed\_email\_address@domain.invalid wrote:

> It looks like these are useful templating systems for a static site,  
> but what I need here is a form handler that saves the values posted to  
> the form on the server for use by other scripts.

Oh ok - perhaps you should take a look camping? That would give you  
basic form handling in probably the smallest framework footprint.  
Otherwise if you _do_ need something more complex in the way of post  
processing then look at merb/rails et al

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 15, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/7 "2008-02-15T23:12:56Z")

</div>

On Feb 6, 2008, at 3:03 AM, Tim P. wrote:

> Isn’t mod\_ruby legacy now for serving ruby applications over the web?

What do you mean by “legacy”? There’s some new “web” that’s been  
invented since the last release for which it’s unsuitable?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 7, 2008, 1:46am UTC](https://www.ruby-forum.com/t/cgi-params-sometimes-empty-following-post-to-a-form-handler-with-mod-ruby/128243/8 "2008-02-07T01:46:33Z")

</div>

It looks like these are useful templating systems for a static site,  
but what I need here is a form handler that saves the values posted to  
the form on the server for use by other scripts.
