List Info

Thread: Mongrel BAD CLIENT errors




Mongrel BAD CLIENT errors
user name
2006-10-09 20:46:46
Hi

I have just installed InstantRails and (after some work) have got my existing app working. I am now getting BAD CLIENT errors on some form posts but have no idea why. Having looked at the mongrel docs it seems I should be able to get to the bottom of this if I can get debug set to true but I cannot see where to do this in InstantRails?

Any pointers?

Thanks
Dave
Mongrel BAD CLIENT errors
user name
2006-10-10 03:51:08
On 10/9/06, Dave Havard < david.havardgmail.com">david.havardgmail.com> wrote:
Hi

I have just installed InstantRails and (after some work) have got my existing app working. I am now getting BAD CLIENT errors on some form posts but have no idea why. Having looked at the mongrel docs it seems I should be able to get to the bottom of this if I can get debug set to true but I cannot see where to do this in InstantRails?

Any pointers?

You'll need to start mongrel by hand. Use Instant Rails to open a ruby console window (menu command "Rails Applications>Open Ruby Console Window&quot;), change your current directory to move in to your Rails application's root directory, and then type in the "mongrel_rails&quot; command with whatever options you like.

Curt
Mongrel BAD CLIENT errors
user name
2006-10-10 09:39:04
Thank you Curt.

That has got debugging working but has made things no clearer on why some of my form posts are not working. The post does not seem to get logged - only reported as a bad client to the console window. Any ideas what I should be looking for? My view contains the following code:

&lt;% title = "Sign up" %>
<%= error_messages_for 'user' %>
<%= form_tag %>
<table>
&nbsp;   <tr>
 &nbsp; &nbsp; &nbsp;  <td>Username:&lt;/td>
&nbsp;   ; &nbsp;  <td><%= text_field("user", "username") %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td>Password:&lt;/td>
&nbsp;   ; &nbsp;  <td><%= password_field("user", "password") %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td>Confirm Password:&lt;/td>
 &nbsp; &nbsp; &nbsp;  <td><%= password_field("user", "confirm_password") %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td>Email Address:&lt;/td>
&nbsp;   ; &nbsp;  <td><%= text_field("user", "email") %></td>
&nbsp; &nbsp; <tr>
 &nbsp; &nbsp; &nbsp;  <td>First Name:</td>
