# LoginEngine dying on Rails 1.1?

**URL:** <https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706>\
**Category:** Engines\
**Created:** [March 29, 2006, 3:01am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706 "2006-03-29T03:01:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [March 29, 2006, 3:01am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/1 "2006-03-29T03:01:01Z")

</div>

Hi all.

I just finished upgrading a small Rails toy application to Rails 1.1 and  
it  
seems that LoginEngine no longer works. I have upgraded the Engines  
plugin  
using an svn checkout of the rel\_1.1.0, and while the Engines plugin  
seems  
to work fine (as does the UserEngine), the LoginEngine simply doesn’t do  
much of anything any more.

For instance, if I try to login, I’m simply redirected back to the login  
page, even though the username and password is correct. There are no  
flashes or anything indicating a bad login. Upon a successful login,  
none  
of the user information that would normally be stored in the session  
ends  
up getting stored. Other forms, such as the forgotten password form, are  
similarly broken.

I tried messing around with the user\_controller.rb, but any changes I  
make  
are just ignored. In fact, purposefully inserting syntax errors into the  
file or renaming it completely doesn’t even seem to have any effect on  
the  
situation.

I have no idea why the controller is just being ignored outright. I can  
make  
changes to the views and they appear fine, but it’s like the controller  
isn’t even there.

Anybody seeing anything remotely similar?

If it helps, I’m using Ruby 1.8.4, Rails 1.1, Apache 1.3.34 and FastCGI  
2.4.0. I’m experiencing the problem both with FastCGI enabled and plain  
ol’  
non-Fast-CGI. Engines, UserEngine and LoginEngine are all up-to-date  
checkouts.

Cheers.

J

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [March 30, 2006, 6:12am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/2 "2006-03-30T06:12:46Z")

</div>

J Smith wrote:

> page, even though the username and password is correct. There are no  
> I have no idea why the controller is just being ignored outright. I can  
> Cheers.
> 
> J

Well, I was able to get around this problem, but it seems that what I  
was  
experiencing was something similar to ticket #53.

I ended up copying the contents of user\_controller.rb from UserEngine  
and  
pasted it into the user\_controller.rb script for LoginEngine and moved  
the  
UserEngine file out of the way. Now everything seems to work.

Is this a legitimate bug, or am I doing something ridiculously wrong? I  
have  
checked and re-checked my configuration and removed and reinstalled the  
Engines, UserEngine and LoginEngine several times, but this was the only  
way I could get everything to work properly again. There seems to be  
something screwy with how Engines is doing the overriding of the  
controllers, as if methods were being ignored or something.

Am I alone in seeing this? I guess that would indicate that I’m the  
problem  
here and not Engines, but I’ve exhausted my debugging ability to come up  
with this workaround…

J

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [April 3, 2006, 6:34am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/3 "2006-04-03T06:34:26Z")

</div>

I am having the same problem here. I tried to do what you said but no  
luck; I still can’t create users.

Could you please tell me how you managed to merge the two files  
together?

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [April 3, 2006, 7:11am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/4 "2006-04-03T07:11:54Z")

</div>

I think I got the user creation to work by commenting out the

User.transaction(@user) do

After reading about transactions on [api.rubyonrails.com](http://api.rubyonrails.com) it didn’t make  
much sense why one would have a transaction there because there is only  
transaction. I did the same for the sign up which is in the  
user\_controller.rb in login\_engine and it worked too…

Oh, I wish that I could have found that out earlier…

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [April 21, 2006, 12:14am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/5 "2006-04-21T00:14:26Z")

</div>

J Smith wrote:

> > page, even though the username and password is correct. There are no  
> > I have no idea why the controller is just being ignored outright.
> 
> I ended up copying the contents of user\_controller.rb from UserEngine  
> and  
> pasted it into the user\_controller.rb script for LoginEngine and moved  
> the  
> UserEngine file out of the way. Now everything seems to work.

Thanks! I’ve had the same problem and I’ve been trying to work it out  
for hours, lol. The fix you gave there sorted all of the issues I was  
having, cheers.

To possibly shed some further light on the subject I managed to track it  
down to running under FastCGI, if I ran exactly the same code under SCGI  
everything worked perfectly.

Kev

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [May 6, 2006, 10:28am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/6 "2006-05-06T10:28:54Z")

</div>

> Thanks! I’ve had the same problem and I’ve been trying to work it out  
> for hours, lol. The fix you gave there sorted all of the issues I was  
> having, cheers.
> 
> To possibly shed some further light on the subject I managed to track it  
> down to running under FastCGI, if I ran exactly the same code under SCGI  
> everything worked perfectly.
> 
> Kev

hi, Kev  
I got the same problem…when I input something and submit,nothing  
happened,no flash notice,no error showin up  
I googled this page,and tried his way(the\_copy\_past\_thing)…but still  
can’t work

would you please tell me how to copy "the contents of user\_controller.rb  
from UserEngine and pasted it into the user\_controller.rb script for  
LoginEngine "

thank in advance

batz  
06/05

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [August 8, 2006, 4:06am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/7 "2006-08-08T04:06:06Z")

</div>

I was also bitten by this, during a site migration from a host that used  
lighttpd to one that used apache+fastcgi. I can confirm that switching  
to slowcgi fixes it (at least temporarily).

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [May 15, 2006, 5:51am UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/8 "2006-05-15T05:51:16Z")

</div>

Roland M. wrote:

> I think I got the user creation to work by commenting out the
> 
> User.transaction(@user) do
> 
> After reading about transactions on [api.rubyonrails.com](http://api.rubyonrails.com) it didn’t make  
> much sense why one would have a transaction there because there is only  
> transaction. I did the same for the sign up which is in the  
> user\_controller.rb in login\_engine and it worked too…
> 
> Oh, I wish that I could have found that out earlier…

I took your suggestion and it worked too. My problem is it worked for  
couple days and then failed without any error. What i also isolated out  
is that the transaction does not work between rails 1.1 and the login  
engine. Our other stuff that uses transactions and works fine.

Thanks.

---

<div class="post-metadata">

**Author:** ![J\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@J\_Smith](https://www.ruby-forum.com/u/J_Smith)\
**Post date:** [August 29, 2006, 2:33pm UTC](https://www.ruby-forum.com/t/loginengine-dying-on-rails-1-1/89706/9 "2006-08-29T14:33:11Z")

</div>

Roland M. wrote:

> I think I got the user creation to work by commenting out the
> 
> User.transaction(@user) do
> 
> After reading about transactions on [api.rubyonrails.com](http://api.rubyonrails.com) it didn’t make  
> much sense why one would have a transaction there because there is only  
> transaction. I did the same for the sign up which is in the  
> user\_controller.rb in login\_engine and it worked too…
> 
> Oh, I wish that I could have found that out earlier…

I can confirm that on a Win2K box with mongrel running as a Win32  
service, I was having problems with any code whatsoever on Rails 1.1.6  
and the latest release of user\_engine touching transactions. I had to  
remove transaction code from  
login\_engine/app/controllers/user\_controller.rb as well, and I saw the  
effects on ALL actions involving transaction - deleting users, editing  
roles, changing password, etc.

All fixed since removing the transaction code.
