3

Under Reports -> Recent log messages, I have a large number of errors such as the following:

I have a multilingual site (English en and Japanese ja), so I assume that somewhere there is a bad link or a module is outputting a bad link to the registration page. How can I find out where? The only clue I have is this entry in the recent error log.

When I visit the link (http://mysite.com/ja/user/en/user/register), I get a "The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

3
  • Start checking any nodes/blocks that might have a hardcoded link to the registration page. Have a look also at Link Checker module - if might detect the source. Commented Nov 7, 2013 at 11:44
  • yeah looks like a typical hard-coded relative href not set right
    – Pan Chrono
    Commented Nov 7, 2013 at 19:50
  • Is there a way to query the database to identify links to user/register? There's a lot of content, including links in Panels and Views, and the link(s) could be any number of places. Commented Nov 12, 2013 at 1:15

1 Answer 1

2

If you know the name of the failing redirect URI (such as user/register), the best is to scan through your database and look for redirect entries, e.g. using drush:

drush sql-dump --ordered-dump | grep "user/register"

Alternatively add dd() (from Devel) into drupal_goto() and log the backtrace of each call into the file, e.g.

dd(debug_backtrace(FALSE, 5));

and check drupal_debug.txt in your tmp folder.


Another trick include using DTrace and hook into static probes (if your PHP supports that: php -i | grep dtrace), for example (after running the script):

sudo dtrace -qn 'php*:::function-entry { printf("%Y: PHP function-entry:\t%s%s%s() in %s:%d\n", walltimestamp, copyinstr(arg3), copyinstr(arg4), copyinstr(arg0), basename(copyinstr(arg1)), (int)arg2); }'

then you may grep it and look for specific functions such as drupal_goto, so you may append to above:

| grep -B5 drupal_goto > trace.txt

so this will log into file all calls to drupal_goto with 5 function calls before.

See also: How to generate the function stack trace of the last request made?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.