Forum OpenACS Development: Error: return: failed to redirect

Collapse
Posted by Iuri Sampaio on
Hi all,

Suddenly it has started to pop up an error message at error.log

[10/Sep/2009:23:06:46][20003.3032288176][-conn:openacs::0] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[10/Sep/2009:23:06:56][20003.3031235504][-conn:openacs::1] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[10/Sep/2009:23:07:06][20003.3030182832][-conn:openacs::2] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[10/Sep/2009:23:07:16][20003.3029130160][-conn:openacs::3] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[10/Sep/2009:23:07:22][20003.2864376752][-sched:14-] [10/Sep/2009:23:07:27][20003.3028077488][-conn:openacs::4] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3

I am trying to understand the reason and what is causing it. But i haven't succeeded on my attempts.

I see there's a pattern in this error: it always happens in loops of 5 times and I am aware aolserver has parameters ns_param in the file config.tcl that are related to the error.

#
# Special HTTP pages
#
ns_param NotFoundResponse "/global/file-not-found.html"
ns_param ServerBusyResponse "/global/busy.html"
ns_param ServerInternalErrorResponse "/global/error.html"

I also browsed oacs website looking for answers but nothing leads to a cause.
https://openacs.org/forums/message-view?message_id=34265

does anyone know what is the reason that aolserver is failing to redirect?

Collapse
Posted by Dave Bauer on
AOLserver can't find the file you have specified for NotFoundResponse.

So when you get an HTTP request for a file that does not exist, it redirects to the file specified for NotFoundResponse, can't find it, and redirects to the file specified for NotFoundResponse, until it hits the redirect recursion limit.

The file should be under openacs/www/global/file-not-found.html according to your configuration.

Collapse
Posted by Iuri Sampaio on
Right, I can see that.

But nobody can access my server. It is under a intranet and I am not attempting to access http pages

My thoughts are that i hit a non-existent page once and aolserver got stuck on that loop.

Furthermore, I changed the paths in the aolserver parameters in the config.tcl file.

ns_param NotFoundResponse "${serverroot}/www/global/file-not-found.html"
ns_param ServerBusyResponse "${serverroot}/www/global/busy.html"
ns_param ServerInternalErrorResponse "${serverroot}/www/global/error.html"

Under oacs root directory within www/ directory, there's a default global directory. However, i still get errors as if aolserver hasn't recgnized the changes.
ps. i restarted the service.

[11/Sep/2009:10:56:08][21007.3032509360][-conn:openacs::0] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[11/Sep/2009:10:56:19][21007.3031456688][-conn:openacs::1] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[11/Sep/2009:10:56:29][21007.3030404016][-conn:openacs::2] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[11/Sep/2009:10:56:40][21007.3029351344][-conn:openacs::3] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[11/Sep/2009:10:56:57][21007.3028298672][-conn:openacs::4] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3

Collapse
Posted by Dave Bauer on
I think the redirects are always relative to the page root. Since it's the config file you need to restart AOLserver after changing it.

You can check the access logs to correlate the 404 request in the access to to the not found response you see in the error log.

Collapse
Posted by Torben Brosten on
Iuri,

If config.tcl problems and file permissions are not the cause, could the problem be with aolserver? Is aolserver new or recently updated?

I've had a server with symptoms like this that turned out to be from a corrupted aolserver installation (another time was due to a bad installation update). Installing a fresh aolserver fixed it.

Before re-installing aolserver, verify file permissions by requesting an existing static page, such as robots.txt. Also check the config.tcl against the latest one in cvs.

cheers,

Torben

Collapse
Posted by Iuri Sampaio on
Torben,

That is what i thought as well. But i have two more oacs boxes running under the same aolserver instance. Those are mirrors of the one that got the error and they have no errors at all. Thank GOD! I guess if the problem was aolserver the error would show up on them too. Or maybe not, depending on what broke in AOLServer i believe.

So, I followed you and I debugged and compared the config.tcl with the current one availlable on CVS HEAD. Everything seems fine.

I also tested some pages: static such as robots.txt and dinamic such as adp and tcl pages. Everything seems fine again.

Then, Eureka!
Dave, you gave me a good intuition. I checked access logs and compared it against the error at error.log.

i saw this line bellow repeated many times:
[10/Sep/2009:23:07:16 -0700] "GET /project-manager/fred-dispatch-development/?project%5fitem%5fid=2548 HTTP/1.1" 200 89135 "http://iurix\
.com:8090/project-manager/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13" 1.778940 "style=null\; ad_user_login=643%2c1252527899%2c1600821E2+%7b714+0+300FF92F605B71EC439DC07787D1BDF782E77C99%7d; ad_session_id=310101%2c643%2c1+%7b343+1252553651+FD87497E91F95B028350A385B39C361B8F60A20E%7d"

