# Strange Record not saved errors

**URL:** <https://www.ruby-forum.com/t/strange-record-not-saved-errors/90135>\
**Category:** Rails\
**Created:** [March 26, 2007, 10:20am UTC](https://www.ruby-forum.com/t/strange-record-not-saved-errors/90135 "2007-03-26T10:20:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [March 26, 2007, 10:20am UTC](https://www.ruby-forum.com/t/strange-record-not-saved-errors/90135/1 "2007-03-26T10:20:39Z")

</div>

I have a site with an acts\_as\_authenticated based login which has  
started throwing up some strange errors. Until a few days ago  
everything worked fine but all of a sudden ‘RecordNotSaved’ errors are  
popping up in my logs.

When I check the database, it looks like the record _is_ saved but I  
think users get an error so I’m starting to see a lot of double/triple  
entries for the same user. It doesn’t happen all the time and I can’t  
really reproduce it myself and the log entry is not very helpful so I  
have no idea how to solve this… I am not even sure which direction to  
look… could it be related to mysql performance errors or something?

This is the error I’m getting:

A ActiveRecord::RecordNotSaved occurred in account#signup:

ActiveRecord::RecordNotSaved  
[RAILS\_ROOT]/vendor/rails/activerecord/lib/active\_record/base.rb:  
1398:in `save\_without\_validation!’

---

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [March 26, 2007, 12:41pm UTC](https://www.ruby-forum.com/t/strange-record-not-saved-errors/90135/2 "2007-03-26T12:41:20Z")

</div>

this looks like it happens when you try to sign up a new user. does it  
happen with other actions aswell or is it specific to signup?

What does your controller function for signup look like and can you post  
the  
user model?  
In my user model I have these validations that could be causes problems  
for  
you if they are present in your model.

validates\_presence\_of :login, :email  
validates\_presence\_of :password, :if =\>  
:password\_required?  
validates\_presence\_of :password\_confirmation, :if =\>  
:password\_required?  
validates\_length\_of :password, :within =\> 4…40, :if =\>  
:password\_required?  
validates\_confirmation\_of :password, :if =\>  
:password\_required?  
validates\_length\_of :login, :within =\> 3…40  
validates\_length\_of :email, :within =\> 3…100  
validates\_uniqueness\_of :login, :email, :case\_sensitive =\> false  
before\_save :encrypt\_password

Regards  
Ivor

---

<div class="post-metadata">

**Author:** ![jeroen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@jeroen](https://www.ruby-forum.com/u/jeroen)\
**Post date:** [March 26, 2007, 2:04pm UTC](https://www.ruby-forum.com/t/strange-record-not-saved-errors/90135/3 "2007-03-26T14:04:44Z")

</div>

You haven’t recently started using clustered servers, have you?