&nbsp; &nbsp; &nbsp; &nbsp; <td><%= text_field("user", "first_name";) %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td>Last Name:</td>
&nbsp; &nbsp; &nbsp;   <td><%= text_field("user", "last_name") %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td>Screen Name:</td>
&nbsp; &nbsp; &nbsp; &nbsp; <td><%= text_field("user", "screen_name&quot;) %></td>
&nbsp; &nbsp; </tr>;
 &nbsp;  <tr>
 &nbsp; &nbsp; &nbsp;  <td></td>
 &nbsp; &nbsp; &nbsp;  <td><input type=";submit&quot; value=&quot;Sign up"/&gt;</td&gt;
 &nbsp;  </tr>;
</table>
<%= end_form_tag %>

Whilst my controller looks like:

&nbsp; def signup
&nbsp; &nbsp; if request.get?
 &nbsp; &nbsp;  user = User.new
&nbsp;   else
 ; &nbsp; &nbsp; if params[:user][:password] != params[:user][:confirm_password]
 &nbsp; &nbsp; &nbsp;  flash[:notice] = "Passwords do not match!&quot;
 &nbsp;   ; else
 ; &nbsp; &nbsp; &nbsp; user = User.new(params[:user])
 &nbsp; &nbsp;   ; if user.save
  ; &nbsp; &nbsp; &nbsp;  session[:user] = user.id
&nbsp;   ; &nbsp; &nbsp;  redirect_to :controller => "pages", :action => "show", :id => 1
 &nbsp;   ; &nbsp; end
   ; &nbsp; end
   ; end
  end

The get part of the view is being rendered fine. Only when I post back is it failing.

Thanks
Dave

On 10/10/06, Curt Hibbs < curt.hibbsgmail.com">curt.hibbsgmail.com> wrote:
On 10/9/06, Dave Havard < david.havardgmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">david.havardgmail.com > wrote:
Hi

I have just installed InstantRails and (after some work) have got my existing app working. I am now getting BAD CLIENT errors on some form posts but have no idea why. Having looked at the mongrel docs it seems I should be able to get to the bottom of this if I can get debug set to true but I cannot see where to do this in InstantRails?

Any pointers?

You'll need to start mongrel by hand. Use Instant Rails to open a ruby console window (menu command "Rails Applications>Open Ruby Console Window&quot;), change your current directory to move in to your Rails application's root directory, and then type in the "mongrel_rails&quot; command with whatever options you like.

Curt

_______________________________________________
Instantrails-users mailing list
rubyforge.org">Instantrails-usersrubyforge.org
http://rubyforge.org/mailman/listinfo/instantrails-users


Mongrel BAD CLIENT errors
user name
2006-10-10 14:38:13
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Havard wrote:
> Thank you Curt.
> 
> That has got debugging working but has made things no
clearer on why
> some of my form posts are not working. The post does
not seem to get
> logged - only reported as a bad client to the console
window. Any ideas
> what I should be looking for? My view contains the
following code:


According to http://mongrel.
rubyforge.org/faq.html, a BAD CLIENT error means the
web browser sent an invalid HTTP request; it has nothing to
do with rails.

What browser are you using?

- From that FAQ:

What does BAD CLIENT mean?

It means that a request came in which Mongrel rejects
because it doesn?t follow
the RFC grammar. Mongrel is pretty relaxed about most
requests, but in order to
block the majority of security attacks for web servers it is
strict about
characters used, header formats, status line formats, etc.
This is also based on
matching the RFC?s grammar specification to a Ragel grammar
specification, so
it?s easy to compare.

If you need to know why the client is triggering this, then
simply hit your
Mongrel processes with USR1 signals and they?ll log the full
request data and
parameters that were collected. Then, if you think the
request is valid send me
this data and I?ll look. If it?s not valid than fix the
client.

Mongrel takes the stance that all clients are written by
software developers and
that they should follow the standard. By doing this it
reduces the bugs and
potential security holes found in many other web servers. It
also means that if
you absolutely have to allow a bad client, then you?ll need
to not use Mongrel.




- --
David Morton
Maia Mailguard                        - http://www.maiamailguard
.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFFK7BVUy30ODPkzl0RAma3AKDRcqL3oQJ5tvk3XyX1YJzuJHkvuQCg
lr2d
1fx9ureC6X0dzEDqSo1JgaM=
=397F
-----END PGP SIGNATURE-----
_______________________________________________
Instantrails-users mailing list
Instantrails-usersrubyforge.org
http://rubyforge.org/mailman/listinfo/instantrails-users

Mongrel BAD CLIENT errors
user name
2006-10-10 19:01:17
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Oct 10, 2006, at 9:38 AM, David Morton wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dave Havard wrote:
>> Thank you Curt.
>>
>> That has got debugging working but has made things
no clearer on why
>> some of my form posts are not working. The post
does not seem to get
>> logged - only reported as a bad client to the
console window. Any  
>> ideas
>> what I should be looking for? My view contains the
following code:
>
>
> According to http://mongrel.
rubyforge.org/faq.html, a BAD CLIENT  
> error means the
> web browser sent an invalid HTTP request; it has
nothing to do with  
> rails.

actually, now that I think about it, perhaps a request has a
bad  
character in it, or isn't properly url encoded?



David Morton
Maia Mailguard http://www.maiamailguard
.com
mortondadgrmm.net



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFK+4DUy30ODPkzl0RAs07AKC41WT2g+7DCvw9wudA1pFe3UN3YgCg
kLVP
SmJILQExLXV0SppFk96d2SY=
=qYsA
-----END PGP SIGNATURE-----
_______________________________________________
Instantrails-users mailing list
Instantrails-usersrubyforge.org
http://rubyforge.org/mailman/listinfo/instantrails-users

Mongrel BAD CLIENT errors
user name
2006-10-10 23:16:25
Thanks David

So are they saying that mongrel will fail if the browser is not right? I am testing on IE6.0.29 and FF1.5. Would be surprised if mongrel does not work with these browsers - how could it be used in production?

Have you heard about this problem much? Seems like mongrel is become the server of choice for rails, but even the scaffold code is failing - can't believe it is rails or this issue would be plastered all over the net by now. At the same time a web server which will not work with FF1.5 seem unrealistic.

Could it be something else? Maybe apache is changing something before passing the request to mongrel?

Given InstantRails is installing elsewhere without fuss i'll test on some more machines...

Thanks for your help.
Dave



On 10/10/06, David Morton < mortondadgrmm.net">mortondadgrmm.net> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Oct 10, 2006, at 9:38 AM, David Morton wrote:

&gt; -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dave Havard wrote:
>;> Thank you Curt.
>>
>&gt; That has got debugging working but has made things no clearer on why
>&gt; some of my form posts are not working. The post does not seem to get
>&gt; logged - only reported as a bad client to the console window. Any
>&gt; ideas
>> what I should be looking for? My view contains the following code:
>;
>
> According to http://mongrel.rubyforge.org/faq.html, a BAD CLIENT
>; error means the
> web browser sent an invalid HTTP request; it has nothing to do with
> rails.

actually, now that I think about it, perhaps a request has a bad
character in it, or isn't properly url encoded?



David Morton
Maia Mailguard http://www.maiamailguard.com
mortondadgrmm.net">mortondadgrmm.net



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFK+4DUy30ODPkzl0RAs07AKC41WT2g+7DCvw9wudA1pFe3UN3YgCgkLVP
SmJILQExLXV0SppFk96d2SY=
=qYsA
-----END PGP SIGNATURE-----
_______________________________________________
Instantrails-users mailing list
Instantrails-usersrubyforge.org">Instantrails-usersrubyforge.org
http://rubyforge.org/mailman/listinfo/instantrails-users

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )