https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-10-20T11:18:00ZRedmineRedmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=421892012-10-20T11:18:00ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>Any local changes or plugins ?</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=421932012-10-20T12:35:28ZEtienne Massip
<ul></ul><p>FTR I've seen a similar stack trace in another recent issue but I can't find it back.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=421942012-10-20T14:00:22ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>This stack trace shows that <code>AccountController#login</code> goes through <code>:check_if_login_required filter</code>.<br />That should not happen because of <code>skip_before_filter :check_if_login_required</code>.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=486972013-04-17T12:36:00ZAndré Jonsson
<ul></ul><p>I have the same problem after a fresh install of Redmine 2.3 (i.e. no plugin baggage).<br />The database was, however, migrated from an 1.3 install.</p>
<p>Here's a debug log:</p>
<pre>
Started GET "" for 192.168.6.152 at 2013-04-17 14:37:36 +0200
Processing by WelcomeController#index as HTML
(1.5ms) SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
Setting Load (0.1ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'autologin' LIMIT 1
Token Load (0.1ms) SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'autologin' AND `tokens`.`value` = '74367b4f50b34b503852b6d0ef63788e86b0c995' LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 3 LIMIT 1
Setting Load (0.1ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'rest_api_enabled' LIMIT 1
AnonymousUser Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
Current user: anonymous
Setting Load (0.1ms) SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'login_required' LIMIT 1
Redirected to http://scm.XX.se/login?back_url=http%3A%2F%2Fscm.XX.se%2F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 199ms (ActiveRecord: 5.2ms)
Started GET "?back_url=http%3A%2F%2Fscm.XX.se%2F" for 192.168.6.152 at 2013-04-17 14:37:36 +0200
Processing by WelcomeController#index as HTML
Parameters: {"back_url"=>"http://scm.XX.se/"}
(0.1ms) SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
Token Load (0.1ms) SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'autologin' AND `tokens`.`value` = '74367b4f50b34b503852b6d0ef63788e86b0c995' LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 3 LIMIT 1
AnonymousUser Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
Current user: anonymous
Redirected to http://scm.XX.se/login?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 5ms (ActiveRecord: 0.4ms)
Started GET "?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F" for 192.168.6.152 at 2013-04-17 14:37:36 +0200
Processing by WelcomeController#index as HTML
Parameters: {"back_url"=>"http://scm.XX.se/?back_url=http%3A%2F%2Fscm.XX.se%2F"}
(0.1ms) SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
Token Load (0.1ms) SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'autologin' AND `tokens`.`value` = '74367b4f50b34b503852b6d0ef63788e86b0c995' LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 3 LIMIT 1
AnonymousUser Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
Current user: anonymous
Redirected to http://scm.XX.se/login?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
Started GET "?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F" for 192.168.6.152 at 2013-04-17 14:37:36 +0200
Processing by WelcomeController#index as HTML
Parameters: {"back_url"=>"http://scm.XX.se/?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F"}
(0.1ms) SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
Token Load (0.1ms) SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'autologin' AND `tokens`.`value` = '74367b4f50b34b503852b6d0ef63788e86b0c995' LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 3 LIMIT 1
AnonymousUser Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
Current user: anonymous
Redirected to http://scm.XX.se/login?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F%25253Fback_url%25253Dhttp%2525253A%2525252F%2525252Fscm.XX.se%2525252F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
Started GET "?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F%25253Fback_url%25253Dhttp%2525253A%2525252F%2525252Fscm.XX.se%2525252F" for 192.168.6.152 at 2013-04-17 14:37:36 +0200
Processing by WelcomeController#index as HTML
Parameters: {"back_url"=>"http://scm.XX.se/?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F"}
(0.1ms) SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
Token Load (0.1ms) SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'autologin' AND `tokens`.`value` = '74367b4f50b34b503852b6d0ef63788e86b0c995' LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 3 LIMIT 1
AnonymousUser Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('AnonymousUser') LIMIT 1
Current user: anonymous
Redirected to http://scm.XX.se/login?back_url=http%3A%2F%2Fscm.XX.se%2F%3Fback_url%3Dhttp%253A%252F%252Fscm.XX.se%252F%253Fback_url%253Dhttp%25253A%25252F%25252Fscm.XX.se%25252F%25253Fback_url%25253Dhttp%2525253A%2525252F%2525252Fscm.XX.se%2525252F%2525253Fback_url%2525253Dhttp%252525253A%252525252F%252525252Fscm.XX.se%252525252F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
</pre>
<p>I tried removing all "autologin" tokens in the database, but no change.</p>
<p>As it says "Filter chain halted as :check_if_login_required rendered or redirected" it seems to stop, as you say. But then the browser issues another GET (as a reaction to the 302 it gets), and it loops...</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=487222013-04-18T08:12:57ZAndré Jonsson
<ul></ul><p>Tried with a completely clean database, and it works!</p>
<p>So... there's something in the database that causes this, the question is what. Will try to copy table by table from the old database to see when it breaks.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=487232013-04-18T08:55:02ZAndré Jonsson
<ul></ul><p>I had a tiny breakthrough; setting "settings.login_required" to 0 in the database will fix the problem.<br />But of course, this is useless as users are disabled. :-/</p>
<p>UPDATE: scratch the "fix the problem part"; the redirection loop doesn't occurr anymore, but now all links will show the "Home" page.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=487302013-04-18T09:49:15ZAndré Jonsson
<ul></ul><p>I guess I'm the only one reading these comments, this issue might serve as reference for someone else.</p>
<p>Another detail I discovered: if I start a webrick server using the same database everything works (except ldap auth which was configured in apache).<br />So there's definitely something amiss with the passenger/apache config that causes this.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=487312013-04-18T09:55:52ZAndré Jonsson
<ul></ul><p>Back to apache+passenger with login_required = 1, all links now show the "Home" page (I still have a session cookie from the webrick session).</p>
<p>I can see in the log that whatever sub-URL I go to in the browser the log says I'm requesting "". This must be the actual culprit. But why?</p>
<p>Here, I typed just gibberish into the path: <a class="external" href="http://scm.XX.se/iouashdfiouashdf">http://scm.XX.se/iouashdfiouashdf</a>, and got this in the log:</p>
<pre>
Started GET "" for 192.168.6.152 at 2013-04-18 11:53:35 +0200
Processing by WelcomeController#index as HTML
Current user: andjonss (id=3)
Rendered news/_news.html.erb (2.1ms)
Rendered welcome/index.html.erb within layouts/base (14.6ms)
Completed 200 OK in 38ms (Views: 31.7ms | ActiveRecord: 0.6ms)
</pre>
<p>My /etc/apache2/mods-enabled/passenger.conf looks like this:<br /><pre>
<IfModule mod_passenger.c>
PassengerSpawnMethod smart
RailsAppSpawnerIdleTime 86400
PassengerPoolIdleTime 86400
PassengerRoot /usr/lib/phusion-passenger
PassengerRuby /usr/bin/ruby1.9.3
</IfModule>
</pre></p>
<p>As for the <code>PassengerRoot</code> value, I saw in the passenger guide that it suggests the gem path of passenger instead, which in my case is "/var/lib/gems/1.9.1/gems/passenger-3.0.19/".<br />But if I use that it complains that "agents/PassengerWatchdog" can't be started. This binary is in "/usr/lib/phusion-passenger/agents" on my system (provided by the <code>ruby-passenger</code> package), but not much else.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=487402013-04-18T13:35:52ZAndré Jonsson
<ul></ul><p>Finally gave up and went back to using fcgi instead.</p> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=525672013-10-14T09:52:10ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Сyclic recursion redirects</i> to <i>Cyclic recursion redirects</i></li></ul> Redmine - Defect #12161: Cyclic recursion redirectshttps://www.redmine.org/issues/12161?journal_id=526392013-10-17T14:30:14ZBrad Street
<ul></ul>Don't know if it will help you, but I found a fix! I just experienced the redirect loop problem when attempting to access Redmine. On the settings page, I had set to require a login to view pages. After the session expired, this issue presented itself. To correct it:
<ul>
<li>Logged into phpmyadmin and changed the value of login_required in the settings table from 1 to 0.</li>
<li>Restarted Thin_redmine and Apache servers (it seems that the page is cached so it doesn't register if you don't restart both servers).</li>
<li>After this, I was able to log in</li>
</ul>
<p>Not a total solution perhaps, but at least might help get someone back to a working state.</p>