Their log time match and that caught my attention. So, i reinstalled project-manager and the error is gone!

Although, this error is weird to me. It means that aolserver is locked up with project-manager application.
Or even worst, pm did something bad to aolserver installation. But those are just ideas. I need to debug it

Collapse
Posted by Don Baccus on
Usually when this is seen on a server visible to the intranet, it's due to the site being probed by spiders (probably crackbots) using webdav requests, when the webdav filters haven't been set up (i.e. you're not using that package). This causes the 3-deep recursion error.

Just FYI ...

I think this may've disappeared with 4.5 though ...

Collapse
Posted by Hector Amado on
Hi all, i am having the same warnings with aolserver 4.5.1 and oacs 5.5.1 on a server visible to Internet,

[25/Sep/2009:10:15:47][13777.1342175600][-conn:ges2::25] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[25/Sep/2009:10:15:48][13777.1207957872][-conn:ges2::11] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3
[25/Sep/2009:10:16:04][13777.1199569264][-conn:ges2::10] Error: return: failed to redirect 'GET /global/file-not-found.html': exceeded recursion limit of 3

To reproduce the error just visit some wrong url (eg. https://openacs.org/a.css )

I have the default config parameters:

#
# Special HTTP pages
#
ns_param NotFoundResponse "/global/file-not-found.html"
ns_param ServerBusyResponse "/global/busy.html"
ns_param ServerInternalErrorResponse "/global/error.html"

ns_section ns/server/${server}/redirects
ns_param 404 "global/file-not-found.html"
ns_param 403 "global/forbidden.html"

You can reproduce the error in a fresh openacs install.

Thanks for the help,

Best Regards

Collapse
Posted by Don Baccus on
This bug was supposedly fixed in AOLserver 4.5.1:

https://openacs.org/forums/message-view?message_id=2115048

but apparently it hasn't been?

Collapse
Posted by Torben Brosten on

It's working for at least one aolserver 4.5.1 on freebsd using this in nsd.tcl:

   #
    # Special HTTP pages
    #
    ns_param   NotFoundResponse   "/global/404.adp"
    ns_param   ServerBusyResponse "/global/busy.html"
    ns_param   ServerInternalErrorResponse "/global/error.html"

#---------------------------------------------------------------------
# 
# ADP (AOLserver Dynamic Page) configuration 
# 
#---------------------------------------------------------------------
ns_section ns/server/${server}/adp 
    ns_param   map                /*.adp    ;# Extensions to parse as ADP's 
#    ns_param   map                "/*.html" ;# Any extension can be mapped 
    ns_param   enableexpire       false     ;# Set "Expires: now" on all ADP's 
    ns_param   enabledebug        $debug    ;# Allow Tclpro debugging with "?debug"
    ns_param   defaultparser      fancy

ns_section ns/server/${server}/adp/parsers
    ns_param   fancy    ".adp"

ns_section ns/server/${server}/redirects
    ns_param   404                "/global/404.adp"
    ns_param   403                "/global/forbidden.html"

Collapse
Posted by Hector Amado on
Don and Torben, many thanks for your help.

The config worked for me, using AOLserver 4.5.1 and creating the www/global/404.adp file.

Best Regards,

Hector Amado

Collapse
Posted by Michael Aram on
I just had a very similar problem. I use a fresh Ubuntu 8.04 and the OpenACS-Ubuntu Package.

For me, un-commenting the line

#ns_param map "/*.html" ;# Any extension can be mapped

did the trick. But maybe this has other unwanted implications?


#---------------------------------------------------------------------
#
# ADP (AOLserver Dynamic Page) configuration
#
#---------------------------------------------------------------------
ns_section ns/server/${server}/adp
ns_param map /*.adp ;# Extensions to parse as ADP's
ns_param map "/*.html" ;# Any extension can be mapped
ns_param enableexpire false ;# Set "Expires: now" on all ADP's
ns_param enabledebug $debug ;# Allow Tclpro debugging with "?debug"
ns_param defaultparser fancy

ns_section ns/server/${server}/adp/parsers
ns_param fancy ".adp"


ns_section ns/server/${server}/redirects
ns_param 404 "global/file-not-found.html"
ns_param 403 "global/forbidden.html"