# Strange 500 Internal Server Error Related

**URL:** <https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905>\
**Category:** Rails\
**Created:** [June 8, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905 "2008-06-08T23:12:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 8, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/1 "2008-06-08T23:12:06Z")

</div>

Well, I’ve been trying to fix this all day, and I’ve come up empty. It  
seems that, for some mysterious reason, my app now doesn’t like to  
register new users, at least in my development environment. I sent my  
code to my friend (who should be running in the same environment I am,  
since I helped him set his up), and he doesn’t get any errors  
registering users. I’ve tried reinstalling Rails, but that didn’t fix  
it. I reinstalled Rails and all its dependencies, but that didn’t fix  
it. I tried reinstalling Ruby, RubyGems, Rails, and dependencies, but I  
STILL get the same 500 Internal Server Error. I’ve gone through all of  
my code, and it seems like this isn’t because of something I wrote.  
Here’s what shows up in the log file:

Rendering  
C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action\_controller/templates/rescues/layout.erb  
(not\_found)  
/!\ FAILSAFE /!\ Sun Jun 08 17:05:19 -0400 2008  
Status: 500 Internal Server Error  
Conflicting types for parameter containers. Expected an instance of  
Array but found an instance of Hash. This can be caused by colliding  
Array and Hash parameters like qs[]=value&qs[key]=value. (The parameters  
received were {“ruler”=\>"", “nation\_name”=\>"", “password”=\>"",  
“email”=\>""}.)

After that is the trace, which shows no references to any files I’ve  
written or modified. Has anyone experienced anything like this before,  
or have any ideas on how to fix this? Any help would be GREATLY  
appreciated 🙂

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 8, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/2 "2008-06-08T23:41:42Z")

</div>

On Jun 8, 10:12 pm, Dan \_\_ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “email”=\>“”}.)

The interesting bit is going to be the data posted to your app (and by  
extension the form that the user fills in.

Fred

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 9, 2008, 12:02am UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/3 "2008-06-09T00:02:27Z")

</div>

> The interesting bit is going to be the data posted to your app (and by  
> extension the form that the user fills in.
> 
> Fred

The data that should be being sent is simple registration stuff, user  
name, a second user name (it makes sense within my app), email,  
password, password confirmation, and acceptance of the TOS. The error  
message suggests that it does something (or rather, tries to do  
something) with this, once submit is pressed (I used blank values for  
all fields when getting the error from the log file. It will show the  
values in the error message if I enter them, but will still cause an  
error even if the information is valid and should be accepted).

The code for my registration form:

\<% form\_for :user do |form|%\>

 Enter Your Details

```
<%= error_messages_for "user"%>
<%= render :partial=>"nation_name_field_row", 

```

:locals=\>{:form=\>form}%\>

```
<%= render :partial=>"ruler_field_row", :locals=>{:form=>form}%>

<%= render :partial=>"email_field_row", :locals=>{:form=>form}%>

<%= render :partial=>"password_field_row", :locals=>{:form=>form, 

```

:field=\>“password”}%\>

```
<%= render :partial=>"password_field_row", :locals=>{:form=>form, 

```

:field\_title=\>“Confirm”}%\>

```
<div class="form_row">
  <label for="tos">&nbsp</label>
  <%= render :partial => "tos", :locals =>{:form => form}%>
  <br/>
</div>

<div class="form_row">
  <%= submit_tag "Register!", :class=>"submit"%>
</div>

```

 \<% end %\>

The nation\_name\_field\_row partial:

 Nation Name: \<%= form.text\_field :nation\_name, :size=\>User::NAMES\_MAX\_LENGTH, :maxlength=\>User::NAMES\_MAX\_LENGTH%\>

The ruler\_field\_row partial:

 Ruler: \<%= form.text\_field :ruler, :size=\>User::NAMES\_MAX\_LENGTH, :maxlength=\>User::NAMES\_MAX\_LENGTH%\>

The email\_field\_row partial:

Email: \<%= form.text\_field :email, :size=\>User::EMAIL\_MAX\_LENGTH, :maxlength=\>User::EMAIL\_MAX\_LENGTH%\>

And finally, the password field row partial:

\<% field\_title = nil if not defined?(field\_title)%\>

 \<%= field\_title || field.humanize%\> \<%= form.password\_field field, :size=\>User::PASSWORD\_MAX\_LENGTH, :maxlength=\>User::PASSWORD\_MAX\_LENGTH%\>

I should point out that most of these partials are used in other places  
in the application (the login page), and they don’t cause this same  
error there.

If needed, I can post the code in my controller too, but puts statements  
suggest that it doesn’t even try to execute.

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 12, 2008, 6:05pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/4 "2008-06-12T18:05:03Z")

</div>

On 8 Jun 2008, at 23:02, Dan \_\_ wrote:

> message suggests that it does something (or rather, tries to do  
> something) with this, once submit is pressed (I used blank values for  
> all fields when getting the error from the log file. It will show the  
> values in the error message if I enter them, but will still cause an  
> error even if the information is valid and should be accepted).

The html generated would be helpful too. Random guess: your password  
partial is confusing things because you appear to be using the same  
name for the field.

Other than that, use the standard approach: remove stuff from your  
form until it works, i.e. isolate the culprit

Fred

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 12, 2008, 5:43pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/5 "2008-06-12T17:43:44Z")

</div>

By the lack of responses since Fred’s initial one, I’m guessing this  
isn’t the easiest of things to solve.

My question then becomes, should I be fine continuing to work in the  
same environment, or am I most likely going to run into more strange  
errors like this one?

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 12, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/6 "2008-06-12T18:12:07Z")

</div>

I’ll post the HTML when I get home tonight. However, I’m fairly  
positive its nothing to do with the partials. The same setup has worked  
fine in other apps I’ve built (although its quite possible I’ve made a  
small mistake somewhere, which I’ll check for). The exact code I’m  
using runs fine for another, so unless he’s wrong about that (which is  
possible, since he’s quite new to Rails), then it can’t be anything  
weird with code I’ve written.

I also reverted the view (and other relevant code) back to a version  
when it was working without any problems, and still managed the same  
error.

I’ll try it again tonight to make sure, and post back the results 🙂

---

<div class="post-metadata">

**Author:** ![lottario](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lottario](https://www.ruby-forum.com/u/lottario)\
**Post date:** [June 13, 2008, 12:45am UTC](https://www.ruby-forum.com/t/strange-500-internal-server-error-related/139905/7 "2008-06-13T00:45:19Z")

</div>

Well, this turned out to be a completely stupid error on my part. I  
have no idea how my friend managed to run it. I looked at the html, and  
saw some blank spots for label names and stuff, which seemed odd. I  
looked at my register.html.erb again, and it turned out that I wasn’t  
passing a field variable to the partial for password confirmation.  
Adding that in fixed the problem.

Thanks very much for your help Fred (I honestly would’ve never thought  
to check the HTML without you) 🙂
